simularium / simularium-viewer

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

reset colorsData to default before mapping agent colors when loading โ€ฆ #376

Closed interim17 closed 4 months ago

interim17 commented 4 months ago

Time Estimate or Size

Xsmall

Problem

Colors are wrong when loading consecutive local files. This issue.

Solution

We were clearing the colorMapping when loading a new trajectory, but the colorsData array was retaining changes if the previous trajectory had added non-default colors, we now reset it to the default agent colors when loading new trajectories.

Steps to Verify:

  1. Download the two trajectories @blairlyons linked in the issue and try loading them back to back, on main the second trajectory should show an incorrect (usually yellow) color. On this branch they should be the correct reds and grays you can confirm from the uiDisplayData.

Screenshots (optional):

Screenshot 2024-04-10 at 9 34 36 AM Screenshot 2024-04-10 at 9 34 26 AM
github-actions[bot] commented 4 months ago

jest coverage report ๐Ÿงช

Total coverage

Status Category Percentage Covered / Total
๐Ÿ”ด Statements 40.36% 2045/5066
๐Ÿ”ด Branches 43.22% 845/1955
๐Ÿ”ด Functions 36.74% 417/1135
๐Ÿ”ด Lines 40.58% 1958/4824

Status of coverage: ๐ŸŸข - ok, ๐ŸŸก - slightly more than threshold, ๐Ÿ”ด - under the threshold

Show files with reduced coverage ๐Ÿ”ป ### Reduced coverage | Status | Filename | Statements | Branches | Functions | Lines | | :----: | :-------------- | :---------------- | :------- | :-------------- | :---------------- | | ๐Ÿ”ด | src/visGeometry | 21.87% | 22.95% | 27.81% | 21.75% | | ๐ŸŸก | ColorHandler.ts | 66.34% (-1.3% ๐Ÿ”ป) | 75% | 60% (-2.06% ๐Ÿ”ป) | 65.3% (-1.36% ๐Ÿ”ป) | > Status of coverage: ๐ŸŸข - ok, ๐ŸŸก - slightly more than threshold, ๐Ÿ”ด - under the threshold