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.
- package/lib/component/1d/Chart1D.js +3 -1
- package/lib/component/1d/ExclusionZoneAnnotation.d.ts +0 -1
- package/lib/component/1d/Viewer1D.js +36 -11
- package/lib/component/1d/database/DatabaseSpectrum.js +14 -19
- package/lib/component/1d/jCouplingGraph/JGraphContext.d.ts +0 -1
- package/lib/component/1d/matrix/Boxplot.d.ts +6 -0
- package/lib/component/1d/matrix/Boxplot.js +97 -0
- package/lib/component/1d/matrix/Stocsy.d.ts +5 -0
- package/lib/component/1d/matrix/Stocsy.js +101 -0
- package/lib/component/1d/matrix/useMatrix.d.ts +29 -0
- package/lib/component/1d/matrix/useMatrix.js +93 -0
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts +0 -1
- package/lib/component/1d/peaks/PeakEditionManager.js +16 -10
- package/lib/component/1d/utilities/getDecimalsCount.js +1 -1
- package/lib/component/1d/utilities/intersectionResolver.js +1 -1
- package/lib/component/1d/utilities/scale.d.ts +2 -1
- package/lib/component/1d/utilities/scale.js +6 -1
- package/lib/component/1d-2d/FieldEdition.d.ts +3 -1
- package/lib/component/1d-2d/FieldEdition.js +26 -10
- package/lib/component/2d/1d-tracer/Left1DChart.d.ts +0 -1
- package/lib/component/2d/1d-tracer/Top1DChart.d.ts +0 -1
- package/lib/component/2d/XAxis.d.ts +0 -1
- package/lib/component/2d/YAxis.d.ts +0 -1
- package/lib/component/2d/ft/Contours.js +7 -7
- package/lib/component/assignment/AssignmentsContext.d.ts +0 -1
- package/lib/component/context/ChartContext.d.ts +0 -1
- package/lib/component/context/DispatchContext.d.ts +0 -1
- package/lib/component/context/GlobalContext.d.ts +0 -1
- package/lib/component/context/KeyModifierContext.js +1 -1
- package/lib/component/context/LoaderContext.d.ts +0 -1
- package/lib/component/context/PreferencesContext.d.ts +0 -1
- package/lib/component/context/PrepareExportContext.d.ts +21 -0
- package/lib/component/context/PrepareExportContext.js +124 -0
- package/lib/component/context/ScaleContext.d.ts +0 -1
- package/lib/component/elements/ActionButtons.d.ts +1 -0
- package/lib/component/elements/ActionButtons.js +4 -4
- package/lib/component/elements/ColorInput.d.ts +0 -1
- package/lib/component/elements/ColorPickerDropdownController.d.ts +2 -0
- package/lib/component/elements/ColorPickerDropdownController.js +8 -0
- package/lib/component/elements/ColumnWrapper.d.ts +0 -1
- package/lib/component/elements/ContextMenu.d.ts +0 -1
- package/lib/component/elements/Input.d.ts +1 -0
- package/lib/component/elements/Input.js +2 -1
- package/lib/component/elements/Input2.d.ts +13 -0
- package/lib/component/elements/Input2.js +118 -0
- package/lib/component/elements/Input2Controller.d.ts +12 -0
- package/lib/component/elements/Input2Controller.js +22 -0
- package/lib/component/elements/MoleculeSelection.js +1 -1
- package/lib/component/elements/NumberInput.js +1 -1
- package/lib/component/elements/NumberInput2.d.ts +12 -0
- package/lib/component/elements/NumberInput2.js +65 -0
- package/lib/component/elements/NumberInput2Controller.d.ts +8 -0
- package/lib/component/elements/NumberInput2Controller.js +15 -0
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +3 -3
- package/lib/component/elements/ReactTable/Style.d.ts +3 -1
- package/lib/component/elements/ReactTable/Style.js +11 -1
- package/lib/component/elements/ReactTable/utility/ReactTableContext.d.ts +0 -1
- package/lib/component/elements/Select2.d.ts +26 -0
- package/lib/component/elements/Select2.js +25 -0
- package/lib/component/elements/Select2Controller.d.ts +7 -0
- package/lib/component/elements/Select2Controller.js +12 -0
- package/lib/component/elements/draggable/useDraggable.d.ts +0 -1
- package/lib/component/elements/dropDownButton/DropDownButton.d.ts +2 -4
- package/lib/component/elements/dropDownButton/DropDownButton.js +11 -37
- package/lib/component/elements/dropDownButton/DropDownList.js +3 -32
- package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
- package/lib/component/elements/formik/FormikColumnFormatField.d.ts +0 -1
- package/lib/component/elements/formik/FormikInput.d.ts +0 -1
- package/lib/component/elements/formik/FormikInput2.d.ts +11 -0
- package/lib/component/elements/formik/FormikInput2.js +26 -0
- package/lib/component/elements/formik/FormikOnChange.d.ts +0 -1
- package/lib/component/elements/popup/Modal/Context.d.ts +0 -1
- package/lib/component/elements/popup/Modal/ModalContent.d.ts +0 -1
- package/lib/component/elements/resizer/SVGResizer.d.ts +0 -1
- package/lib/component/elements/useFormValidateField.d.ts +1 -0
- package/lib/component/elements/useFormValidateField.js +9 -0
- package/lib/component/header/ApodizationOptionsPanel.js +26 -11
- package/lib/component/header/AutoPeakPickingOptionPanel.d.ts +1 -4
- package/lib/component/header/AutoPeakPickingOptionPanel.js +16 -16
- package/lib/component/header/BaseLineCorrectionPanel.js +49 -27
- package/lib/component/header/Header.js +1 -1
- package/lib/component/header/PhaseCorrectionPanel.js +12 -24
- package/lib/component/header/RangesPickingOptionPanel.js +12 -12
- package/lib/component/header/ZeroFillingOptionsPanel.js +18 -7
- package/lib/component/header/Zones2DOptionPanel.js +19 -18
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +4 -4
- package/lib/component/hooks/usePanelPreferences.d.ts +2 -3
- package/lib/component/hooks/usePanelPreferences.js +3 -1
- package/lib/component/hooks/useToggleSpectraVisibility.d.ts +10 -0
- package/lib/component/hooks/useToggleSpectraVisibility.js +41 -0
- package/lib/component/hooks/useWorkspaceAction.d.ts +1 -1
- package/lib/component/modal/editRange/forms/components/SignalTab.d.ts +0 -1
- package/lib/component/modal/editRange/forms/components/SignalsContent.d.ts +0 -1
- package/lib/component/modal/setting/GeneralSettings.d.ts +5 -1
- package/lib/component/modal/setting/GeneralSettings.js +107 -111
- package/lib/component/modal/setting/WorkspaceItem.js +4 -9
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +95 -59
- package/lib/component/modal/setting/settings-tabs/DisplayTabContent.js +33 -25
- package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +15 -4
- package/lib/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +56 -39
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +36 -36
- package/lib/component/modal/setting/settings-tabs/NucleiTabContent.js +44 -36
- package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.js +16 -11
- package/lib/component/modal/setting/settings-tabs/SpectraColorsTabContent.js +47 -40
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +50 -40
- package/lib/component/modal/setting/settingsValidation.js +8 -34
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +0 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +0 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.d.ts +0 -1
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.d.ts +2 -2
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +121 -36
- package/lib/component/panels/Panels.js +32 -9
- package/lib/component/panels/PeaksPanel/PeaksPreferences.d.ts +0 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +0 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +0 -1
- package/lib/component/panels/SpectraPanel/SpectraPanelHeader.js +4 -27
- package/lib/component/panels/SpectraPanel/SpectraPreferences.d.ts +0 -1
- package/lib/component/panels/SpectraPanel/SpectraPreferences.js +32 -24
- package/lib/component/panels/SpectraPanel/SpectraTable.js +17 -2
- package/lib/component/panels/SpectraPanel/SpectrumListPanel.d.ts +0 -1
- package/lib/component/panels/SpectraPanel/base/ColorIndicator.d.ts +0 -1
- package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.d.ts +3 -3
- package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.js +25 -16
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DHistogram.d.ts +0 -1
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DSetting.js +15 -5
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DHistogram.d.ts +0 -1
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.js +44 -6
- package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.d.ts +0 -1
- package/lib/component/panels/SummaryPanel/Overview.d.ts +0 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.d.ts +0 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPreferences.d.ts +0 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +17 -3
- package/lib/component/panels/databasePanel/DatabasePreferences.d.ts +0 -1
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +11 -4
- package/lib/component/panels/databasePanel/DatabaseTable.js +22 -7
- package/lib/component/panels/informationPanel/InformationEditionModal.d.ts +6 -0
- package/lib/component/panels/informationPanel/InformationEditionModal.js +105 -0
- package/lib/component/panels/informationPanel/InformationPanel.d.ts +1 -0
- package/lib/component/panels/{InformationPanel.js → informationPanel/InformationPanel.js} +2 -2
- package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.d.ts +0 -1
- package/lib/component/panels/multipleAnalysisPanel/preferences/index.d.ts +0 -1
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +0 -1
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +1 -1
- package/lib/component/panels/predictionPanel/PredictionPreferences.d.ts +0 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.d.ts +0 -1
- package/lib/component/reducer/Reducer.d.ts +7 -1
- package/lib/component/reducer/Reducer.js +2 -0
- package/lib/component/reducer/actions/DatabaseActions.js +22 -5
- package/lib/component/reducer/actions/DomainActions.d.ts +5 -2
- package/lib/component/reducer/actions/DomainActions.js +6 -4
- package/lib/component/reducer/actions/FiltersActions.js +2 -2
- package/lib/component/reducer/actions/LoadActions.js +5 -2
- package/lib/component/reducer/actions/SpectraActions.d.ts +9 -2
- package/lib/component/reducer/actions/SpectraActions.js +65 -23
- package/lib/component/reducer/actions/ToolsActions.js +3 -4
- package/lib/component/reducer/preferences/actions/matrixGeneration.d.ts +47 -2
- package/lib/component/reducer/preferences/actions/matrixGeneration.js +62 -25
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +11 -8
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +19 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -26
- package/lib/component/reducer/preferences/preferencesReducer.js +7 -1
- package/lib/component/toolbar/ToolBar.js +6 -7
- package/lib/component/utility/PathBuilder.d.ts +1 -0
- package/lib/component/utility/PathBuilder.js +8 -1
- package/lib/component/utility/checkUniqueByKey.d.ts +2 -0
- package/lib/component/utility/checkUniqueByKey.js +40 -0
- package/lib/component/utility/colorToHexWithAlpha.d.ts +9 -0
- package/lib/component/utility/colorToHexWithAlpha.js +4 -0
- package/lib/component/workspaces/exercise.js +2 -0
- package/lib/component/workspaces/process1D.js +0 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
- package/lib/data/PredictionManager.js +3 -5
- package/lib/data/data1d/Spectrum1D/ranges/createRange.d.ts +13 -13
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +9 -9
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +13 -13
- package/lib/data/data1d/Spectrum1D/ranges/resizeRange.d.ts +13 -13
- package/lib/data/data1d/database.d.ts +1 -0
- package/lib/data/data1d/database.js +4 -2
- package/lib/data/data2d/Spectrum2D/contours.d.ts +8 -22
- package/lib/data/data2d/Spectrum2D/contours.js +88 -67
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +4 -2
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +20 -20
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +20 -20
- package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
- package/lib/data/initiateFilters.d.ts +1 -1
- package/lib/data/matrixGeneration.js +1 -2
- package/lib/data/types/common/DeepPartial.d.ts +3 -0
- package/lib/data/types/common/DeepPartial.js +1 -0
- package/lib/data/types/common/Keys.d.ts +3 -0
- package/lib/data/types/common/Keys.js +1 -0
- package/lib/data/utilities/generateNumbersPowerOfX.d.ts +2 -2
- package/lib/versionInfo.js +1 -1
- package/package.json +39 -38
- package/lib/component/elements/CustomToolTip.d.ts +0 -8
- package/lib/component/elements/CustomToolTip.js +0 -107
- package/lib/component/elements/formik/FormikSlider.d.ts +0 -6
- package/lib/component/elements/formik/FormikSlider.js +0 -15
- package/lib/component/panels/InformationPanel.d.ts +0 -1
|
@@ -1,42 +1,79 @@
|
|
|
1
1
|
import { v4 } from '@lukeed/uuid';
|
|
2
|
+
import { toScaleRatio } from '../../helper/Zoom1DManager';
|
|
3
|
+
import { getMatrixGenerationDefaultOptions } from '../panelsPreferencesDefaultValues';
|
|
2
4
|
import { getActiveWorkspace } from '../utilities/getActiveWorkspace';
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
+
function getMatrixGenerationPanelOptions(draft, nucleus) {
|
|
6
|
+
initMatrixGeneration(draft, nucleus);
|
|
7
|
+
const currentWorkspacePreferences = getActiveWorkspace(draft);
|
|
8
|
+
const panels = currentWorkspacePreferences.panels;
|
|
9
|
+
const matrixGeneration = panels.matrixGeneration?.[nucleus];
|
|
10
|
+
return matrixGeneration;
|
|
11
|
+
}
|
|
12
|
+
function initMatrixGeneration(draft, nucleus) {
|
|
5
13
|
const currentWorkspacePreferences = getActiveWorkspace(draft);
|
|
6
14
|
const panels = currentWorkspacePreferences.panels;
|
|
7
|
-
const exclusionZone = {
|
|
8
|
-
id: v4(),
|
|
9
|
-
...zone,
|
|
10
|
-
};
|
|
11
15
|
if (!panels.matrixGeneration?.[nucleus]) {
|
|
12
|
-
const options =
|
|
13
|
-
exclusionsZones: [exclusionZone],
|
|
14
|
-
filters: [],
|
|
15
|
-
range,
|
|
16
|
-
numberOfPoints: 1024,
|
|
17
|
-
};
|
|
16
|
+
const options = getMatrixGenerationDefaultOptions();
|
|
18
17
|
panels.matrixGeneration = {
|
|
19
18
|
...panels.matrixGeneration,
|
|
20
19
|
[nucleus]: options,
|
|
21
20
|
};
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
return panels.matrixGeneration;
|
|
23
|
+
}
|
|
24
|
+
function addExclusionZone(draft, action) {
|
|
25
|
+
const { zone, range, nucleus } = action.payload;
|
|
26
|
+
const matrixGeneration = getMatrixGenerationPanelOptions(draft, nucleus);
|
|
27
|
+
if (!matrixGeneration)
|
|
28
|
+
return;
|
|
29
|
+
const exclusionZone = {
|
|
30
|
+
id: v4(),
|
|
31
|
+
...zone,
|
|
32
|
+
};
|
|
33
|
+
matrixGeneration.matrixOptions.range = range;
|
|
34
|
+
matrixGeneration.matrixOptions.exclusionsZones.push(exclusionZone);
|
|
26
35
|
}
|
|
27
36
|
function deleteExclusionZone(draft, action) {
|
|
28
37
|
const { zone, nucleus } = action.payload;
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
38
|
+
const matrixGeneration = getMatrixGenerationPanelOptions(draft, nucleus);
|
|
39
|
+
if (!matrixGeneration)
|
|
40
|
+
return;
|
|
41
|
+
const options = matrixGeneration.matrixOptions;
|
|
42
|
+
options.exclusionsZones = options.exclusionsZones.filter((_zone) => _zone.id !== zone.id);
|
|
35
43
|
}
|
|
36
44
|
function setMatrixGenerationOptions(draft, action) {
|
|
37
45
|
const { options, nucleus } = action.payload;
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
const matrixGeneration = getMatrixGenerationPanelOptions(draft, nucleus);
|
|
47
|
+
matrixGeneration.matrixOptions = options;
|
|
48
|
+
}
|
|
49
|
+
function toggleMatrixGenerationViewProperty(draft, action) {
|
|
50
|
+
const { key, nucleus } = action.payload;
|
|
51
|
+
const matrixGeneration = getMatrixGenerationPanelOptions(draft, nucleus);
|
|
52
|
+
if (!matrixGeneration)
|
|
53
|
+
return;
|
|
54
|
+
matrixGeneration[key] = !matrixGeneration[key];
|
|
55
|
+
}
|
|
56
|
+
function resetDefaultViewMatrixGenerationOptions(draft, action) {
|
|
57
|
+
const { nucleus } = action.payload;
|
|
58
|
+
const matrixGeneration = initMatrixGeneration(draft, nucleus);
|
|
59
|
+
const currentOptions = getMatrixGenerationPanelOptions(draft, nucleus);
|
|
60
|
+
const { matrixOptions } = currentOptions;
|
|
61
|
+
const { matrixOptions: defaultMatrixOptions, ...vewOptions } = getMatrixGenerationDefaultOptions();
|
|
62
|
+
matrixGeneration[nucleus] = { matrixOptions, ...vewOptions };
|
|
63
|
+
}
|
|
64
|
+
function changeMatrixGenerationScale(draft, action) {
|
|
65
|
+
const { zoomOptions, nucleus } = action.payload;
|
|
66
|
+
const matrixGeneration = getMatrixGenerationPanelOptions(draft, nucleus);
|
|
67
|
+
if (!matrixGeneration)
|
|
68
|
+
return;
|
|
69
|
+
const scaleRatio = toScaleRatio(zoomOptions);
|
|
70
|
+
matrixGeneration.scaleRatio *= scaleRatio;
|
|
71
|
+
}
|
|
72
|
+
function changeMatrixGenerationStocsyChemicalShift(draft, action) {
|
|
73
|
+
const { chemicalShift, nucleus } = action.payload;
|
|
74
|
+
const matrixGeneration = getMatrixGenerationPanelOptions(draft, nucleus);
|
|
75
|
+
if (!matrixGeneration)
|
|
76
|
+
return null;
|
|
77
|
+
matrixGeneration.chemicalShift = chemicalShift;
|
|
41
78
|
}
|
|
42
|
-
export { addExclusionZone, deleteExclusionZone, setMatrixGenerationOptions };
|
|
79
|
+
export { addExclusionZone, deleteExclusionZone, setMatrixGenerationOptions, toggleMatrixGenerationViewProperty, changeMatrixGenerationScale, changeMatrixGenerationStocsyChemicalShift, resetDefaultViewMatrixGenerationOptions, };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { PanelsPreferences } from 'nmr-load-save';
|
|
2
|
-
|
|
3
|
-
declare const
|
|
4
|
-
declare const
|
|
5
|
-
declare const
|
|
6
|
-
declare const
|
|
1
|
+
import { MatrixGenerationOptions, PanelsPreferences } from 'nmr-load-save';
|
|
2
|
+
import { DeepPartial } from '../../../data/types/common/DeepPartial';
|
|
3
|
+
declare const getSpectraDefaultValues: (nucleus?: string) => PanelsPreferences["spectra"];
|
|
4
|
+
declare const getIntegralDefaultValues: (nucleus?: string) => PanelsPreferences["integrals"];
|
|
5
|
+
declare const getZoneDefaultValues: (nucleus?: string) => PanelsPreferences["zones"];
|
|
6
|
+
declare const getRangeDefaultValues: (nucleus?: string) => PanelsPreferences["ranges"];
|
|
7
|
+
declare const getPeaksDefaultValues: (nucleus?: string) => PanelsPreferences["peaks"];
|
|
7
8
|
declare const databaseDefaultValues: PanelsPreferences['database'];
|
|
8
|
-
declare const getMultipleSpectraAnalysisDefaultValues: (nucleus?: string) => PanelsPreferences[
|
|
9
|
-
|
|
9
|
+
declare const getMultipleSpectraAnalysisDefaultValues: (nucleus?: string) => PanelsPreferences["multipleSpectraAnalysis"];
|
|
10
|
+
declare function getMatrixGenerationDefaultOptions(): DeepPartial<MatrixGenerationOptions>;
|
|
11
|
+
declare const getMatrixGenerationDefaultValues: (nucleus?: string) => PanelsPreferences["matrixGeneration"];
|
|
12
|
+
export { getSpectraDefaultValues, getPeaksDefaultValues, getIntegralDefaultValues, getRangeDefaultValues, getZoneDefaultValues, databaseDefaultValues, getMultipleSpectraAnalysisDefaultValues, getMatrixGenerationDefaultOptions, getMatrixGenerationDefaultValues, };
|
|
@@ -52,6 +52,7 @@ const getIntegralDefaultValues = (nucleus) => {
|
|
|
52
52
|
strokeWidth: 1,
|
|
53
53
|
showKind: true,
|
|
54
54
|
showDeleteAction: true,
|
|
55
|
+
isSumConstant: true,
|
|
55
56
|
};
|
|
56
57
|
return getPreferences(preferences, nucleus);
|
|
57
58
|
};
|
|
@@ -100,6 +101,7 @@ const getRangeDefaultValues = (nucleus) => {
|
|
|
100
101
|
showZoomAction: true,
|
|
101
102
|
showEditAction: true,
|
|
102
103
|
showAssignmentLabel: false,
|
|
104
|
+
isSumConstant: true,
|
|
103
105
|
};
|
|
104
106
|
return getPreferences(preferences, nucleus);
|
|
105
107
|
};
|
|
@@ -148,4 +150,20 @@ const getMultipleSpectraAnalysisDefaultValues = (nucleus) => {
|
|
|
148
150
|
};
|
|
149
151
|
return nucleus ? { [nucleus]: preferences } : {};
|
|
150
152
|
};
|
|
151
|
-
|
|
153
|
+
function getMatrixGenerationDefaultOptions() {
|
|
154
|
+
return {
|
|
155
|
+
matrixOptions: {
|
|
156
|
+
exclusionsZones: [],
|
|
157
|
+
filters: [],
|
|
158
|
+
numberOfPoints: 1024,
|
|
159
|
+
},
|
|
160
|
+
chemicalShift: null,
|
|
161
|
+
scaleRatio: 1,
|
|
162
|
+
showBoxPlot: false,
|
|
163
|
+
showStocsy: false,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
const getMatrixGenerationDefaultValues = (nucleus) => {
|
|
167
|
+
return nucleus ? { [nucleus]: getMatrixGenerationDefaultOptions() } : {};
|
|
168
|
+
};
|
|
169
|
+
export { getSpectraDefaultValues, getPeaksDefaultValues, getIntegralDefaultValues, getRangeDefaultValues, getZoneDefaultValues, databaseDefaultValues, getMultipleSpectraAnalysisDefaultValues, getMatrixGenerationDefaultOptions, getMatrixGenerationDefaultValues, };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { MultipleSpectraAnalysisPreferences, Workspace, WorkSpaceSource } from 'nmr-load-save';
|
|
2
2
|
import { Reducer } from 'react';
|
|
3
3
|
import { SplitPaneSize } from 'react-science/ui';
|
|
4
|
-
import { MatrixOptions } from '../../../data/types/data1d/MatrixOptions';
|
|
5
4
|
import type { NMRiumWorkspace, NMRiumPreferences } from '../../main';
|
|
6
5
|
import { ActionType } from '../types/ActionType';
|
|
6
|
+
import { MatrixGenerationActions } from './actions/matrixGeneration';
|
|
7
7
|
export declare const WORKSPACES_KEYS: {
|
|
8
8
|
componentKey: string;
|
|
9
9
|
nmriumKey: string;
|
|
@@ -22,7 +22,7 @@ type InitPreferencesAction = ActionType<'INIT_PREFERENCES', {
|
|
|
22
22
|
type SetPreferencesAction = ActionType<'SET_PREFERENCES', Partial<Workspace>> | ActionType<'SET_PREFERENCES'>;
|
|
23
23
|
type SetPanelsPreferencesAction = ActionType<'SET_PANELS_PREFERENCES', {
|
|
24
24
|
key: string;
|
|
25
|
-
value:
|
|
25
|
+
value: any;
|
|
26
26
|
}>;
|
|
27
27
|
export type SetWorkspaceAction = ActionType<'SET_WORKSPACE', {
|
|
28
28
|
workspaceSource: 'any';
|
|
@@ -60,33 +60,10 @@ export type SetSpectraAnalysisPanelPreferencesAction = ActionType<'SET_SPECTRA_A
|
|
|
60
60
|
nucleus: string;
|
|
61
61
|
data: MultipleSpectraAnalysisPreferences;
|
|
62
62
|
}>;
|
|
63
|
-
export type setMatrixGenerationOptionsAction = ActionType<'SET_MATRIX_GENERATION_OPTIONS', {
|
|
64
|
-
nucleus: string;
|
|
65
|
-
options: MatrixOptions;
|
|
66
|
-
}>;
|
|
67
|
-
export type addMatrixGenerationExclusionZoneAction = ActionType<'ADD_MATRIX_GENERATION_EXCLUSION_ZONE', {
|
|
68
|
-
zone: {
|
|
69
|
-
from: number;
|
|
70
|
-
to: number;
|
|
71
|
-
};
|
|
72
|
-
range: {
|
|
73
|
-
from: number;
|
|
74
|
-
to: number;
|
|
75
|
-
};
|
|
76
|
-
nucleus: string;
|
|
77
|
-
}>;
|
|
78
|
-
export type deleteMatrixGenerationExclusionZoneAction = ActionType<'DELETE_MATRIX_GENERATION_EXCLUSION_ZONE', {
|
|
79
|
-
zone: {
|
|
80
|
-
id: string;
|
|
81
|
-
from: number;
|
|
82
|
-
to: number;
|
|
83
|
-
};
|
|
84
|
-
nucleus: string;
|
|
85
|
-
}>;
|
|
86
63
|
export type SetVerticalSplitterPositionAction = ActionType<'SET_VERTICAL_SPLITTER_POSITION', {
|
|
87
64
|
value: SplitPaneSize;
|
|
88
65
|
}>;
|
|
89
|
-
type PreferencesActions = InitPreferencesAction | SetPreferencesAction | SetPanelsPreferencesAction | SetWorkspaceAction | WorkspaceAction | AddWorkspaceAction | ApplyGeneralPreferences | AnalyzeSpectraAction | ChangeAnalysisColumnValueKeyAction | DeleteAnalysisColumn | SetSpectraAnalysisPanelPreferencesAction |
|
|
66
|
+
type PreferencesActions = InitPreferencesAction | SetPreferencesAction | SetPanelsPreferencesAction | SetWorkspaceAction | WorkspaceAction | AddWorkspaceAction | ApplyGeneralPreferences | AnalyzeSpectraAction | ChangeAnalysisColumnValueKeyAction | DeleteAnalysisColumn | SetSpectraAnalysisPanelPreferencesAction | MatrixGenerationActions | SetVerticalSplitterPositionAction;
|
|
90
67
|
export declare const WORKSPACES: Array<{
|
|
91
68
|
key: NMRiumWorkspace;
|
|
92
69
|
label: string;
|
|
@@ -6,7 +6,7 @@ import { addWorkspace } from './actions/addWorkspace';
|
|
|
6
6
|
import { analyzeSpectra, changeAnalysisColumnValueKey, deleteAnalysisColumn, setSpectraAnalysisPanelsPreferences, } from './actions/analyzeSpectra';
|
|
7
7
|
import { applyGeneralPreferences } from './actions/applyGeneralPreferences';
|
|
8
8
|
import { initPreferences } from './actions/initPreferences';
|
|
9
|
-
import { setMatrixGenerationOptions, addExclusionZone, deleteExclusionZone, } from './actions/matrixGeneration';
|
|
9
|
+
import { setMatrixGenerationOptions, addExclusionZone, deleteExclusionZone, toggleMatrixGenerationViewProperty, changeMatrixGenerationScale, changeMatrixGenerationStocsyChemicalShift, } from './actions/matrixGeneration';
|
|
10
10
|
import { removeWorkspace } from './actions/removeWorkspace';
|
|
11
11
|
import { setActiveWorkspace } from './actions/setActiveWorkspace';
|
|
12
12
|
import { setPanelsPreferences } from './actions/setPanelsPreferences';
|
|
@@ -125,8 +125,14 @@ function innerPreferencesReducer(draft, action) {
|
|
|
125
125
|
return addExclusionZone(draft, action);
|
|
126
126
|
case 'DELETE_MATRIX_GENERATION_EXCLUSION_ZONE':
|
|
127
127
|
return deleteExclusionZone(draft, action);
|
|
128
|
+
case 'TOGGLE_MATRIX_GENERATION_VIEW_PROPERTY':
|
|
129
|
+
return toggleMatrixGenerationViewProperty(draft, action);
|
|
128
130
|
case 'SET_VERTICAL_SPLITTER_POSITION':
|
|
129
131
|
return setVerticalSplitterPosition(draft, action);
|
|
132
|
+
case 'CHANGE_MATRIX_GENERATION_SCALE':
|
|
133
|
+
return changeMatrixGenerationScale(draft, action);
|
|
134
|
+
case 'CHANGE_MATRIX_GENERATION_STOCSY_CHEMICAL_SHIFT':
|
|
135
|
+
return changeMatrixGenerationStocsyChemicalShift(draft, action);
|
|
130
136
|
default:
|
|
131
137
|
return draft;
|
|
132
138
|
}
|
|
@@ -3,12 +3,11 @@ import { SvgNmrAlignBottom, SvgNmrAlignCenter, SvgNmrApodization, SvgNmrBaseline
|
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { FaSearchPlus, FaExpand, FaDiceFour, FaFileImport, FaFileExport, } from 'react-icons/fa';
|
|
5
5
|
import { PiKnifeBold } from 'react-icons/pi';
|
|
6
|
-
import { Toolbar } from 'react-science/ui';
|
|
6
|
+
import { Toolbar, TooltipHelpContent, } from 'react-science/ui';
|
|
7
7
|
import { useChartData } from '../context/ChartContext';
|
|
8
8
|
import { useDispatch } from '../context/DispatchContext';
|
|
9
9
|
import { useLoader } from '../context/LoaderContext';
|
|
10
10
|
import { usePreferences } from '../context/PreferencesContext';
|
|
11
|
-
import { CustomToolTip } from '../elements/CustomToolTip';
|
|
12
11
|
import { ToolbarPopoverItem, } from '../elements/ToolbarPopoverItem';
|
|
13
12
|
import useCheckExperimentalFeature from '../hooks/useCheckExperimentalFeature';
|
|
14
13
|
import { useCheckToolsVisibility, } from '../hooks/useCheckToolsVisibility';
|
|
@@ -87,7 +86,7 @@ export default function ToolBar() {
|
|
|
87
86
|
function exportHandler(data) {
|
|
88
87
|
switch (data?.id) {
|
|
89
88
|
case 'svg':
|
|
90
|
-
|
|
89
|
+
saveAsSVGHandler();
|
|
91
90
|
break;
|
|
92
91
|
case 'png':
|
|
93
92
|
void saveAsPNGHandler();
|
|
@@ -112,8 +111,8 @@ export default function ToolBar() {
|
|
|
112
111
|
title: options.zoom.label,
|
|
113
112
|
subTitles: [
|
|
114
113
|
{ title: 'Vertical', shortcuts: ['Scroll wheel'] },
|
|
115
|
-
{ title: 'Horizontal', shortcuts: ['
|
|
116
|
-
{ title: 'Pan', shortcuts: ['Right
|
|
114
|
+
{ title: 'Horizontal', shortcuts: ['⇧', 'Scroll wheel'] },
|
|
115
|
+
{ title: 'Pan', shortcuts: ['Right button'] },
|
|
117
116
|
],
|
|
118
117
|
},
|
|
119
118
|
icon: _jsx(FaSearchPlus, {}),
|
|
@@ -325,12 +324,12 @@ export default function ToolBar() {
|
|
|
325
324
|
return null;
|
|
326
325
|
if (isPopoverToolItem(item)) {
|
|
327
326
|
const { menuItems, onClick } = item;
|
|
328
|
-
return (_jsx(ToolbarPopoverItem, { options: menuItems, tooltip: typeof tooltip === 'string' ? (tooltip) : (_jsx(
|
|
327
|
+
return (_jsx(ToolbarPopoverItem, { options: menuItems, tooltip: typeof tooltip === 'string' ? (tooltip) : (_jsx(TooltipHelpContent, { ...tooltip })), tooltipProps: {
|
|
329
328
|
minimal: true,
|
|
330
329
|
}, id: id, active: selectedTool === id, icon: icon, onClick: onClick }, id));
|
|
331
330
|
}
|
|
332
331
|
const { onClick } = item;
|
|
333
|
-
return (_jsx(Toolbar.Item, { onClick: onClick || (() => handleChange(id)), tooltip: typeof tooltip === 'string' ? (tooltip) : (_jsx(
|
|
332
|
+
return (_jsx(Toolbar.Item, { onClick: onClick || (() => handleChange(id)), tooltip: typeof tooltip === 'string' ? (tooltip) : (_jsx(TooltipHelpContent, { ...tooltip })), tooltipProps: {
|
|
334
333
|
minimal: true,
|
|
335
334
|
}, id: id, active: selectedTool === id, icon: icon }, id));
|
|
336
335
|
}) })] }));
|
|
@@ -19,11 +19,18 @@ export class PathBuilder {
|
|
|
19
19
|
toString() {
|
|
20
20
|
return this.array.join(' ');
|
|
21
21
|
}
|
|
22
|
+
concatPath(pathBuilder) {
|
|
23
|
+
return this.array.concat(pathBuilder.array).join(' ');
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
26
|
/**
|
|
24
27
|
* Clamp values to avoid rendering issues of the SVG.
|
|
25
28
|
* This assumes that the viewport has pixel coordinates (so the max values are outside of the visible area)
|
|
26
29
|
*/
|
|
27
30
|
function clamp(value) {
|
|
28
|
-
|
|
31
|
+
if (value < -1e5)
|
|
32
|
+
return -1e5;
|
|
33
|
+
if (value > 1e5)
|
|
34
|
+
return 1e5;
|
|
35
|
+
return value;
|
|
29
36
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ValidationError } from 'yup';
|
|
2
|
+
export function checkUniqueByKey(data, checkKey, context) {
|
|
3
|
+
if (!data)
|
|
4
|
+
return true;
|
|
5
|
+
const matchesFrequencies = {};
|
|
6
|
+
let index = 0;
|
|
7
|
+
for (const datum of data) {
|
|
8
|
+
let key;
|
|
9
|
+
const matchValue = datum[checkKey];
|
|
10
|
+
if (typeof matchValue === 'string') {
|
|
11
|
+
key = matchValue.toLowerCase();
|
|
12
|
+
}
|
|
13
|
+
if (key) {
|
|
14
|
+
if (matchesFrequencies[key]) {
|
|
15
|
+
++matchesFrequencies[key].value;
|
|
16
|
+
matchesFrequencies[key].fieldsIndexes.push(index);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
matchesFrequencies[key] = { value: 1, fieldsIndexes: [index] };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
index++;
|
|
23
|
+
}
|
|
24
|
+
const errors = [];
|
|
25
|
+
for (const key in matchesFrequencies) {
|
|
26
|
+
const { value, fieldsIndexes } = matchesFrequencies[key];
|
|
27
|
+
if (value > 1) {
|
|
28
|
+
for (const index of fieldsIndexes) {
|
|
29
|
+
errors.push(context.createError({
|
|
30
|
+
message: `${key} must be unique`,
|
|
31
|
+
path: `${context.path}[${index}].${String(checkKey)}`,
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (errors.length > 0) {
|
|
37
|
+
return new ValidationError(errors);
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
@@ -49,6 +49,7 @@ export const exercise = {
|
|
|
49
49
|
strokeWidth: 1,
|
|
50
50
|
showKind: false,
|
|
51
51
|
showDeleteAction: true,
|
|
52
|
+
isSumConstant: true,
|
|
52
53
|
},
|
|
53
54
|
'13C': {
|
|
54
55
|
showSerialNumber: true,
|
|
@@ -60,6 +61,7 @@ export const exercise = {
|
|
|
60
61
|
strokeWidth: 1,
|
|
61
62
|
showKind: false,
|
|
62
63
|
showDeleteAction: true,
|
|
64
|
+
isSumConstant: true,
|
|
63
65
|
},
|
|
64
66
|
},
|
|
65
67
|
},
|
|
@@ -55,13 +55,11 @@ export async function predictSpectra(molfile, options) {
|
|
|
55
55
|
}
|
|
56
56
|
function generateName(name, options) {
|
|
57
57
|
const { frequency, experiment } = options;
|
|
58
|
-
const freq = Array.isArray(frequency)
|
|
59
|
-
|
|
60
|
-
: `${frequency}MHz`;
|
|
61
|
-
return name || `${experiment.toUpperCase()}_${freq}_${v4()}`;
|
|
58
|
+
const freq = Array.isArray(frequency) ? frequency[0] : frequency;
|
|
59
|
+
return name || `${experiment.toUpperCase()}_${freq}MHz`;
|
|
62
60
|
}
|
|
63
61
|
export function generateSpectra(predictedSpectra, inputOptions, color, logger) {
|
|
64
|
-
const options =
|
|
62
|
+
const options = structuredClone(inputOptions);
|
|
65
63
|
checkFromTo(predictedSpectra, options, logger);
|
|
66
64
|
const spectra = [];
|
|
67
65
|
for (const experiment in predictedSpectra) {
|
|
@@ -11,26 +11,26 @@ export declare function createRange(spectrum: Spectrum1D, options: Pick<Range, '
|
|
|
11
11
|
delta: number;
|
|
12
12
|
multiplicity: string;
|
|
13
13
|
js: import("nmr-processing").Jcoupling[];
|
|
14
|
-
atoms?: number[]
|
|
15
|
-
assignment?: string
|
|
16
|
-
diaIDs?: string[]
|
|
17
|
-
nbAtoms?: number
|
|
18
|
-
integration?: number
|
|
14
|
+
atoms?: number[];
|
|
15
|
+
assignment?: string;
|
|
16
|
+
diaIDs?: string[];
|
|
17
|
+
nbAtoms?: number;
|
|
18
|
+
integration?: number;
|
|
19
19
|
statistic?: {
|
|
20
20
|
mean: number;
|
|
21
21
|
sd: number;
|
|
22
22
|
min: number;
|
|
23
23
|
max: number;
|
|
24
24
|
nb: number;
|
|
25
|
-
}
|
|
25
|
+
};
|
|
26
26
|
kind: string;
|
|
27
27
|
id: string;
|
|
28
28
|
peaks: {
|
|
29
29
|
originalX: number;
|
|
30
30
|
x: number;
|
|
31
31
|
id: string;
|
|
32
|
-
kind?: string
|
|
33
|
-
shape?: import("ml-peak-shape-generator").Shape1D
|
|
32
|
+
kind?: string;
|
|
33
|
+
shape?: import("ml-peak-shape-generator").Shape1D;
|
|
34
34
|
y: number;
|
|
35
35
|
width: number;
|
|
36
36
|
}[];
|
|
@@ -42,9 +42,9 @@ export declare function createRange(spectrum: Spectrum1D, options: Pick<Range, '
|
|
|
42
42
|
id: string;
|
|
43
43
|
kind: string;
|
|
44
44
|
integration: number;
|
|
45
|
-
nbAtoms?: number
|
|
46
|
-
multiplicity?: string
|
|
47
|
-
assignment?: string
|
|
48
|
-
diaIDs?: string[]
|
|
49
|
-
pubIntegral?: number
|
|
45
|
+
nbAtoms?: number;
|
|
46
|
+
multiplicity?: string;
|
|
47
|
+
assignment?: string;
|
|
48
|
+
diaIDs?: string[];
|
|
49
|
+
pubIntegral?: number;
|
|
50
50
|
} | undefined;
|
|
@@ -24,21 +24,21 @@ export default function detectSignals(data: DataXY<Float64Array>, options: {
|
|
|
24
24
|
diaIDs: never[];
|
|
25
25
|
}[] | {
|
|
26
26
|
delta: number;
|
|
27
|
-
id?: string
|
|
27
|
+
id?: string;
|
|
28
28
|
js: import("nmr-processing").Jcoupling[];
|
|
29
|
-
atoms?: number[]
|
|
30
|
-
assignment?: string
|
|
31
|
-
kind?: string
|
|
29
|
+
atoms?: number[];
|
|
30
|
+
assignment?: string;
|
|
31
|
+
kind?: string;
|
|
32
32
|
multiplicity: string;
|
|
33
|
-
diaIDs?: string[]
|
|
34
|
-
nbAtoms?: number
|
|
35
|
-
integration?: number
|
|
36
|
-
peaks?: import("nmr-processing").NMRPeak1D[]
|
|
33
|
+
diaIDs?: string[];
|
|
34
|
+
nbAtoms?: number;
|
|
35
|
+
integration?: number;
|
|
36
|
+
peaks?: import("nmr-processing").NMRPeak1D[];
|
|
37
37
|
statistic?: {
|
|
38
38
|
mean: number;
|
|
39
39
|
sd: number;
|
|
40
40
|
min: number;
|
|
41
41
|
max: number;
|
|
42
42
|
nb: number;
|
|
43
|
-
}
|
|
43
|
+
};
|
|
44
44
|
}[];
|
|
@@ -11,26 +11,26 @@ export declare function initiateRanges(inputSpectrum: Partial<Spectrum1D>, spect
|
|
|
11
11
|
delta: number;
|
|
12
12
|
multiplicity: string;
|
|
13
13
|
js: import("nmr-processing").Jcoupling[];
|
|
14
|
-
atoms?: number[]
|
|
15
|
-
assignment?: string
|
|
16
|
-
diaIDs?: string[]
|
|
17
|
-
nbAtoms?: number
|
|
18
|
-
integration?: number
|
|
14
|
+
atoms?: number[];
|
|
15
|
+
assignment?: string;
|
|
16
|
+
diaIDs?: string[];
|
|
17
|
+
nbAtoms?: number;
|
|
18
|
+
integration?: number;
|
|
19
19
|
statistic?: {
|
|
20
20
|
mean: number;
|
|
21
21
|
sd: number;
|
|
22
22
|
min: number;
|
|
23
23
|
max: number;
|
|
24
24
|
nb: number;
|
|
25
|
-
}
|
|
25
|
+
};
|
|
26
26
|
kind: string;
|
|
27
27
|
id: string;
|
|
28
28
|
peaks: {
|
|
29
29
|
originalX: number;
|
|
30
30
|
x: number;
|
|
31
31
|
id: string;
|
|
32
|
-
kind?: string
|
|
33
|
-
shape?: import("ml-peak-shape-generator").Shape1D
|
|
32
|
+
kind?: string;
|
|
33
|
+
shape?: import("ml-peak-shape-generator").Shape1D;
|
|
34
34
|
y: number;
|
|
35
35
|
width: number;
|
|
36
36
|
}[];
|
|
@@ -42,10 +42,10 @@ export declare function initiateRanges(inputSpectrum: Partial<Spectrum1D>, spect
|
|
|
42
42
|
id: string;
|
|
43
43
|
kind: string;
|
|
44
44
|
integration: number;
|
|
45
|
-
nbAtoms?: number
|
|
46
|
-
multiplicity?: string
|
|
47
|
-
assignment?: string
|
|
48
|
-
diaIDs?: string[]
|
|
49
|
-
pubIntegral?: number
|
|
45
|
+
nbAtoms?: number;
|
|
46
|
+
multiplicity?: string;
|
|
47
|
+
assignment?: string;
|
|
48
|
+
diaIDs?: string[];
|
|
49
|
+
pubIntegral?: number;
|
|
50
50
|
}[];
|
|
51
51
|
};
|
|
@@ -13,26 +13,26 @@ export declare function resizeRange(spectrum: Spectrum1D, options: {
|
|
|
13
13
|
delta: number;
|
|
14
14
|
multiplicity: string;
|
|
15
15
|
js: import("nmr-processing").Jcoupling[];
|
|
16
|
-
atoms?: number[]
|
|
17
|
-
assignment?: string
|
|
18
|
-
diaIDs?: string[]
|
|
19
|
-
nbAtoms?: number
|
|
20
|
-
integration?: number
|
|
16
|
+
atoms?: number[];
|
|
17
|
+
assignment?: string;
|
|
18
|
+
diaIDs?: string[];
|
|
19
|
+
nbAtoms?: number;
|
|
20
|
+
integration?: number;
|
|
21
21
|
statistic?: {
|
|
22
22
|
mean: number;
|
|
23
23
|
sd: number;
|
|
24
24
|
min: number;
|
|
25
25
|
max: number;
|
|
26
26
|
nb: number;
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
28
|
kind: string;
|
|
29
29
|
id: string;
|
|
30
30
|
peaks: {
|
|
31
31
|
originalX: number;
|
|
32
32
|
x: number;
|
|
33
33
|
id: string;
|
|
34
|
-
kind?: string
|
|
35
|
-
shape?: import("ml-peak-shape-generator").Shape1D
|
|
34
|
+
kind?: string;
|
|
35
|
+
shape?: import("ml-peak-shape-generator").Shape1D;
|
|
36
36
|
y: number;
|
|
37
37
|
width: number;
|
|
38
38
|
}[];
|
|
@@ -44,9 +44,9 @@ export declare function resizeRange(spectrum: Spectrum1D, options: {
|
|
|
44
44
|
id: string;
|
|
45
45
|
kind: string;
|
|
46
46
|
integration: number;
|
|
47
|
-
nbAtoms?: number
|
|
48
|
-
multiplicity?: string
|
|
49
|
-
assignment?: string
|
|
50
|
-
diaIDs?: string[]
|
|
51
|
-
pubIntegral?: number
|
|
47
|
+
nbAtoms?: number;
|
|
48
|
+
multiplicity?: string;
|
|
49
|
+
assignment?: string;
|
|
50
|
+
diaIDs?: string[];
|
|
51
|
+
pubIntegral?: number;
|
|
52
52
|
};
|
|
@@ -92,13 +92,14 @@ export function prepareData(data) {
|
|
|
92
92
|
let index = 0;
|
|
93
93
|
for (const item of data) {
|
|
94
94
|
const ids = [];
|
|
95
|
-
const { ranges, ...restItemKeys } = item;
|
|
95
|
+
const { ranges, id: spectrumID, ...restItemKeys } = item;
|
|
96
96
|
if (!ranges) {
|
|
97
|
-
ids.push(
|
|
97
|
+
ids.push(spectrumID);
|
|
98
98
|
result.push({
|
|
99
99
|
...restItemKeys,
|
|
100
100
|
index,
|
|
101
101
|
id: ids,
|
|
102
|
+
spectrumID,
|
|
102
103
|
ranges: [],
|
|
103
104
|
});
|
|
104
105
|
}
|
|
@@ -117,6 +118,7 @@ export function prepareData(data) {
|
|
|
117
118
|
index,
|
|
118
119
|
id: ids,
|
|
119
120
|
ranges,
|
|
121
|
+
spectrumID,
|
|
120
122
|
};
|
|
121
123
|
result.push(data);
|
|
122
124
|
}
|