nmrium icon indicating copy to clipboard operation
nmrium copied to clipboard

change the contour plot behavior

Open jobo322 opened this issue 1 year ago • 1 comments

  • do not calculate noise every time the wheel is actioned.
  • do not include the max value of the data in the contour plot, it will contain a slice of the spectrum.
  • new contour levels by default are [0 - 100], the 0 level is the noise level.
  • new option numberOfZoomLevels is the number of steps, the levels will be sampled in an exponential scale (1.25**zoom) where zoom is an integer value between [0-`numberOfZoomLevels].

jobo322 avatar May 17 '24 09:05 jobo322

Deploying nmrium with  Cloudflare Pages  Cloudflare Pages

Latest commit: b5963a6
Status: ✅  Deploy successful!
Preview URL: https://dcf332b6.nmrium.pages.dev
Branch Preview URL: https://1337-contour-plot-does-not-a.nmrium.pages.dev

View logs

@hamed-musallam Could you change the behaviour so that when we move the sliders the spectrum is updated on the fly (and not on mouse release like currently) ?

A small debounce will certainly be required.

2024-06-15 12 56 27

lpatiny avatar Jun 15 '24 10:06 lpatiny

Do we want these new very large files in the repo?

targos avatar Jun 15 '24 11:06 targos

Do we want these new very large files in the repo?

@jobo322 Please use 512 x 512, no need to have 1024 on 1024 I think. Also don't do it 'pretty'. Simply JSON.stringify without the '2'

The files should then be around 1.3 Mb. Just by removing the \n + spaces I went from 22Mb to 5.5 Mb.

Michael and me are also wondering if we can directly load a NMRium file. Because in this case we would also have the zip compression.

lpatiny avatar Jun 15 '24 17:06 lpatiny

Functionality looks ok to me but for the manual change of slider that should update the contour plot after debouncing (before release of the cursor). @hamed-musallam Could you check this ?

lpatiny avatar Jun 17 '24 16:06 lpatiny

What is left is to refactor the spectrum object and move the contours Options object to view which can be done in another PR


{
contourOptions:{
          positive: {
            contourLevels: [15, 100],
            numberOfLayers: 10,
            numberOfZoomLevels: 10,
          },
          negative: {
            contourLevels: [15, 100],
            numberOfLayers: 10,
            numberOfZoomLevels: 10,
          }
}

hamed-musallam avatar Jun 24 '24 18:06 hamed-musallam

The functionalities looks better but the test are not passing. Please have a look why.

@hamed-musallam Please review the code as well.

it is fixed

hamed-musallam avatar Jun 24 '24 18:06 hamed-musallam

Can be merged after addressing my comments.

targos avatar Jun 25 '24 06:06 targos

Can we merge this PR, or are there still comments?

hamed-musallam avatar Jun 28 '24 08:06 hamed-musallam