simularium / simularium-viewer

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

Binding simulation #355

Closed meganrm closed 7 months ago

meganrm commented 8 months ago

Problem

I built a prototype for the education module. First here, and then in a new repo. In order to install the viewer and make use of the front end simulation interface, I had to make a number of changes.

Issues

  1. the other repo isn't using babel
  2. If you remount the viewer component, it parents a second canvas (only known because of React.StrictMode)
  3. A number of types/interfaces were needed by the installing app but weren't exposed
  4. The other app couldn't resolve the urls for the web workers

Solution

  1. moved some runtime babel deps from dev deps into regular
  2. Added check to see of the canvas had already been added to the parent div
  3. Exported interfaces
  4. added { type: "module" } for the URL declarations

Type of change

Please delete options that are not relevant.

Steps to Verify:

Since these changes are largely to enable installation by another app, to truly test it you need to also download the other repo and install this branch as the viewer. Short of that, everything else in the test bed app should behave normally.

github-actions[bot] commented 8 months ago

jest coverage report ๐Ÿงช

Total coverage

Status Category Percentage Covered / Total
๐Ÿ”ด Statements 40.74% 2017/4950
๐Ÿ”ด Branches 44.03% 831/1887
๐Ÿ”ด Functions 37.2% 413/1110
๐Ÿ”ด Lines 40.97% 1931/4713

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 | 75.65% (-2.33% ๐Ÿ”ป) | 69.09% | 45.23% (-4.77% ๐Ÿ”ป) | 75.92% (-2.51% ๐Ÿ”ป) | | ๐Ÿ”ด | index.ts | 7.79% | 7.5% | 5.83% | 7.76% | | ๐ŸŸก | src/simularium | 62.28% | 60.31% | 50% | 63.25% | | ๐Ÿ”ด | src/visGeometry | 21.94% | 23.11% | 28.03% | 21.82% | > Status of coverage: ๐ŸŸข - ok, ๐ŸŸก - slightly more than threshold, ๐Ÿ”ด - under the threshold
interim17 commented 7 months ago

LGTM, ran the binding sim in the test bed and it looked good, installed and ran binding-sim-edu fine after fussing with bunx and link a bit