simularium / simularium-viewer

NPM package to view Simularium trajectories in 3D
Apache License 2.0
2 stars 0 forks source link

Feature/session colors #400

Closed interim17 closed 2 weeks ago

interim17 commented 2 months ago

Time Estimate or Size

medium

related website branchs:
fix/update-ssi -> a patch to bring website into alignment with this changeset feature/color-session -> the end goal for the feature in development

Advances #510 and #511

Problem

On the front end we need to be storing and applying sets of color changes (browser sessions, or re-applying default). Current code assumes one-color-change-at-a-time.

Solution

UIDisplayData is a good existing data structure that conveys a snapshot of agent tree and its colors.

In SelectionStateInfo colorChanges have been replaced by appliedColors of type UIDisplayData

This is more consistent with the other parts of the selection object which serves as a snapshot of the selection state, rather than as a pass-through for a series of changes.

Keeping this change set small. Possible further changes would keep the SelectionInterface entries object in sync with "rendered state"... Might be useful for writing changes out to new files, not needed right now for MVP.

Type of change

github-actions[bot] commented 2 months ago

jest coverage report πŸ§ͺ

Total coverage

Status Category Percentage Covered / Total
πŸ”΄ Statements 40.95% 2043/4989
πŸ”΄ Branches 43.21% 838/1939
πŸ”΄ Functions 36.92% 418/1132
πŸ”΄ Lines 41.17% 1956/4751

Status of coverage: 🟒 - ok, 🟑 - slightly more than threshold, πŸ”΄ - under the threshold

Show files with reduced coverage πŸ”» ### Reduced coverage | Status | Filename | Statements | Branches | Functions | Lines | | :----: | :-------------- | :--------- | :------- | :-------- | :------ | | πŸ”΄ | index.ts | 7.69% | 7.25% | 5.64% | 7.65% | | πŸ”΄ | src/viewport | 14.09% | 10.52% | 13.95% | 13.65% | | πŸ”΄ | index.tsx | 14.09% | 10.52% | 13.95% | 13.65% | | πŸ”΄ | src/visGeometry | 21.76% | 22.79% | 27.5% | 21.63% | > Status of coverage: 🟒 - ok, 🟑 - slightly more than threshold, πŸ”΄ - under the threshold
interim17 commented 3 weeks ago

looks good, I would pull out the AgentData fix into it's own PR and make sure the exports are consistent with how we're exporting all the other types from the system

For context for other reviewers, this is done, the fix has been merged into both main and this branch.