Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group cart #188

Merged
merged 73 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
daf77af
add sign-in/up page
GalMunGral Mar 13, 2024
dbab384
disable password feedback for login
GalMunGral Mar 13, 2024
3f0bdc3
add group cart feature
GalMunGral Mar 14, 2024
9436bd5
add group cart feature
GalMunGral Mar 14, 2024
da99954
use generated join codes
GalMunGral Mar 19, 2024
34fa8d3
increase Angular budget (again)
GalMunGral Mar 19, 2024
75b7aa8
copy SVG animations from splash screen
GalMunGral Mar 19, 2024
9cab4f9
increase Angular budget (again x2)
GalMunGral Mar 19, 2024
dd9c76c
add trailing slash for request url
GalMunGral Mar 19, 2024
8b0e08f
update panel styles
GalMunGral Mar 28, 2024
e55f4f2
update panel styles
GalMunGral Mar 28, 2024
281d344
add list view & comparison view
GalMunGral Mar 28, 2024
c4f99bb
increase angular budget (again)
GalMunGral Mar 28, 2024
915ef38
add block library page
GalMunGral Apr 10, 2024
d027f8a
update navigation flow & header
GalMunGral Apr 11, 2024
8ef06fc
personal cart persistence
GalMunGral Apr 12, 2024
15e9e3a
close menu when clicking outside
GalMunGral Apr 12, 2024
a6172a0
small UX improvements
GalMunGral Apr 12, 2024
0797cd5
add support for touchscreens
GalMunGral Apr 15, 2024
6711507
move molecule details to side panel
GalMunGral Apr 18, 2024
a2f9b21
replace PATCH with PUT for now
GalMunGral Apr 18, 2024
967410e
add guest mode
GalMunGral Apr 18, 2024
e3e8e01
add confirmation modal
GalMunGral Apr 22, 2024
865f5eb
move toggle button & fix reset button
GalMunGral Apr 22, 2024
e4e5908
prevent triggering detail view when removing blocks
GalMunGral Apr 22, 2024
6c5c7a6
implement pinch zoom gesture
GalMunGral Apr 22, 2024
a62caf9
add SVGs to detail view
GalMunGral Apr 23, 2024
0b22c5e
fix exit dialog logic
GalMunGral Apr 23, 2024
52bd1eb
add block library card images
GalMunGral Apr 25, 2024
fa811f8
enable fullscreen mode for 2D/3D viz
GalMunGral Apr 25, 2024
5196621
fix pointer-tracking logic
GalMunGral Apr 26, 2024
a9fbecb
fix detail panel stale state
GalMunGral Apr 26, 2024
2b2369c
consolidate `workspaceService` and `cartService`
GalMunGral Apr 26, 2024
2298da5
consolidate `workspaceService` and `cartService`
GalMunGral Apr 26, 2024
cf04f30
enable transfer of molecules between personal and group carts
GalMunGral Apr 30, 2024
6aa4593
change text wording
GalMunGral May 1, 2024
33f369e
add links to tutorial videos
GalMunGral May 14, 2024
c6a0d70
remove multi-molecule support
GalMunGral May 14, 2024
23b5cb8
add preconnect hint
GalMunGral May 14, 2024
4483218
add tutorial text
GalMunGral May 16, 2024
c6425d6
add an admin page for submitting synthesis requests
GalMunGral May 20, 2024
4b0aa98
add more columns to admin table
GalMunGral May 20, 2024
e867a9c
rename synthesis endpoint
GalMunGral May 20, 2024
239d554
remove dead code
GalMunGral May 21, 2024
866ca8d
inject HTTP header through interceptor
GalMunGral May 21, 2024
6fc3a3d
fix unit tests
GalMunGral May 21, 2024
7457966
display user & group names in admin table
GalMunGral May 22, 2024
fb5597c
add help link
GalMunGral May 29, 2024
878edd4
add initial proof-of-concept
GalMunGral May 30, 2024
b2c24b7
update styles
GalMunGral May 30, 2024
9af97d9
replace XYZ curves with LMS
GalMunGral May 30, 2024
3aa36d9
update styles
GalMunGral May 30, 2024
b44e1b3
generate OPV blocks
GalMunGral Jun 7, 2024
fb67e0b
rename smiles directory
GalMunGral Jun 7, 2024
dc2261c
reprocess block set data
GalMunGral Jun 7, 2024
eeb0d1a
remove placeholder filters
GalMunGral Jun 7, 2024
2818208
fix change detection bug
GalMunGral Jun 7, 2024
30e460a
ingest OPV data
GalMunGral Jun 11, 2024
822c39d
ingest more OPV data
GalMunGral Jun 11, 2024
3bb4d44
update OPV data
GalMunGral Jun 11, 2024
2ced82d
fix Safari SVG display issue
GalMunGral Jun 11, 2024
8288cb7
update browserslist
GalMunGral Aug 16, 2024
4568083
refactor API endpoints
GalMunGral Sep 6, 2024
7d0bd73
improve code readability
GalMunGral Sep 10, 2024
85c1f60
remove unused code
GalMunGral Sep 10, 2024
3b516f7
remove unused code
GalMunGral Sep 10, 2024
d36409e
remove redundant auth headers
GalMunGral Sep 10, 2024
5f92bcd
delete unused code
GalMunGral Sep 10, 2024
3134afc
delete unused code
GalMunGral Sep 10, 2024
e0e4840
fix typos
GalMunGral Sep 10, 2024
f6da352
fix typos
GalMunGral Sep 10, 2024
a78c408
fix tutorial wording
GalMunGral Sep 10, 2024
55f987d
remove unused code
GalMunGral Sep 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
defaults
iOS >= 12
4 changes: 2 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1.5mb"
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "14kb"
"maximumError": "15kb"
}
],
"fileReplacements": [
Expand Down
126 changes: 125 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ python = "^3.12"
pandas = "^2.2.1"
openpyxl = "^3.1.2"
numpy = "^1.26.4"
rdkit = "^2023.9.6"


[build-system]
Expand Down
47 changes: 41 additions & 6 deletions scripts/process_color_wheel.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import itertools
import json
import os
from rdkit.Chem.Descriptors import MolWt
from rdkit.Chem import CanonSmiles, MolFromSmiles
from rdkit.Chem.rdMolDescriptors import CalcMolFormula

from utils import get_svg_dimensions, combine_chemical_formulas, combine
from utils import get_svg_dimensions, naive_combine

workdir = './src/assets/blocks/10x10x10palette'

with open(os.path.join(workdir, 'blocks.json')) as file:
with open(os.path.join(workdir, 'block_set.json')) as file:
block_set = json.load(file)

blocks_by_index = [[None], [None], [None]]
Expand All @@ -31,6 +34,29 @@ def process_blocks():
block_set['blocks'] = processed_blocks


def get_smiles(donor, bridge, acceptor):
"""
Returns SMILES of either a single block or a full 3-block combo
"""
blocks = [donor, bridge, acceptor]
blocks = [block for block in blocks if block]

if len(blocks) == 1:
return CanonSmiles(blocks[0]['properties']['smiles'])

if not donor or not bridge or not acceptor:
return ''

start = chr(ord('A') + (donor['id'] - 1))
mid = bridge['id']
end = chr(ord('K') + (acceptor['id'] - 1))

filename = workdir + f'/smi/{start}_{mid}_{end}.smi'
with open(filename) as f:
smiles = f.read().strip()
return smiles


def generate_lookup_table():
block_set['table'] = {}

Expand All @@ -40,12 +66,21 @@ def generate_lookup_table():
a_id = acceptor['id'] if acceptor else 0
key = f'{d_id}:{b_id}:{a_id}'

smiles = get_smiles(donor, bridge, acceptor)
chemical_formula = CalcMolFormula(MolFromSmiles(smiles))

all_smiles = [block['properties']['smiles'] if block else '' for block in (donor, bridge, acceptor)]

block_set['table'][key] = {
'key': key,
'chemicalFormula': combine_chemical_formulas(donor, bridge, acceptor),
'smiles': combine('smiles', '')(donor, bridge, acceptor),
'lambdaMaxShift': combine('lambdaMaxShift', 0)(donor, bridge, acceptor),
'molecularWeight': combine('molecularWeight', 0)(donor, bridge, acceptor),
'chemicalFormula': chemical_formula.replace('+', '').replace('-', ''),
'smiles': smiles,
'lambdaMaxShift': (
(donor['properties']['lambdaMaxShift'] if donor else 0)
+ (bridge['properties']['lambdaMaxShift'] if bridge else 0)
+ (acceptor['properties']['lambdaMaxShift'] if acceptor else 0)
),
'molecularWeight': MolWt(naive_combine(all_smiles))
}


Expand Down
Loading
Loading