cheminfo / nmrium

React component to display and process nuclear magnetic resonance (NMR) spectra.
https://docs.nmrium.org
MIT License
55 stars 25 forks source link

Ranges / integrals, default behaviour and value #3056

Open jliermann opened 5 months ago

jliermann commented 5 months ago

The current behaviour of the range / integral tool with a sum value and relative integration is somewhat confusing to synthetic chemists. I suggest that the first integral placed should always have an absolute value of 1.

@evaziegler

lpatiny commented 5 months ago

First step would be to add the 'link' toggle from integrals and ranges saved in the workspace

image

Second step: if the link is unselected and we add a first integral or range it's value is set to '1'.

hamed-musallam commented 5 months ago

@lpatiny

Toggle the integrals and ranges are specific to each spectrum, which is why they are included in the view object rather than in the workspace. The workspace is intended for general settings.

lpatiny commented 5 months ago

Thanks Hamed. I think this can be changed without any migration script. Those settings can be in the workspace and not related to a spectrum. They can be specific for a nucleus (1H, 13C, 19F) and saved in the workspace.

hamed-musallam commented 5 months ago

Sorry, that was a mistake on my part. These options belong to the ranges and integrals settings:

{
  options: { isSumConstant: boolean },
  values: []
}
hamed-musallam commented 5 months ago

@lpatiny we rely on this option to adjust the relative value. If we move this option to the workspace, we still need to keep it in the data because the ranges and integrals reducer actions check this option whenever we modify ranges or integrals. Otherwise, we would need to pass this option in all actions related to ranges and integrals