nmrium icon indicating copy to clipboard operation
nmrium copied to clipboard

feat: generate and display stocsy

Open hamed-musallam opened this issue 1 year ago • 3 comments

hamed-musallam avatar May 21 '24 13:05 hamed-musallam

Deploying nmrium with  Cloudflare Pages  Cloudflare Pages

Latest commit: aad389f
Status: ✅  Deploy successful!
Preview URL: https://dc949a81.nmrium.pages.dev
Branch Preview URL: https://display-boxplot-stocsy.nmrium.pages.dev

View logs

cf build error is:

15:18:52.548 | x Build failed in 6.21s
-- | --
15:18:52.550 | error during build:
15:18:52.550 | RollupError: Could not resolve "../../context/ExportPrepareContext" from "src/component/1d/matrix/Stocsy.tsx"
15:18:52.550 | file: /opt/buildhome/repo/src/component/1d/matrix/Stocsy.tsx
15:18:52.550 | at getRollupError (file:///opt/buildhome/repo/node_modules/rollup/dist/es/shared/parseAst.js:376:41)
15:18:52.551 | at error (file:///opt/buildhome/repo/node_modules/rollup/dist/es/shared/parseAst.js:372:42)
15:18:52.551 | at ModuleLoader.handleInvalidResolvedId (file:///opt/buildhome/repo/node_modules/rollup/dist/es/shared/node-entry.js:18891:24)
15:18:52.551 | at file:///opt/buildhome/repo/node_modules/rollup/dist/es/shared/node-entry.js:18851:26
15:18:52.629 | Failed: Error while executing user command. Exited with error code: 1

targos avatar May 21 '24 13:05 targos

  1. Please use SVG and allow vertical scale. We will improve with grouped path by color very soon like Norman did in the visualizer and JsGraph
  2. For now please use the first row as Y axis and paint the color with the returned value from stocsy
  3. deal with the index on which the user clicked

lpatiny avatar May 22 '24 05:05 lpatiny

If I only display the STOCSY

image

And I just moved the scroll wheel (without ALT), nothing happened (as expected), but nevertheless, the STOCSY was redrawn.

image

lpatiny avatar May 24 '24 15:05 lpatiny

@hamed-musallam For the boxPlot and the calculation of the 3 paths please use xyReduce. Becuase we have only color it can be used in this case.

lpatiny avatar May 24 '24 16:05 lpatiny

It seems that currently the SVG is painted outside the visible div as well. This can be observed when you donwload the SVG and open it in inkscape

image

And this could explain it is also relatively slow when zoomed in.

lpatiny avatar May 24 '24 16:05 lpatiny

Still small improvements that could be done:

  1. Hiding spectra yield to an error in the console

2024-05-25 10 08 39

  1. Confusion with 'Apply processing' and 'Update processing'

The first time we open Matrix generation the button should be labeled 'Apply processing' and after we could have 2 buttons:

  • Update processing: if any of the parameters change and there is a reason to update the processing
  • Remove processing: this will remove the filter 'Signal processing' from all the spectra. This button should be active if there is at least one spectrum with 'Signal processing'
  1. Show stocsy / boxplot

The 2 toggle button should only be available if the matrix has been generated and therefore that 'Apply processing' was clicked. We should not have a matrix before the 'Apply processing' because if we superiimpose spectra from different origins we will be in trouble.

So those button should rely on the presence of the matrix.

  1. Vertical scroll generates a lot of internal work by react (I guess)

Not sure how this can be improved but vertical scroll wheel even if there is no redraw takes around 100mS

2024-05-25 10 20 22

  1. Issues when selecting exclusion zones and vertical scaling

Once we have selected the select zone option there is no way to vertical scale the STOCSY anymore

2024-05-25 10 46 53

  1. Save / reload spectra

When we save a STOCSY with all the spectra hidden we can not reload it

XTC 1.nmrium.zip

lpatiny avatar May 25 '24 08:05 lpatiny

  1. Hiding spectra yield to an error in the console

The warning you see is from Blueprint.js, indicating that a tooltip is active but its content is either empty, null, or undefined.

I will implement a temporary fix for this issue in NMRium. However, the underlying problem should be addressed in the react-science button component by checking the tooltip content and disabling it if it is empty.

i created a PR in react-science the https://github.com/zakodium-oss/react-science/pull/730

hamed-musallam avatar May 27 '24 07:05 hamed-musallam