nmrium 0.55.0 → 0.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/lib/component/1d/Chart1D.js +3 -1
  2. package/lib/component/1d/ExclusionZoneAnnotation.d.ts +0 -1
  3. package/lib/component/1d/Viewer1D.js +36 -11
  4. package/lib/component/1d/database/DatabaseSpectrum.js +14 -19
  5. package/lib/component/1d/jCouplingGraph/JGraphContext.d.ts +0 -1
  6. package/lib/component/1d/matrix/Boxplot.d.ts +6 -0
  7. package/lib/component/1d/matrix/Boxplot.js +97 -0
  8. package/lib/component/1d/matrix/Stocsy.d.ts +5 -0
  9. package/lib/component/1d/matrix/Stocsy.js +101 -0
  10. package/lib/component/1d/matrix/useMatrix.d.ts +29 -0
  11. package/lib/component/1d/matrix/useMatrix.js +93 -0
  12. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts +0 -1
  13. package/lib/component/1d/peaks/PeakEditionManager.js +16 -10
  14. package/lib/component/1d/utilities/getDecimalsCount.js +1 -1
  15. package/lib/component/1d/utilities/intersectionResolver.js +1 -1
  16. package/lib/component/1d/utilities/scale.d.ts +2 -1
  17. package/lib/component/1d/utilities/scale.js +6 -1
  18. package/lib/component/1d-2d/FieldEdition.d.ts +3 -1
  19. package/lib/component/1d-2d/FieldEdition.js +26 -10
  20. package/lib/component/2d/1d-tracer/Left1DChart.d.ts +0 -1
  21. package/lib/component/2d/1d-tracer/Top1DChart.d.ts +0 -1
  22. package/lib/component/2d/XAxis.d.ts +0 -1
  23. package/lib/component/2d/YAxis.d.ts +0 -1
  24. package/lib/component/2d/ft/Contours.js +7 -7
  25. package/lib/component/assignment/AssignmentsContext.d.ts +0 -1
  26. package/lib/component/context/ChartContext.d.ts +0 -1
  27. package/lib/component/context/DispatchContext.d.ts +0 -1
  28. package/lib/component/context/GlobalContext.d.ts +0 -1
  29. package/lib/component/context/KeyModifierContext.js +1 -1
  30. package/lib/component/context/LoaderContext.d.ts +0 -1
  31. package/lib/component/context/PreferencesContext.d.ts +0 -1
  32. package/lib/component/context/PrepareExportContext.d.ts +21 -0
  33. package/lib/component/context/PrepareExportContext.js +124 -0
  34. package/lib/component/context/ScaleContext.d.ts +0 -1
  35. package/lib/component/elements/ActionButtons.d.ts +1 -0
  36. package/lib/component/elements/ActionButtons.js +4 -4
  37. package/lib/component/elements/ColorInput.d.ts +0 -1
  38. package/lib/component/elements/ColorPickerDropdownController.d.ts +2 -0
  39. package/lib/component/elements/ColorPickerDropdownController.js +8 -0
  40. package/lib/component/elements/ColumnWrapper.d.ts +0 -1
  41. package/lib/component/elements/ContextMenu.d.ts +0 -1
  42. package/lib/component/elements/Input.d.ts +1 -0
  43. package/lib/component/elements/Input.js +2 -1
  44. package/lib/component/elements/Input2.d.ts +13 -0
  45. package/lib/component/elements/Input2.js +118 -0
  46. package/lib/component/elements/Input2Controller.d.ts +12 -0
  47. package/lib/component/elements/Input2Controller.js +22 -0
  48. package/lib/component/elements/MoleculeSelection.js +1 -1
  49. package/lib/component/elements/NumberInput.js +1 -1
  50. package/lib/component/elements/NumberInput2.d.ts +12 -0
  51. package/lib/component/elements/NumberInput2.js +65 -0
  52. package/lib/component/elements/NumberInput2Controller.d.ts +8 -0
  53. package/lib/component/elements/NumberInput2Controller.js +15 -0
  54. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +3 -3
  55. package/lib/component/elements/ReactTable/Style.d.ts +3 -1
  56. package/lib/component/elements/ReactTable/Style.js +11 -1
  57. package/lib/component/elements/ReactTable/utility/ReactTableContext.d.ts +0 -1
  58. package/lib/component/elements/Select2.d.ts +26 -0
  59. package/lib/component/elements/Select2.js +25 -0
  60. package/lib/component/elements/Select2Controller.d.ts +7 -0
  61. package/lib/component/elements/Select2Controller.js +12 -0
  62. package/lib/component/elements/draggable/useDraggable.d.ts +0 -1
  63. package/lib/component/elements/dropDownButton/DropDownButton.d.ts +2 -4
  64. package/lib/component/elements/dropDownButton/DropDownButton.js +11 -37
  65. package/lib/component/elements/dropDownButton/DropDownList.js +3 -32
  66. package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
  67. package/lib/component/elements/formik/FormikColumnFormatField.d.ts +0 -1
  68. package/lib/component/elements/formik/FormikInput.d.ts +0 -1
  69. package/lib/component/elements/formik/FormikInput2.d.ts +11 -0
  70. package/lib/component/elements/formik/FormikInput2.js +26 -0
  71. package/lib/component/elements/formik/FormikOnChange.d.ts +0 -1
  72. package/lib/component/elements/popup/Modal/Context.d.ts +0 -1
  73. package/lib/component/elements/popup/Modal/ModalContent.d.ts +0 -1
  74. package/lib/component/elements/resizer/SVGResizer.d.ts +0 -1
  75. package/lib/component/elements/useFormValidateField.d.ts +1 -0
  76. package/lib/component/elements/useFormValidateField.js +9 -0
  77. package/lib/component/header/ApodizationOptionsPanel.js +26 -11
  78. package/lib/component/header/AutoPeakPickingOptionPanel.d.ts +1 -4
  79. package/lib/component/header/AutoPeakPickingOptionPanel.js +16 -16
  80. package/lib/component/header/BaseLineCorrectionPanel.js +49 -27
  81. package/lib/component/header/Header.js +1 -1
  82. package/lib/component/header/PhaseCorrectionPanel.js +12 -24
  83. package/lib/component/header/RangesPickingOptionPanel.js +12 -12
  84. package/lib/component/header/ZeroFillingOptionsPanel.js +18 -7
  85. package/lib/component/header/Zones2DOptionPanel.js +19 -18
  86. package/lib/component/hooks/useExport.d.ts +1 -1
  87. package/lib/component/hooks/useExport.js +4 -4
  88. package/lib/component/hooks/usePanelPreferences.d.ts +2 -3
  89. package/lib/component/hooks/usePanelPreferences.js +3 -1
  90. package/lib/component/hooks/useToggleSpectraVisibility.d.ts +10 -0
  91. package/lib/component/hooks/useToggleSpectraVisibility.js +41 -0
  92. package/lib/component/hooks/useWorkspaceAction.d.ts +1 -1
  93. package/lib/component/modal/editRange/forms/components/SignalTab.d.ts +0 -1
  94. package/lib/component/modal/editRange/forms/components/SignalsContent.d.ts +0 -1
  95. package/lib/component/modal/setting/GeneralSettings.d.ts +5 -1
  96. package/lib/component/modal/setting/GeneralSettings.js +107 -111
  97. package/lib/component/modal/setting/WorkspaceItem.js +4 -9
  98. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
  99. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +95 -59
  100. package/lib/component/modal/setting/settings-tabs/DisplayTabContent.js +33 -25
  101. package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +15 -4
  102. package/lib/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +56 -39
  103. package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +36 -36
  104. package/lib/component/modal/setting/settings-tabs/NucleiTabContent.js +44 -36
  105. package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.js +16 -11
  106. package/lib/component/modal/setting/settings-tabs/SpectraColorsTabContent.js +47 -40
  107. package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +50 -40
  108. package/lib/component/modal/setting/settingsValidation.js +8 -34
  109. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +0 -1
  110. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +0 -1
  111. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.d.ts +0 -1
  112. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.d.ts +2 -2
  113. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +121 -36
  114. package/lib/component/panels/Panels.js +32 -9
  115. package/lib/component/panels/PeaksPanel/PeaksPreferences.d.ts +0 -1
  116. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +0 -1
  117. package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +0 -1
  118. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +0 -1
  119. package/lib/component/panels/SpectraPanel/SpectraPanelHeader.js +4 -27
  120. package/lib/component/panels/SpectraPanel/SpectraPreferences.d.ts +0 -1
  121. package/lib/component/panels/SpectraPanel/SpectraPreferences.js +32 -24
  122. package/lib/component/panels/SpectraPanel/SpectraTable.js +17 -2
  123. package/lib/component/panels/SpectraPanel/SpectrumListPanel.d.ts +0 -1
  124. package/lib/component/panels/SpectraPanel/base/ColorIndicator.d.ts +0 -1
  125. package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.d.ts +3 -3
  126. package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.js +25 -16
  127. package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DHistogram.d.ts +0 -1
  128. package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DSetting.js +15 -5
  129. package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DHistogram.d.ts +0 -1
  130. package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.js +44 -6
  131. package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.d.ts +0 -1
  132. package/lib/component/panels/SummaryPanel/Overview.d.ts +0 -1
  133. package/lib/component/panels/SummaryPanel/SummaryPanel.d.ts +0 -1
  134. package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +1 -1
  135. package/lib/component/panels/ZonesPanel/ZonesPreferences.d.ts +0 -1
  136. package/lib/component/panels/databasePanel/DatabasePanel.js +17 -3
  137. package/lib/component/panels/databasePanel/DatabasePreferences.d.ts +0 -1
  138. package/lib/component/panels/databasePanel/DatabaseTable.d.ts +11 -4
  139. package/lib/component/panels/databasePanel/DatabaseTable.js +22 -7
  140. package/lib/component/panels/informationPanel/InformationEditionModal.d.ts +6 -0
  141. package/lib/component/panels/informationPanel/InformationEditionModal.js +105 -0
  142. package/lib/component/panels/informationPanel/InformationPanel.d.ts +1 -0
  143. package/lib/component/panels/{InformationPanel.js → informationPanel/InformationPanel.js} +2 -2
  144. package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.d.ts +0 -1
  145. package/lib/component/panels/multipleAnalysisPanel/preferences/index.d.ts +0 -1
  146. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +0 -1
  147. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +1 -1
  148. package/lib/component/panels/predictionPanel/PredictionPreferences.d.ts +0 -1
  149. package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.d.ts +0 -1
  150. package/lib/component/reducer/Reducer.d.ts +7 -1
  151. package/lib/component/reducer/Reducer.js +2 -0
  152. package/lib/component/reducer/actions/DatabaseActions.js +22 -5
  153. package/lib/component/reducer/actions/DomainActions.d.ts +5 -2
  154. package/lib/component/reducer/actions/DomainActions.js +6 -4
  155. package/lib/component/reducer/actions/FiltersActions.js +2 -2
  156. package/lib/component/reducer/actions/LoadActions.js +5 -2
  157. package/lib/component/reducer/actions/SpectraActions.d.ts +9 -2
  158. package/lib/component/reducer/actions/SpectraActions.js +65 -23
  159. package/lib/component/reducer/actions/ToolsActions.js +3 -4
  160. package/lib/component/reducer/preferences/actions/matrixGeneration.d.ts +47 -2
  161. package/lib/component/reducer/preferences/actions/matrixGeneration.js +62 -25
  162. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +11 -8
  163. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +19 -1
  164. package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -26
  165. package/lib/component/reducer/preferences/preferencesReducer.js +7 -1
  166. package/lib/component/toolbar/ToolBar.js +6 -7
  167. package/lib/component/utility/PathBuilder.d.ts +1 -0
  168. package/lib/component/utility/PathBuilder.js +8 -1
  169. package/lib/component/utility/checkUniqueByKey.d.ts +2 -0
  170. package/lib/component/utility/checkUniqueByKey.js +40 -0
  171. package/lib/component/utility/colorToHexWithAlpha.d.ts +9 -0
  172. package/lib/component/utility/colorToHexWithAlpha.js +4 -0
  173. package/lib/component/workspaces/exercise.js +2 -0
  174. package/lib/component/workspaces/process1D.js +0 -1
  175. package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
  176. package/lib/data/PredictionManager.js +3 -5
  177. package/lib/data/data1d/Spectrum1D/ranges/createRange.d.ts +13 -13
  178. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +9 -9
  179. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +13 -13
  180. package/lib/data/data1d/Spectrum1D/ranges/resizeRange.d.ts +13 -13
  181. package/lib/data/data1d/database.d.ts +1 -0
  182. package/lib/data/data1d/database.js +4 -2
  183. package/lib/data/data2d/Spectrum2D/contours.d.ts +8 -22
  184. package/lib/data/data2d/Spectrum2D/contours.js +88 -67
  185. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +4 -2
  186. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +20 -20
  187. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +20 -20
  188. package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
  189. package/lib/data/initiateFilters.d.ts +1 -1
  190. package/lib/data/matrixGeneration.js +1 -2
  191. package/lib/data/types/common/DeepPartial.d.ts +3 -0
  192. package/lib/data/types/common/DeepPartial.js +1 -0
  193. package/lib/data/types/common/Keys.d.ts +3 -0
  194. package/lib/data/types/common/Keys.js +1 -0
  195. package/lib/data/utilities/generateNumbersPowerOfX.d.ts +2 -2
  196. package/lib/versionInfo.js +1 -1
  197. package/package.json +39 -38
  198. package/lib/component/elements/CustomToolTip.d.ts +0 -8
  199. package/lib/component/elements/CustomToolTip.js +0 -107
  200. package/lib/component/elements/formik/FormikSlider.d.ts +0 -6
  201. package/lib/component/elements/formik/FormikSlider.js +0 -15
  202. package/lib/component/panels/InformationPanel.d.ts +0 -1
@@ -0,0 +1,105 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
+ /** @jsxImportSource @emotion/react */
3
+ import { Classes, Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
4
+ import { css } from '@emotion/react';
5
+ import { Formik } from 'formik';
6
+ import { useCallback, useMemo, useRef } from 'react';
7
+ import { FaPlus, FaRegTrashAlt } from 'react-icons/fa';
8
+ import { Button } from 'react-science/ui';
9
+ import { array, object, string } from 'yup';
10
+ import { useDispatch } from '../../context/DispatchContext';
11
+ import ReactTable from '../../elements/ReactTable/ReactTable';
12
+ import { tableInputStyle } from '../../elements/ReactTable/Style';
13
+ import FormikInput from '../../elements/formik/FormikInput';
14
+ import useSpectrum from '../../hooks/useSpectrum';
15
+ import { checkUniqueByKey } from '../../utility/checkUniqueByKey';
16
+ import { tablePanelStyle } from '../extra/BasicPanelStyle';
17
+ const metaInfoValidationSchema = array()
18
+ .of(object().shape({
19
+ key: string().required().trim(),
20
+ value: string().required().trim(),
21
+ }))
22
+ .test('Unique', 'Key need te be unique', function check(metaInfo) {
23
+ // eslint-disable-next-line no-invalid-this
24
+ return checkUniqueByKey(metaInfo, 'key', this);
25
+ });
26
+ export function InformationEditionModal(props) {
27
+ const { isOpen, onCloseDialog } = props;
28
+ const spectrum = useSpectrum();
29
+ if (!isOpen || !spectrum)
30
+ return null;
31
+ const metaInfo = Object.keys(spectrum.customInfo).map((key) => ({
32
+ key,
33
+ value: spectrum.customInfo[key],
34
+ }));
35
+ return (_jsx(Dialog, { isOpen: true, title: "Edit spectrum meta information", onClose: onCloseDialog, style: { width: 700, height: 500 }, children: _jsx(InnerInformationPanel, { metaInfo: metaInfo, onCloseDialog: onCloseDialog }) }));
36
+ }
37
+ function InnerInformationPanel(props) {
38
+ const { metaInfo = [], onCloseDialog } = props;
39
+ const dispatch = useDispatch();
40
+ const formRef = useRef(null);
41
+ const addHandler = useCallback((data, index = 0) => {
42
+ const meta = { key: '', value: '' };
43
+ void formRef.current?.setValues([
44
+ ...data.slice(0, index),
45
+ meta,
46
+ ...data.slice(index),
47
+ ]);
48
+ }, []);
49
+ const deleteHandler = useCallback((data, index) => {
50
+ const meta = data.filter((_, columnIndex) => columnIndex !== index);
51
+ void formRef.current?.setValues(meta);
52
+ }, []);
53
+ function saveHandler(metaArray) {
54
+ const meta = {};
55
+ for (const { key, value } of metaArray) {
56
+ meta[key] = value;
57
+ }
58
+ dispatch({ type: 'UPDATE_SPECTRUM_META', payload: { meta } });
59
+ onCloseDialog();
60
+ }
61
+ const COLUMNS = useMemo(() => [
62
+ {
63
+ Header: '#',
64
+ style: { width: '25px', textAlign: 'center' },
65
+ accessor: (_, index) => index + 1,
66
+ },
67
+ {
68
+ Header: 'Key',
69
+ style: { padding: 0 },
70
+ Cell: ({ row }) => {
71
+ return (_jsx(FormikInput, { name: `${row.index}.key`, style: tableInputStyle }));
72
+ },
73
+ },
74
+ {
75
+ Header: 'Value',
76
+ style: { padding: 0 },
77
+ Cell: ({ row }) => {
78
+ return (_jsx(FormikInput, { name: `${row.index}.value`, style: tableInputStyle }));
79
+ },
80
+ },
81
+ {
82
+ Header: '',
83
+ style: { width: '60px' },
84
+ id: 'action-button',
85
+ Cell: ({ data, row }) => {
86
+ return (_jsxs("div", { style: { display: 'flex', justifyContent: 'space-evenly' }, children: [_jsx(Button, { small: true, outlined: true, intent: "success", tooltipProps: { content: '', disabled: true }, onClick: (e) => {
87
+ e.stopPropagation();
88
+ addHandler(data, row.index + 1);
89
+ }, children: _jsx(FaPlus, { className: Classes.ICON }) }), _jsx(Button, { small: true, outlined: true, intent: "danger", tooltipProps: { content: '', disabled: true }, onClick: (e) => {
90
+ e.stopPropagation();
91
+ deleteHandler(data, row.index);
92
+ }, children: _jsx(FaRegTrashAlt, { className: Classes.ICON }) })] }));
93
+ },
94
+ },
95
+ ], [addHandler, deleteHandler]);
96
+ return (_jsx(Formik, { innerRef: formRef, initialValues: metaInfo, validationSchema: metaInfoValidationSchema, onSubmit: saveHandler, children: ({ values, submitForm, isValid }) => (_jsxs(_Fragment, { children: [_jsx(DialogBody, { css: css `
97
+ background-color: white;
98
+ `, children: _jsxs("div", { css: tablePanelStyle, style: { height: 'calc(100% - 30px)' }, children: [_jsx("div", { style: { padding: '5px 0', display: 'flex' }, children: _jsx(Button, { intent: "success", small: true, outlined: true, onClick: () => addHandler(values), tooltipProps: { content: '', disabled: true }, children: "Add a new meta" }) }), _jsx(ReactTable, { data: values, columns: COLUMNS, emptyDataRowText: "No meta", style: {
99
+ 'thead tr th': { zIndex: 1 },
100
+ td: { padding: 0 },
101
+ }, rowStyle: {
102
+ hover: { backgroundColor: '#f7f7f7' },
103
+ active: { backgroundColor: '#f5f5f5' },
104
+ } })] }) }), _jsx(DialogFooter, { children: _jsx(Button, { intent: "success", onClick: submitForm, tooltipProps: { content: '', disabled: true }, disabled: !isValid, children: "Save meta" }) })] })) }));
105
+ }
@@ -0,0 +1 @@
1
+ export declare function InformationPanel(): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useMemo } from 'react';
3
3
  import { InfoPanel } from 'react-science/ui';
4
- import useSpectrum from '../hooks/useSpectrum';
4
+ import useSpectrum from '../../hooks/useSpectrum';
5
5
  const emptyData = { info: {}, meta: {} };
6
- export default function InformationPanel() {
6
+ export function InformationPanel() {
7
7
  const { info, meta, customInfo } = useSpectrum(emptyData);
8
8
  const data = useMemo(() => [
9
9
  { description: 'Custom information', data: customInfo || {} },
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface MultipleAnalysisCodeEditorProps {
3
2
  data: any;
4
3
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SpectraAnalysisData } from '../../../../data/data1d/multipleSpectraAnalysis';
3
2
  interface MultipleSpectraAnalysisPreferencesProps {
4
3
  data: SpectraAnalysisData;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { FormikConfig } from 'formik';
3
2
  import { PredictionOptions } from '../../../data/PredictionManager';
4
3
  interface PredictionOptionsPanelProps extends Pick<FormikConfig<any>, 'onSubmit'> {
@@ -13,7 +13,7 @@ import FormikInput from '../../elements/formik/FormikInput';
13
13
  import FormikSelect from '../../elements/formik/FormikSelect';
14
14
  const NUMBER_OF_POINTS_1D = generateNumbersPowerOfX(12, 19);
15
15
  const NUMBER_OF_POINTS_2D = generateNumbersPowerOfX(10, 10, {
16
- format: (value) => value,
16
+ format: String,
17
17
  });
18
18
  const predictionFormValidation = Yup.object().shape({
19
19
  name: Yup.string().label('Name'),
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const _default: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<unknown>>;
3
2
  export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SpectrumSimulationOptions } from '../../../data/data1d/spectrumSimulation';
3
2
  export interface SpectrumSimulationPreferencesRefProps {
4
3
  saveSetting: () => void;
@@ -39,7 +39,13 @@ export interface TwoDimensionPhaseCorrection {
39
39
  activeTraceDirection: TraceDirection;
40
40
  addTracesToBothDirections: boolean;
41
41
  }
42
- export declare const getDefaultTwoDimensionsPhaseCorrectionTraceOptions: () => TwoDimensionPhaseCorrection['traces'];
42
+ export interface MatrixGenerationOptions {
43
+ showBoxPlot: boolean;
44
+ showStocsy: boolean;
45
+ scaleRatio: number;
46
+ chemicalShift: number | null;
47
+ }
48
+ export declare const getDefaultTwoDimensionsPhaseCorrectionTraceOptions: () => TwoDimensionPhaseCorrection["traces"];
43
49
  export declare function getDefaultViewState(): ViewState;
44
50
  export declare const getInitialState: () => State;
45
51
  export declare const initialState: State;
@@ -276,6 +276,8 @@ function innerSpectrumReducer(draft, action) {
276
276
  return SpectraActions.handleOrderSpectra(draft, action);
277
277
  case 'SIMULATE_SPECTRUM':
278
278
  return SpectraActions.handleSimulateSpectrum(draft, action);
279
+ case 'UPDATE_SPECTRUM_META':
280
+ return SpectraActions.handleUpdateSpectrumMeta(draft, action);
279
281
  case 'SET_SELECTED_TOOL':
280
282
  return ToolsActions.setSelectedTool(draft, action);
281
283
  case 'RESET_SELECTED_TOOL':
@@ -1,6 +1,7 @@
1
1
  import { get1DColor, mapRanges } from '../../../data/data1d/Spectrum1D';
2
2
  import { generateSpectrumFromRanges, } from '../../../data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges';
3
3
  import { setZoom } from '../helper/Zoom1DManager';
4
+ import zoomHistoryManager from '../helper/ZoomHistoryManager';
4
5
  import { setDomain } from './DomainActions';
5
6
  function handleResurrectSpectrumFromJcamp(draft, action) {
6
7
  const { ranges } = action.payload;
@@ -17,16 +18,32 @@ function handleResurrectSpectrumFromJcamp(draft, action) {
17
18
  },
18
19
  };
19
20
  draft.data.push(spectrum);
20
- setDomain(draft);
21
+ setDomain(draft, { isYDomainShared: false });
22
+ //rescale the vertical zoom
21
23
  setZoom(draft, { scale: 0.8, spectrumID: spectrum.id });
24
+ //keep the last horizontal zoom
25
+ const zoomHistory = zoomHistoryManager(draft.zoom.history, draft.view.spectra.activeTab);
26
+ const zoomValue = zoomHistory.getLast();
27
+ if (zoomValue) {
28
+ draft.xDomain = zoomValue.xDomain;
29
+ draft.yDomain = zoomValue.yDomain;
30
+ }
22
31
  }
23
32
  function handleResurrectSpectrumFromRanges(draft, action) {
24
33
  const { ranges, info } = action.payload;
25
34
  const datum = generateSpectrumFromRanges(ranges, info, draft.usedColors);
26
- if (datum) {
27
- draft.data.push(datum);
28
- setDomain(draft, { isYDomainShared: false });
29
- setZoom(draft, { scale: 0.8, spectrumID: datum.id });
35
+ if (!datum)
36
+ return;
37
+ draft.data.push(datum);
38
+ setDomain(draft, { isYDomainShared: false });
39
+ //rescale the vertical zoom
40
+ setZoom(draft, { scale: 0.8, spectrumID: datum.id });
41
+ //keep the last horizontal zoom
42
+ const zoomHistory = zoomHistoryManager(draft.zoom.history, draft.view.spectra.activeTab);
43
+ const zoomValue = zoomHistory.getLast();
44
+ if (zoomValue) {
45
+ draft.xDomain = zoomValue.xDomain;
46
+ draft.yDomain = zoomValue.yDomain;
30
47
  }
31
48
  }
32
49
  function handleToggleSimilarityTree(draft) {
@@ -16,13 +16,16 @@ type MoveXAxisAction = ActionType<'MOVE', {
16
16
  shiftY: number;
17
17
  }>;
18
18
  export type DomainActions = SetXDomainAction | SetYDomainAction | SetAxisDomainAction | MoveXAxisAction;
19
- declare function getDomain(draft: Draft<State>): {
19
+ interface GetDomainOptions {
20
+ domainSpectraScope?: 'visible' | 'all';
21
+ }
22
+ declare function getDomain(draft: Draft<State>, options?: GetDomainOptions): {
20
23
  xDomain: [number, number] | never[] | [undefined, undefined];
21
24
  yDomain: [number, number] | never[] | [undefined, undefined];
22
25
  yDomains: Record<string, number[]>;
23
26
  xDomains: Record<string, number[]>;
24
27
  };
25
- export interface SetDomainOptions {
28
+ export interface SetDomainOptions extends GetDomainOptions {
26
29
  updateYDomain?: boolean;
27
30
  isYDomainShared?: boolean;
28
31
  updateXDomain?: boolean;
@@ -22,7 +22,8 @@ function getActiveData(draft) {
22
22
  }
23
23
  return data;
24
24
  }
25
- function getDomain(draft) {
25
+ function getDomain(draft, options = {}) {
26
+ const { domainSpectraScope = 'visible' } = options;
26
27
  let xArray = [];
27
28
  let yArray = [];
28
29
  const yDomains = {};
@@ -36,7 +37,8 @@ function getDomain(draft) {
36
37
  const domain = [data.x[0], data.x.at(-1)];
37
38
  yDomains[id] = _extent;
38
39
  xDomains[id] = domain;
39
- if (display.isVisible) {
40
+ if (domainSpectraScope === 'all' ||
41
+ (domainSpectraScope === 'visible' && display.isVisible)) {
40
42
  xArray = xArray.concat(domain);
41
43
  yArray = yArray.concat(_extent);
42
44
  }
@@ -120,11 +122,11 @@ function get2DDomain(state) {
120
122
  };
121
123
  }
122
124
  function setDomain(draft, options) {
123
- const { updateYDomain = true, isYDomainShared = true, updateXDomain = true, } = options || {};
125
+ const { updateYDomain = true, isYDomainShared = true, updateXDomain = true, domainSpectraScope, } = options || {};
124
126
  let domain;
125
127
  if (draft.view.spectra.activeTab) {
126
128
  if (draft.displayerMode === '1D') {
127
- domain = getDomain(draft);
129
+ domain = getDomain(draft, { domainSpectraScope });
128
130
  }
129
131
  else {
130
132
  domain = get2DDomain(draft);
@@ -761,7 +761,7 @@ function handleDeleteSpectraFilter(draft, action) {
761
761
  }
762
762
  }
763
763
  resetSelectedTool(draft);
764
- setDomain(draft);
764
+ setDomain(draft, { domainSpectraScope: 'all' });
765
765
  setMode(draft);
766
766
  }
767
767
  }
@@ -791,7 +791,7 @@ function handleSignalProcessingFilter(draft, action) {
791
791
  ], { forceReapply: true });
792
792
  }
793
793
  const { updateXDomain, updateYDomain } = signalProcessing.DOMAIN_UPDATE_RULES;
794
- setDomain(draft, { updateXDomain, updateYDomain });
794
+ setDomain(draft, { updateXDomain, updateYDomain, domainSpectraScope: 'all' });
795
795
  }
796
796
  //action
797
797
  function handleAddExclusionZone(draft, action) {
@@ -116,7 +116,10 @@ function initData(draft, action, options = {}) {
116
116
  const state = getInitialState();
117
117
  return produce(state, (initialDraft) => {
118
118
  setData(initialDraft, action.payload);
119
- setActiveTab(initialDraft, { tab: viewState?.spectra?.activeTab || '' });
119
+ setActiveTab(initialDraft, {
120
+ tab: viewState?.spectra?.activeTab || '',
121
+ domainOptions: { domainSpectraScope: 'all' },
122
+ });
120
123
  initialDraft.width = draft.width;
121
124
  initialDraft.height = draft.height;
122
125
  setPreferences(initialDraft, viewState);
@@ -152,7 +155,7 @@ function handleLoadDropFiles(draft, action) {
152
155
  }
153
156
  else {
154
157
  setData(draft, payload);
155
- setActiveTab(draft);
158
+ setActiveTab(draft, { domainOptions: { domainSpectraScope: 'all' } });
156
159
  changeSpectrumVerticalAlignment(draft, { verticalAlign: 'auto-check' });
157
160
  // set source undefined when dragging and dropping a spectra file to prevent export spectra with the data source.
158
161
  if (resetSourceObject && spectra?.length > 0) {
@@ -5,6 +5,7 @@ import { SpectrumSimulationOptions } from '../../../data/data1d/spectrumSimulati
5
5
  import { Nuclei, Nucleus } from '../../../data/types/common/Nucleus';
6
6
  import { State } from '../Reducer';
7
7
  import { ActionType } from '../types/ActionType';
8
+ import { SetDomainOptions } from './DomainActions';
8
9
  type ChangeSpectrumVisibilityByIdAction = ActionType<'CHANGE_SPECTRUM_VISIBILITY', {
9
10
  id: string;
10
11
  key: 'isVisible' | 'isPositiveVisible' | 'isNegativeVisible';
@@ -12,6 +13,7 @@ type ChangeSpectrumVisibilityByIdAction = ActionType<'CHANGE_SPECTRUM_VISIBILITY
12
13
  type ChangeSpectraVisibilityByNucleusAction = ActionType<'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS', {
13
14
  nucleus: Nucleus;
14
15
  flag: boolean;
16
+ mode?: 'selected' | 'all';
15
17
  }>;
16
18
  type ChangeActiveSpectrumAction = ActionType<'CHANGE_ACTIVE_SPECTRUM', {
17
19
  modifier?: 'shift[false]_ctrl[true]' | 'shift[true]_ctrl[false]' | 'shift[true]_ctrl[true]' | (string & {});
@@ -23,6 +25,7 @@ type ChangeSpectrumSettingAction = ActionType<'CHANGE_SPECTRUM_SETTING', {
23
25
  }>;
24
26
  type DeleteSpectraAction = ActionType<'DELETE_SPECTRA', {
25
27
  id?: string;
28
+ domainOptions?: SetDomainOptions;
26
29
  }>;
27
30
  type AddMissingProjectionAction = ActionType<'ADD_MISSING_PROJECTION', {
28
31
  nucleus: Nuclei[];
@@ -56,7 +59,10 @@ type SimulateSpectrumAction = ActionType<'SIMULATE_SPECTRUM', {
56
59
  keepSpectrum?: boolean;
57
60
  spinSystem: string;
58
61
  } & SpectrumSimulationOptions>;
59
- export type SpectrumActions = ActionType<'TOGGLE_SPECTRA_LEGEND'> | ChangeSpectrumVisibilityByIdAction | ChangeSpectraVisibilityByNucleusAction | ChangeActiveSpectrumAction | ChangeSpectrumSettingAction | DeleteSpectraAction | AddMissingProjectionAction | AlignSpectraAction | GenerateSpectrumFromPublicationStringAction | ImportSpectraMetaInfoAction | ReColorSpectraBasedOnDistinctValueAction | OrderSpectraAction | SimulateSpectrumAction;
62
+ type UpdateSpectrumMetaAction = ActionType<'UPDATE_SPECTRUM_META', {
63
+ meta: Record<string, string>;
64
+ }>;
65
+ export type SpectrumActions = ActionType<'TOGGLE_SPECTRA_LEGEND'> | ChangeSpectrumVisibilityByIdAction | ChangeSpectraVisibilityByNucleusAction | ChangeActiveSpectrumAction | ChangeSpectrumSettingAction | DeleteSpectraAction | AddMissingProjectionAction | AlignSpectraAction | GenerateSpectrumFromPublicationStringAction | ImportSpectraMetaInfoAction | ReColorSpectraBasedOnDistinctValueAction | OrderSpectraAction | SimulateSpectrumAction | UpdateSpectrumMetaAction;
60
66
  declare function setSpectraMetaInfo(draft: Draft<State>, spectraMetaInfo: Record<string, Record<string, any>>): void;
61
67
  declare function handleChangeSpectrumVisibilityById(draft: Draft<State>, action: ChangeSpectrumVisibilityByIdAction): void;
62
68
  declare function handleChangeSpectraVisibilityByNucleus(draft: Draft<State>, action: ChangeSpectraVisibilityByNucleusAction): void;
@@ -71,4 +77,5 @@ declare function handleToggleSpectraLegend(draft: Draft<State>): void;
71
77
  declare function handleRecolorSpectraBasedOnDistinctValue(draft: Draft<State>, action: ReColorSpectraBasedOnDistinctValueAction): void;
72
78
  declare function handleOrderSpectra(draft: Draft<State>, action: OrderSpectraAction): void;
73
79
  declare function handleSimulateSpectrum(draft: Draft<State>, simulateSpectrumOptions: SimulateSpectrumAction): void;
74
- export { handleChangeSpectrumVisibilityById, handleChangeSpectraVisibilityByNucleus, handleChangeActiveSpectrum, handleChangeSpectrumSetting, handleDeleteSpectra, handleAddMissingProjectionHandler, handleAlignSpectraHandler, handleGenerateSpectrumFromPublicationStringHandler, handleImportSpectraMetaInfo, handleToggleSpectraLegend, handleRecolorSpectraBasedOnDistinctValue, handleOrderSpectra, handleSimulateSpectrum, setSpectraMetaInfo, };
80
+ declare function handleUpdateSpectrumMeta(draft: Draft<State>, action: UpdateSpectrumMetaAction): null | undefined;
81
+ export { handleChangeSpectrumVisibilityById, handleChangeSpectraVisibilityByNucleus, handleChangeActiveSpectrum, handleChangeSpectrumSetting, handleDeleteSpectra, handleAddMissingProjectionHandler, handleAlignSpectraHandler, handleGenerateSpectrumFromPublicationStringHandler, handleImportSpectraMetaInfo, handleToggleSpectraLegend, handleRecolorSpectraBasedOnDistinctValue, handleOrderSpectra, handleSimulateSpectrum, setSpectraMetaInfo, handleUpdateSpectrumMeta, };
@@ -7,6 +7,7 @@ import { getReferenceShift, isSpectrum1D, get1DColor, initiateDatum1D, generateS
7
7
  import { simulateSpectrum, } from '../../../data/data1d/spectrumSimulation';
8
8
  import { getMissingProjection, isSpectrum2D, get2DColor, } from '../../../data/data2d/Spectrum2D';
9
9
  import { contoursManager } from '../../../data/data2d/Spectrum2D/contours';
10
+ import { adjustAlpha, generateColor, } from '../../../data/utilities/generateColor';
10
11
  import groupByInfoKey from '../../utility/GroupByInfoKey';
11
12
  import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
12
13
  import { setZoom } from '../helper/Zoom1DManager';
@@ -93,10 +94,15 @@ function handleChangeSpectrumVisibilityById(draft, action) {
93
94
  }
94
95
  //action
95
96
  function handleChangeSpectraVisibilityByNucleus(draft, action) {
96
- const { nucleus, flag } = action.payload;
97
+ const { nucleus, flag, mode = 'all' } = action.payload;
97
98
  const activeSpectra = getActiveSpectraAsObject(draft);
98
99
  for (const datum of getSpectraByNucleus(nucleus, draft.data)) {
99
- if (activeSpectra && datum.id in activeSpectra) {
100
+ if (mode === 'selected') {
101
+ if (activeSpectra && datum.id in activeSpectra) {
102
+ setVisible(datum, flag);
103
+ }
104
+ }
105
+ else {
100
106
  setVisible(datum, flag);
101
107
  }
102
108
  }
@@ -227,16 +233,15 @@ function handleChangeSpectrumSetting(draft, action) {
227
233
  const spectrum = draft.data[index];
228
234
  spectrum.display = display;
229
235
  if (isSpectrum2D(spectrum)) {
230
- const contoursLevels = draft.view.zoom.levels;
231
- const { checkLevel } = contoursManager(spectrum.id, contoursLevels, spectrum.display.contourOptions);
232
- contoursLevels[spectrum.id] = checkLevel();
236
+ const { checkLevel } = contoursManager(spectrum);
237
+ checkLevel();
233
238
  }
234
239
  }
235
240
  }
236
241
  //action
237
242
  function handleDeleteSpectra(draft, action) {
238
243
  const state = original(draft);
239
- const { id: spectraId } = action?.payload || {};
244
+ const { id: spectraId, domainOptions } = action?.payload || {};
240
245
  if (spectraId) {
241
246
  const index = state.data.findIndex((d) => d.id === spectraId);
242
247
  draft.data.splice(index, 1);
@@ -256,6 +261,7 @@ function handleDeleteSpectra(draft, action) {
256
261
  setActiveTab(draft, {
257
262
  tab: draft.view.spectra.activeTab,
258
263
  refreshActiveTab: true,
264
+ domainOptions,
259
265
  });
260
266
  }
261
267
  //action
@@ -317,37 +323,66 @@ function handleImportSpectraMetaInfo(draft, action) {
317
323
  function handleToggleSpectraLegend(draft) {
318
324
  draft.view.spectra.showLegend = !draft.view.spectra.showLegend;
319
325
  }
326
+ function groupSpectraByClass(spectra, jpath) {
327
+ const spectraByClass = {};
328
+ for (const spectrum of spectra) {
329
+ const key = String(lodashGet(spectrum, jpath, ''))
330
+ .toLowerCase()
331
+ .trim()
332
+ .replace(/\r?\n|\r/, '');
333
+ if (spectraByClass[key]) {
334
+ spectraByClass[key].push(spectrum);
335
+ }
336
+ else {
337
+ spectraByClass[key] = [spectrum];
338
+ }
339
+ }
340
+ return spectraByClass;
341
+ }
320
342
  //action
321
343
  function handleRecolorSpectraBasedOnDistinctValue(draft, action) {
322
344
  const { data, view: { spectra: { activeTab }, }, } = draft;
323
345
  const { jpath = null, customColors } = action.payload;
324
- const spectra = getSpectraByNucleus(activeTab, data);
346
+ const spectraByNucleus = getSpectraByNucleus(activeTab, data);
325
347
  if (jpath) {
326
348
  //recolor spectra based on distinct value
327
- const spectraByClass = {};
328
- for (const spectrum of spectra) {
329
- const key = String(lodashGet(spectrum, jpath, ''))
330
- .toLowerCase()
331
- .trim()
332
- .replace(/\r?\n|\r/, '');
333
- if (spectraByClass[key]) {
334
- if (isSpectrum1D(spectrum)) {
335
- spectrum.display.color = spectraByClass[key].display.color;
336
- }
337
- else {
338
- spectrum.display.positiveColor = spectraByClass[key].display.positiveColor;
339
- spectrum.display.negativeColor = spectraByClass[key].display.negativeColor;
349
+ const spectraByClass = groupSpectraByClass(spectraByNucleus, jpath);
350
+ const usedColors = [];
351
+ for (const spectra of Object.values(spectraByClass)) {
352
+ let color;
353
+ if (isSpectrum1D(spectra[0])) {
354
+ color = spectra[0].display.color;
355
+ if (usedColors.includes(color)) {
356
+ color = generateColor({ usedColors });
340
357
  }
358
+ usedColors.push(color);
341
359
  }
342
360
  else {
343
- spectraByClass[key] = spectrum;
361
+ const { positiveColor: pColor, negativeColor: nColor } = spectra[0].display;
362
+ color = { positiveColor: pColor, negativeColor: nColor };
363
+ if (usedColors.includes(pColor)) {
364
+ const positiveColor = generateColor({
365
+ usedColors,
366
+ });
367
+ const negativeColor = adjustAlpha(positiveColor, 50);
368
+ color = { positiveColor, negativeColor };
369
+ }
370
+ usedColors.push(color.positiveColor);
371
+ }
372
+ for (const spectrum of spectra) {
373
+ if (typeof color === 'string') {
374
+ spectrum.display = { ...spectrum.display, color };
375
+ }
376
+ else {
377
+ spectrum.display = { ...spectrum.display, ...color };
378
+ }
344
379
  }
345
380
  }
346
381
  }
347
382
  else {
348
383
  //reset spectra colors
349
384
  const usedColors = { '1d': [], '2d': [] };
350
- for (const spectrum of spectra) {
385
+ for (const spectrum of spectraByNucleus) {
351
386
  if (isSpectrum1D(spectrum)) {
352
387
  spectrum.display.color = get1DColor(spectrum, {
353
388
  usedColors,
@@ -427,4 +462,11 @@ function handleSimulateSpectrum(draft, simulateSpectrumOptions) {
427
462
  setActiveTab(draft);
428
463
  }
429
464
  }
430
- export { handleChangeSpectrumVisibilityById, handleChangeSpectraVisibilityByNucleus, handleChangeActiveSpectrum, handleChangeSpectrumSetting, handleDeleteSpectra, handleAddMissingProjectionHandler, handleAlignSpectraHandler, handleGenerateSpectrumFromPublicationStringHandler, handleImportSpectraMetaInfo, handleToggleSpectraLegend, handleRecolorSpectraBasedOnDistinctValue, handleOrderSpectra, handleSimulateSpectrum, setSpectraMetaInfo, };
465
+ function handleUpdateSpectrumMeta(draft, action) {
466
+ const { payload: { meta }, } = action;
467
+ const activeSpectrum = getActiveSpectrum(draft);
468
+ if (!activeSpectrum)
469
+ return null;
470
+ draft.data[activeSpectrum.index].customInfo = meta;
471
+ }
472
+ export { handleChangeSpectrumVisibilityById, handleChangeSpectraVisibilityByNucleus, handleChangeActiveSpectrum, handleChangeSpectrumSetting, handleDeleteSpectra, handleAddMissingProjectionHandler, handleAlignSpectraHandler, handleGenerateSpectrumFromPublicationStringHandler, handleImportSpectraMetaInfo, handleToggleSpectraLegend, handleRecolorSpectraBasedOnDistinctValue, handleOrderSpectra, handleSimulateSpectrum, setSpectraMetaInfo, handleUpdateSpectrumMeta, };
@@ -466,7 +466,7 @@ function handelSetActiveTab(draft, action) {
466
466
  }
467
467
  function levelChangeHandler(draft, action) {
468
468
  const { deltaY, altKey } = action.payload.options;
469
- const { data, view: { spectra: { activeTab }, zoom: { levels }, }, } = draft;
469
+ const { data, view: { spectra: { activeTab }, }, } = draft;
470
470
  const activeSpectra = getActiveSpectra(draft) || [];
471
471
  const activeSpectraObj = {};
472
472
  for (const activeSpectrum of activeSpectra) {
@@ -476,9 +476,8 @@ function levelChangeHandler(draft, action) {
476
476
  (activeSpectraObj?.[spectrum.id] || activeSpectra.length === 0));
477
477
  try {
478
478
  for (const spectrum of spectra) {
479
- const contourOptions = spectrum.display.contourOptions;
480
- const zoom = contoursManager(spectrum.id, levels, contourOptions);
481
- levels[spectrum.id] = zoom.wheel(deltaY, altKey);
479
+ const zoom = contoursManager(spectrum);
480
+ zoom.wheel(deltaY, altKey);
482
481
  }
483
482
  }
484
483
  catch (error) {
@@ -1,6 +1,51 @@
1
1
  import { Draft } from 'immer';
2
- import { addMatrixGenerationExclusionZoneAction, PreferencesState } from '../preferencesReducer';
2
+ import { MatrixGenerationOptions } from 'nmr-load-save';
3
+ import { MatrixOptions } from '../../../../data/types/data1d/MatrixOptions';
4
+ import { ZoomOptions } from '../../../EventsTrackers/BrushTracker';
5
+ import { FilterType } from '../../../utility/filterType';
6
+ import { ActionType } from '../../types/ActionType';
7
+ import { PreferencesState } from '../preferencesReducer';
8
+ type setMatrixGenerationOptionsAction = ActionType<'SET_MATRIX_GENERATION_OPTIONS', {
9
+ nucleus: string;
10
+ options: MatrixOptions;
11
+ }>;
12
+ type addMatrixGenerationExclusionZoneAction = ActionType<'ADD_MATRIX_GENERATION_EXCLUSION_ZONE', {
13
+ zone: {
14
+ from: number;
15
+ to: number;
16
+ };
17
+ range: {
18
+ from: number;
19
+ to: number;
20
+ };
21
+ nucleus: string;
22
+ }>;
23
+ type deleteMatrixGenerationExclusionZoneAction = ActionType<'DELETE_MATRIX_GENERATION_EXCLUSION_ZONE', {
24
+ zone: {
25
+ id: string;
26
+ from: number;
27
+ to: number;
28
+ };
29
+ nucleus: string;
30
+ }>;
31
+ type ToggleMatrixGenerationViewAction = ActionType<'TOGGLE_MATRIX_GENERATION_VIEW_PROPERTY', {
32
+ key: keyof FilterType<MatrixGenerationOptions, boolean>;
33
+ nucleus: string;
34
+ }>;
35
+ type ChangeMatrixGenerationScaleAction = ActionType<'CHANGE_MATRIX_GENERATION_SCALE', {
36
+ zoomOptions: ZoomOptions;
37
+ nucleus: string;
38
+ }>;
39
+ type ChangeMatrixGenerationStocsyChemicalShiftAction = ActionType<'CHANGE_MATRIX_GENERATION_STOCSY_CHEMICAL_SHIFT', {
40
+ nucleus: string;
41
+ chemicalShift: number;
42
+ }>;
43
+ export type MatrixGenerationActions = ToggleMatrixGenerationViewAction | deleteMatrixGenerationExclusionZoneAction | addMatrixGenerationExclusionZoneAction | setMatrixGenerationOptionsAction | ChangeMatrixGenerationScaleAction | ChangeMatrixGenerationStocsyChemicalShiftAction;
3
44
  declare function addExclusionZone(draft: Draft<PreferencesState>, action: addMatrixGenerationExclusionZoneAction): void;
4
45
  declare function deleteExclusionZone(draft: Draft<PreferencesState>, action: any): void;
5
46
  declare function setMatrixGenerationOptions(draft: Draft<PreferencesState>, action: any): void;
6
- export { addExclusionZone, deleteExclusionZone, setMatrixGenerationOptions };
47
+ declare function toggleMatrixGenerationViewProperty(draft: Draft<PreferencesState>, action: ToggleMatrixGenerationViewAction): void;
48
+ declare function resetDefaultViewMatrixGenerationOptions(draft: Draft<PreferencesState>, action: ToggleMatrixGenerationViewAction): void;
49
+ declare function changeMatrixGenerationScale(draft: Draft<PreferencesState>, action: ChangeMatrixGenerationScaleAction): void;
50
+ declare function changeMatrixGenerationStocsyChemicalShift(draft: Draft<PreferencesState>, action: ChangeMatrixGenerationStocsyChemicalShiftAction): null | undefined;
51
+ export { addExclusionZone, deleteExclusionZone, setMatrixGenerationOptions, toggleMatrixGenerationViewProperty, changeMatrixGenerationScale, changeMatrixGenerationStocsyChemicalShift, resetDefaultViewMatrixGenerationOptions, };