nmrium 0.27.0 → 0.28.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/ExclusionZonesAnnotations.js +1 -1
- package/lib/component/1d/IntegralsSeries.js +2 -6
- package/lib/component/1d/PeakAnnotation.js +2 -2
- package/lib/component/1d/PeakAnnotations.js +2 -4
- package/lib/component/1d/SpectraTracker.js +2 -2
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +28 -26
- package/lib/component/1d/ranges/Range.d.ts +1 -2
- package/lib/component/1d/ranges/Range.js +3 -4
- package/lib/component/1d/ranges/Ranges.js +3 -4
- package/lib/component/1d/tool/BaseLineZones.js +3 -6
- package/lib/component/1d/tool/VerticalIndicator.js +1 -1
- package/lib/component/2d/Contours.js +1 -5
- package/lib/component/2d/SignalDeltaLine.js +1 -1
- package/lib/component/2d/Viewer2D.js +1 -1
- package/lib/component/2d/YAxis.js +2 -2
- package/lib/component/2d/zones/IndicationLines.js +2 -3
- package/lib/component/EventsTrackers/KeysListenerTracker.js +59 -41
- package/lib/component/NMRium.d.ts +14 -49
- package/lib/component/NMRium.js +14 -6
- package/lib/component/SplitPaneWrapper.js +2 -2
- package/lib/component/context/PreferencesContext.d.ts +3 -43
- package/lib/component/elements/Button.js +1 -1
- package/lib/component/elements/Logo.js +1 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -0
- package/lib/component/elements/Tab/Tabs.js +2 -1
- package/lib/component/elements/ToggleButton.js +2 -2
- package/lib/component/elements/accordion/Accordion.js +2 -6
- package/lib/component/elements/formik/Input.js +1 -1
- package/lib/component/elements/popup/Modal/Modal.js +1 -1
- package/lib/component/elements/popup/Modal/ModalContent.js +1 -1
- package/lib/component/elements/toggle/ToggleButtonGroup.js +2 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +7 -4
- package/lib/component/header/Header.js +2 -2
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +2 -1
- package/lib/component/hooks/useExport.js +2 -2
- package/lib/component/hooks/useFormatNumberByNucleus.js +3 -4
- package/lib/component/loader/DropZone.js +8 -2
- package/lib/component/loader/NoData.d.ts +3 -2
- package/lib/component/loader/NoData.js +31 -30
- package/lib/component/modal/MoleculeStructureEditorModal.js +2 -2
- package/lib/component/modal/editRange/EditRangeModal.d.ts +3 -3
- package/lib/component/modal/editRange/EditRangeModal.js +49 -54
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +9 -22
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +12 -50
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.d.ts +2 -0
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +34 -0
- package/lib/component/modal/editRange/forms/components/SignalFormTab.d.ts +1 -1
- package/lib/component/modal/editRange/forms/components/SignalFormTab.js +11 -14
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +18 -29
- package/lib/component/modal/editZone/SignalsForm.js +1 -1
- package/lib/component/modal/setting/DatabasesTabContent.d.ts +2 -1
- package/lib/component/modal/setting/DatabasesTabContent.js +28 -30
- package/lib/component/modal/setting/settingsValidation.d.ts +150 -42
- package/lib/component/modal/setting/settingsValidation.js +6 -4
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +13 -15
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +8 -15
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib/component/panels/Panels.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +12 -3
- package/lib/component/panels/RangesPanel/RangesPanel.js +19 -19
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +4 -4
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +48 -30
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -3
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +3 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -8
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +6 -8
- package/lib/component/panels/SummaryPanel/utilities/{IsInView.d.ts → useInView.d.ts} +2 -2
- package/lib/component/panels/SummaryPanel/utilities/{IsInView.js → useInView.js} +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +13 -13
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +4 -0
- package/lib/component/panels/databasePanel/DatabasePanel.js +80 -26
- package/lib/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.d.ts +7 -0
- package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.js +8 -0
- package/lib/component/panels/databasePanel/DatabaseTable.js +14 -9
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +2 -4
- package/lib/component/panels/header/DefaultPanelHeader.js +1 -3
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib/component/reducer/Reducer.d.ts +8 -66
- package/lib/component/reducer/Reducer.js +13 -8
- package/lib/component/reducer/actions/DatabaseActions.d.ts +3 -2
- package/lib/component/reducer/actions/DatabaseActions.js +21 -3
- package/lib/component/reducer/actions/DomainActions.js +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts +2 -1
- package/lib/component/reducer/actions/FiltersActions.js +25 -4
- package/lib/component/reducer/actions/PreferencesActions.js +32 -20
- package/lib/component/reducer/actions/RangesActions.d.ts +2 -2
- package/lib/component/reducer/actions/RangesActions.js +45 -11
- package/lib/component/reducer/actions/SpectrumsActions.js +6 -9
- package/lib/component/reducer/actions/ToolsActions.js +66 -53
- package/lib/component/reducer/helper/getSpectrum.d.ts +5 -0
- package/lib/component/reducer/helper/getSpectrum.js +14 -0
- package/lib/component/reducer/preferences/actions/initPreferences.js +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +4 -4
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +23 -10
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib/component/reducer/types/Types.d.ts +3 -1
- package/lib/component/reducer/types/Types.js +3 -1
- package/lib/component/tool/BrushX.js +1 -1
- package/lib/component/tool/BrushXY.js +1 -1
- package/lib/component/tool/CrossLinePointer.js +1 -1
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +4 -3
- package/lib/component/toolbar/BasicToolBar.js +0 -1
- package/lib/component/toolbar/FunctionToolBar.js +9 -13
- package/lib/component/toolbar/ToolTypes.d.ts +1 -1
- package/lib/component/toolbar/ToolTypes.js +3 -3
- package/lib/component/utility/Export.d.ts +7 -1
- package/lib/component/utility/Export.js +3 -3
- package/lib/component/utility/formatNumber.d.ts +1 -1
- package/lib/component/utility/formatNumber.js +4 -2
- package/lib/component/utility/isGoogleDocument.d.ts +1 -0
- package/lib/component/utility/isGoogleDocument.js +3 -0
- package/lib/component/utility/nmredataToNmrium.js +1 -2
- package/lib/component/utility/nmriumToNmredata.d.ts +2 -2
- package/lib/component/utility/nmriumToNmredata.js +2 -2
- package/lib/component/utility/util/nmredata/addSource.js +2 -2
- package/lib/component/workspaces/Workspace.d.ts +9 -4
- package/lib/component/workspaces/basic.js +15 -8
- package/lib/component/workspaces/exercise.js +2 -2
- package/lib/component/workspaces/process1D.js +1 -1
- package/lib/data/FiltersManager.js +1 -1
- package/lib/data/PredictionManager.js +7 -9
- package/lib/data/SpectraManager.d.ts +4 -12
- package/lib/data/SpectraManager.js +14 -23
- package/lib/data/data1d/Data1DManager.js +8 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +8 -10
- package/lib/data/data1d/Spectrum1D/getReferenceShift.js +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +5 -7
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +36 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +38 -15
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +1 -1
- package/lib/data/data1d/database.d.ts +5 -3
- package/lib/data/data1d/database.js +54 -4
- package/lib/data/data1d/filter1d/lineBroadening.js +1 -1
- package/lib/data/data2d/Processing2D.js +1 -1
- package/lib/data/molecules/Molecule.d.ts +4 -5
- package/lib/data/molecules/Molecule.js +3 -1
- package/lib/data/utilities/FindUtilities.js +1 -3
- package/lib/data/utilities/RangeUtilities.js +5 -6
- package/lib/data/utilities/ZoneUtilities.js +1 -1
- package/lib/data/utilities/getSum.js +1 -3
- package/lib/data/utilities/isMolFileEmpty.d.ts +1 -0
- package/lib/data/utilities/isMolFileEmpty.js +6 -0
- package/lib/types/NMRiumDataReturn.d.ts +15 -0
- package/lib/types/NMRiumDataReturn.js +1 -0
- package/lib/types/NMRiumGeneralPreferences.d.ts +10 -0
- package/lib/types/NMRiumGeneralPreferences.js +1 -0
- package/lib/types/NMRiumPanelPreferences.d.ts +16 -0
- package/lib/types/NMRiumPanelPreferences.js +1 -0
- package/lib/types/NMRiumToolBarPreferences.d.ts +20 -0
- package/lib/types/NMRiumToolBarPreferences.js +1 -0
- package/lib/types/Preferences.d.ts +5 -0
- package/lib/types/Preferences.js +1 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -1
- package/lib-cjs/component/1d/IntegralsSeries.js +2 -6
- package/lib-cjs/component/1d/PeakAnnotation.js +2 -2
- package/lib-cjs/component/1d/PeakAnnotations.js +2 -4
- package/lib-cjs/component/1d/SpectraTracker.js +2 -2
- package/lib-cjs/component/1d/Viewer1D.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +30 -25
- package/lib-cjs/component/1d/ranges/Range.js +3 -4
- package/lib-cjs/component/1d/ranges/Ranges.js +3 -4
- package/lib-cjs/component/1d/tool/BaseLineZones.js +3 -6
- package/lib-cjs/component/1d/tool/VerticalIndicator.js +1 -1
- package/lib-cjs/component/2d/Contours.js +1 -5
- package/lib-cjs/component/2d/SignalDeltaLine.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +1 -1
- package/lib-cjs/component/2d/YAxis.js +1 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +2 -3
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +59 -41
- package/lib-cjs/component/NMRium.js +13 -5
- package/lib-cjs/component/SplitPaneWrapper.js +2 -2
- package/lib-cjs/component/elements/Button.js +1 -1
- package/lib-cjs/component/elements/Logo.js +1 -1
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -0
- package/lib-cjs/component/elements/Tab/Tabs.js +2 -1
- package/lib-cjs/component/elements/ToggleButton.js +2 -2
- package/lib-cjs/component/elements/accordion/Accordion.js +2 -6
- package/lib-cjs/component/elements/formik/Input.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/Modal.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/ModalContent.js +1 -1
- package/lib-cjs/component/elements/toggle/ToggleButtonGroup.js +2 -2
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
- package/lib-cjs/component/header/Header.js +2 -2
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +2 -1
- package/lib-cjs/component/hooks/useExport.js +2 -2
- package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +2 -3
- package/lib-cjs/component/loader/DropZone.js +8 -2
- package/lib-cjs/component/loader/NoData.js +31 -30
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +2 -2
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +47 -52
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +9 -22
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +12 -50
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +38 -0
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormTab.js +13 -16
- package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +18 -29
- package/lib-cjs/component/modal/editZone/SignalsForm.js +1 -1
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +31 -33
- package/lib-cjs/component/modal/setting/settingsValidation.js +6 -4
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +12 -14
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +8 -15
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +1 -1
- package/lib-cjs/component/panels/Panels.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +10 -1
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +18 -18
- package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +47 -29
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +3 -3
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +6 -8
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +6 -8
- package/lib-cjs/component/panels/SummaryPanel/utilities/{IsInView.js → useInView.js} +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +12 -12
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +78 -24
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabaseStructureSearchModal.js +15 -0
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +14 -9
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +2 -4
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -3
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib-cjs/component/reducer/Reducer.js +13 -8
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +22 -3
- package/lib-cjs/component/reducer/actions/DomainActions.js +1 -1
- package/lib-cjs/component/reducer/actions/FiltersActions.js +26 -4
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +30 -18
- package/lib-cjs/component/reducer/actions/RangesActions.js +46 -12
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +4 -7
- package/lib-cjs/component/reducer/actions/ToolsActions.js +63 -73
- package/lib-cjs/component/reducer/helper/getSpectrum.js +18 -0
- package/lib-cjs/component/reducer/preferences/actions/initPreferences.js +1 -1
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +4 -4
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib-cjs/component/reducer/types/Types.js +5 -3
- package/lib-cjs/component/tool/BrushX.js +1 -1
- package/lib-cjs/component/tool/BrushXY.js +1 -1
- package/lib-cjs/component/tool/CrossLinePointer.js +1 -1
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +3 -2
- package/lib-cjs/component/toolbar/BasicToolBar.js +0 -1
- package/lib-cjs/component/toolbar/FunctionToolBar.js +9 -13
- package/lib-cjs/component/toolbar/ToolTypes.js +3 -3
- package/lib-cjs/component/utility/Export.js +4 -3
- package/lib-cjs/component/utility/formatNumber.js +3 -1
- package/lib-cjs/component/utility/isGoogleDocument.js +7 -0
- package/lib-cjs/component/utility/nmredataToNmrium.js +1 -2
- package/lib-cjs/component/utility/util/nmredata/addSource.js +2 -2
- package/lib-cjs/component/workspaces/basic.js +15 -8
- package/lib-cjs/component/workspaces/exercise.js +2 -2
- package/lib-cjs/component/workspaces/process1D.js +1 -1
- package/lib-cjs/data/FiltersManager.js +1 -1
- package/lib-cjs/data/PredictionManager.js +7 -9
- package/lib-cjs/data/SpectraManager.js +14 -23
- package/lib-cjs/data/data1d/Data1DManager.js +8 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +8 -10
- package/lib-cjs/data/data1d/Spectrum1D/getReferenceShift.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +5 -7
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +40 -16
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +1 -1
- package/lib-cjs/data/data1d/database.js +55 -5
- package/lib-cjs/data/data1d/filter1d/lineBroadening.js +1 -1
- package/lib-cjs/data/data2d/Processing2D.js +1 -1
- package/lib-cjs/data/molecules/Molecule.js +3 -1
- package/lib-cjs/data/utilities/FindUtilities.js +1 -3
- package/lib-cjs/data/utilities/RangeUtilities.js +8 -6
- package/lib-cjs/data/utilities/ZoneUtilities.js +1 -1
- package/lib-cjs/data/utilities/getSum.js +1 -3
- package/lib-cjs/data/utilities/isMolFileEmpty.js +10 -0
- package/lib-cjs/types/NMRiumDataReturn.js +2 -0
- package/lib-cjs/types/NMRiumGeneralPreferences.js +2 -0
- package/lib-cjs/types/NMRiumPanelPreferences.js +2 -0
- package/lib-cjs/types/NMRiumToolBarPreferences.js +2 -0
- package/lib-cjs/types/Preferences.js +2 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +31 -31
- package/lib/component/1d/multiplicityTree/TempMultiplicityTree.d.ts +0 -2
- package/lib/component/1d/multiplicityTree/TempMultiplicityTree.js +0 -14
- package/lib/component/panels/databasePanel/useDatabases.d.ts +0 -5
- package/lib/component/panels/databasePanel/useDatabases.js +0 -10
- package/lib-cjs/component/1d/multiplicityTree/TempMultiplicityTree.js +0 -20
- package/lib-cjs/component/panels/databasePanel/useDatabases.js +0 -14
|
@@ -10,6 +10,22 @@ const nucleusToString_1 = __importDefault(require("../../utility/nucleusToString
|
|
|
10
10
|
const Constants_1 = require("../core/Constants");
|
|
11
11
|
const DomainActions_1 = require("./DomainActions");
|
|
12
12
|
function changeSpectrumVerticalAlignment(draft, options) {
|
|
13
|
+
function stack(spectra = []) {
|
|
14
|
+
if (spectra.length > 1) {
|
|
15
|
+
draft.verticalAlign.align = 'stack';
|
|
16
|
+
const visibleSpectra = spectra.filter((datum) => datum.display.isVisible);
|
|
17
|
+
draft.verticalAlign.verticalShift = Math.abs(Math.floor((draft.height - draft.margin.bottom) / (visibleSpectra.length + 2)));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function center() {
|
|
21
|
+
const YAxisShift = draft.height / 2;
|
|
22
|
+
draft.verticalAlign.align = 'center';
|
|
23
|
+
draft.verticalAlign.verticalShift = YAxisShift;
|
|
24
|
+
}
|
|
25
|
+
function bottom() {
|
|
26
|
+
draft.verticalAlign.align = 'bottom';
|
|
27
|
+
draft.verticalAlign.verticalShift = Constants_1.DEFAULT_YAXIS_SHIFT_VALUE;
|
|
28
|
+
}
|
|
13
29
|
if (draft.data && draft.data.length > 0) {
|
|
14
30
|
let dataPerNucleus = [];
|
|
15
31
|
if (['auto-check', 'stack'].includes(options.align || '')) {
|
|
@@ -18,31 +34,27 @@ function changeSpectrumVerticalAlignment(draft, options) {
|
|
|
18
34
|
: draft.activeTab && datum.info.dimension === 1);
|
|
19
35
|
}
|
|
20
36
|
switch (options.align) {
|
|
21
|
-
case 'auto-check':
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (
|
|
25
|
-
(
|
|
26
|
-
dataPerNucleus[0]?.info.isFid &&
|
|
27
|
-
!dataPerNucleus.some((d) => d.info.isFid === false))) {
|
|
28
|
-
const YAxisShift = draft.height / 2;
|
|
29
|
-
draft.verticalAlign.align = 'center';
|
|
30
|
-
draft.verticalAlign.verticalShift = YAxisShift;
|
|
37
|
+
case 'auto-check': {
|
|
38
|
+
const isFid = dataPerNucleus[0]?.info.isFid &&
|
|
39
|
+
!dataPerNucleus.some((d) => !d.info.isFid);
|
|
40
|
+
if (isFid) {
|
|
41
|
+
center();
|
|
31
42
|
}
|
|
32
|
-
else {
|
|
33
|
-
|
|
34
|
-
draft.verticalAlign.verticalShift = Constants_1.DEFAULT_YAXIS_SHIFT_VALUE;
|
|
43
|
+
else if (dataPerNucleus.length > 1) {
|
|
44
|
+
stack(dataPerNucleus);
|
|
35
45
|
}
|
|
36
46
|
break;
|
|
37
47
|
}
|
|
48
|
+
case 'bottom': {
|
|
49
|
+
return bottom();
|
|
50
|
+
}
|
|
51
|
+
case 'center': {
|
|
52
|
+
return center();
|
|
53
|
+
}
|
|
38
54
|
case 'stack': {
|
|
39
|
-
|
|
40
|
-
const visibleSpectra = dataPerNucleus.filter((datum) => datum.display.isVisible === true);
|
|
41
|
-
draft.verticalAlign.verticalShift = Math.abs(Math.floor((draft.height - draft.margin.bottom) / (visibleSpectra.length + 2)));
|
|
42
|
-
break;
|
|
55
|
+
return stack(dataPerNucleus);
|
|
43
56
|
}
|
|
44
57
|
default:
|
|
45
|
-
return;
|
|
46
58
|
}
|
|
47
59
|
}
|
|
48
60
|
}
|
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.handleShowJGraph = exports.handleAutoSpectraRangesDetection = exports.handleShowRangesIntegrals = exports.handleShowMultiplicityTrees = exports.
|
|
29
|
+
exports.handleShowJGraph = exports.handleAutoSpectraRangesDetection = exports.handleShowRangesIntegrals = exports.handleShowMultiplicityTrees = exports.handleUpdateRange = exports.handleChangeRangesSumFlag = exports.handleSetDiaIDRange = exports.handleUnlinkRange = exports.handleSaveEditedRange = exports.handleChangeRangeSignalKind = exports.handleChangeRangeSignalValue = exports.handleChangeRangeRelativeValue = exports.handleResizeRange = exports.handleAddRange = exports.handleChangeRangeSum = exports.handleDeleteSignal = exports.handleDeleteRange = exports.handleAutoRangesDetection = void 0;
|
|
30
30
|
const immer_1 = require("immer");
|
|
31
31
|
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
32
32
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
@@ -36,9 +36,11 @@ const SignalsKinds_1 = require("../../../data/constants/SignalsKinds");
|
|
|
36
36
|
const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
|
|
37
37
|
const SumManager_1 = require("../../../data/data1d/Spectrum1D/SumManager");
|
|
38
38
|
const RangeUtilities_1 = require("../../../data/utilities/RangeUtilities");
|
|
39
|
+
const generateID_1 = __importDefault(require("../../../data/utilities/generateID"));
|
|
39
40
|
const getRange_1 = __importDefault(require("../helper/getRange"));
|
|
40
41
|
const CorrelationsActions_1 = require("./CorrelationsActions");
|
|
41
42
|
const DomainActions_1 = require("./DomainActions");
|
|
43
|
+
const ToolsActions_1 = require("./ToolsActions");
|
|
42
44
|
function handleAutoRangesDetection(draft, options) {
|
|
43
45
|
const { activeSpectrum, data, xDomain, molecules, activeTab: nucleus, } = draft;
|
|
44
46
|
if (activeSpectrum?.id) {
|
|
@@ -93,7 +95,8 @@ function getRangeIndex(draft, spectrumIndex, rangeID) {
|
|
|
93
95
|
function handleDeleteRange(draft, action) {
|
|
94
96
|
if (draft.activeSpectrum?.id) {
|
|
95
97
|
const { index } = draft.activeSpectrum;
|
|
96
|
-
const {
|
|
98
|
+
const { data, resetSelectTool = false } = action.payload;
|
|
99
|
+
const { id = null, assignmentData } = data;
|
|
97
100
|
const datum = draft.data[index];
|
|
98
101
|
if (id) {
|
|
99
102
|
const rangeIndex = getRangeIndex(draft, index, id);
|
|
@@ -106,6 +109,9 @@ function handleDeleteRange(draft, action) {
|
|
|
106
109
|
}
|
|
107
110
|
(0, Spectrum1D_1.updateRangesRelativeValues)(datum);
|
|
108
111
|
handleOnChangeRangesData(draft);
|
|
112
|
+
if (resetSelectTool) {
|
|
113
|
+
(0, ToolsActions_1.resetSelectedTool)(draft);
|
|
114
|
+
}
|
|
109
115
|
}
|
|
110
116
|
}
|
|
111
117
|
exports.handleDeleteRange = handleDeleteRange;
|
|
@@ -132,8 +138,6 @@ function handleSaveEditedRange(draft, action) {
|
|
|
132
138
|
if (state.activeSpectrum?.id) {
|
|
133
139
|
const { index } = state.activeSpectrum;
|
|
134
140
|
const { editedRowData, assignmentData } = action.payload;
|
|
135
|
-
// reset temp range
|
|
136
|
-
draft.toolOptions.data.tempRange = null;
|
|
137
141
|
// remove assignments in global state
|
|
138
142
|
const _editedRowData = (0, RangeUtilities_1.unlink)(editedRowData);
|
|
139
143
|
delete _editedRowData.tableMetaInfo;
|
|
@@ -142,9 +146,13 @@ function handleSaveEditedRange(draft, action) {
|
|
|
142
146
|
// for now: clear all assignments for this range because signals or levels to store might have changed
|
|
143
147
|
(0, RangeUtilities_1.unlinkInAssignmentData)(assignmentData, [_editedRowData]);
|
|
144
148
|
const rangeIndex = getRangeIndex(state, index, _editedRowData.id);
|
|
145
|
-
|
|
149
|
+
if (_editedRowData.id === 'new') {
|
|
150
|
+
_editedRowData.id = (0, generateID_1.default)();
|
|
151
|
+
}
|
|
152
|
+
draft.data[index].ranges.values.splice(rangeIndex, 1, _editedRowData);
|
|
146
153
|
(0, Spectrum1D_1.updateRangesRelativeValues)(draft.data[index]);
|
|
147
154
|
handleOnChangeRangesData(draft);
|
|
155
|
+
(0, ToolsActions_1.resetSelectedTool)(draft);
|
|
148
156
|
}
|
|
149
157
|
}
|
|
150
158
|
exports.handleSaveEditedRange = handleSaveEditedRange;
|
|
@@ -241,18 +249,36 @@ function handleChangeRangeSum(draft, options) {
|
|
|
241
249
|
}
|
|
242
250
|
}
|
|
243
251
|
exports.handleChangeRangeSum = handleChangeRangeSum;
|
|
244
|
-
function
|
|
245
|
-
const { startX, endX } =
|
|
246
|
-
const { activeSpectrum, activeTab: nucleus, molecules } = draft;
|
|
252
|
+
function addNewRange(draft, props) {
|
|
253
|
+
const { startX, endX, id } = props;
|
|
247
254
|
const range = (0, getRange_1.default)(draft, { startX, endX });
|
|
255
|
+
const { activeSpectrum, activeTab: nucleus, molecules } = draft;
|
|
248
256
|
if (activeSpectrum?.id) {
|
|
249
257
|
const { index } = activeSpectrum;
|
|
250
258
|
const [from, to] = range;
|
|
251
|
-
(0, Spectrum1D_1.addRange)(draft.data[index], {
|
|
259
|
+
(0, Spectrum1D_1.addRange)(draft.data[index], {
|
|
260
|
+
from,
|
|
261
|
+
to,
|
|
262
|
+
id,
|
|
263
|
+
nucleus,
|
|
264
|
+
molecules,
|
|
265
|
+
});
|
|
252
266
|
handleOnChangeRangesData(draft);
|
|
253
267
|
(0, DomainActions_1.setIntegralsYDomain)(draft, draft.data[index]);
|
|
254
268
|
}
|
|
255
269
|
}
|
|
270
|
+
function handleAddRange(draft, action) {
|
|
271
|
+
const { startX, endX, id } = action.payload;
|
|
272
|
+
if (id === 'new') {
|
|
273
|
+
const { width } = draft;
|
|
274
|
+
const startX = width / 3;
|
|
275
|
+
const endX = startX + 10;
|
|
276
|
+
addNewRange(draft, { startX, endX, id: 'new' });
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
addNewRange(draft, { startX, endX });
|
|
280
|
+
}
|
|
281
|
+
}
|
|
256
282
|
exports.handleAddRange = handleAddRange;
|
|
257
283
|
function handleChangeRangeRelativeValue(draft, action) {
|
|
258
284
|
const data = action.payload.data;
|
|
@@ -291,10 +317,18 @@ function handleChangeRangesSumFlag(draft, action) {
|
|
|
291
317
|
}
|
|
292
318
|
}
|
|
293
319
|
exports.handleChangeRangesSumFlag = handleChangeRangesSumFlag;
|
|
294
|
-
function
|
|
295
|
-
|
|
320
|
+
function handleUpdateRange(draft, action) {
|
|
321
|
+
const { range, resetSelectTool = false } = action.payload;
|
|
322
|
+
if (draft.activeSpectrum?.id && range.id) {
|
|
323
|
+
const datum = draft.data[draft.activeSpectrum?.index];
|
|
324
|
+
const index = datum.ranges.values.findIndex((_range) => _range.id === range.id);
|
|
325
|
+
datum.ranges.values[index] = range;
|
|
326
|
+
}
|
|
327
|
+
if (resetSelectTool) {
|
|
328
|
+
(0, ToolsActions_1.resetSelectedTool)(draft);
|
|
329
|
+
}
|
|
296
330
|
}
|
|
297
|
-
exports.
|
|
331
|
+
exports.handleUpdateRange = handleUpdateRange;
|
|
298
332
|
function handleShowMultiplicityTrees(draft) {
|
|
299
333
|
draft.toolOptions.data.showMultiplicityTrees =
|
|
300
334
|
!draft.toolOptions.data.showMultiplicityTrees;
|
|
@@ -39,8 +39,7 @@ const DomainActions_1 = require("./DomainActions");
|
|
|
39
39
|
const FiltersActions_1 = require("./FiltersActions");
|
|
40
40
|
const ToolsActions_1 = require("./ToolsActions");
|
|
41
41
|
function checkIsVisible2D(datum) {
|
|
42
|
-
if (datum.display.isPositiveVisible
|
|
43
|
-
datum.display.isNegativeVisible === false) {
|
|
42
|
+
if (!datum.display.isPositiveVisible && !datum.display.isNegativeVisible) {
|
|
44
43
|
return false;
|
|
45
44
|
}
|
|
46
45
|
return true;
|
|
@@ -106,10 +105,8 @@ function handleChangeActiveSpectrum(draft, activeSpectrum) {
|
|
|
106
105
|
newActiveSpectrum.display.isVisible = true;
|
|
107
106
|
if (oldIndex !== -1) {
|
|
108
107
|
refreshDomain =
|
|
109
|
-
draft.data[oldIndex].info.isFid
|
|
110
|
-
newActiveSpectrum.info.isFid
|
|
111
|
-
? false
|
|
112
|
-
: true;
|
|
108
|
+
draft.data[oldIndex].info.isFid !==
|
|
109
|
+
newActiveSpectrum.info.isFid;
|
|
113
110
|
}
|
|
114
111
|
else {
|
|
115
112
|
refreshDomain = newActiveSpectrum.info.isFid || false;
|
|
@@ -132,7 +129,7 @@ function handleChangeActiveSpectrum(draft, activeSpectrum) {
|
|
|
132
129
|
}
|
|
133
130
|
if (ToolTypes_1.options[draft.toolOptions.selectedTool].isFilter) {
|
|
134
131
|
draft.toolOptions.selectedTool = ToolTypes_1.options.zoom.id;
|
|
135
|
-
draft.toolOptions.data.
|
|
132
|
+
draft.toolOptions.data.baselineCorrection = { zones: [], options: {} };
|
|
136
133
|
draft.toolOptions.selectedOptionPanel = null;
|
|
137
134
|
draft.tempData = null;
|
|
138
135
|
}
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
@@ -30,14 +7,12 @@ exports.resetSpectraScale = exports.setSpectraSameTopHandler = exports.setTab =
|
|
|
30
7
|
const d3_1 = require("d3");
|
|
31
8
|
const immer_1 = require("immer");
|
|
32
9
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
33
|
-
const Filters = __importStar(require("../../../data/Filters"));
|
|
34
10
|
const generateID_1 = __importDefault(require("../../../data/utilities/generateID"));
|
|
35
11
|
const scale_1 = require("../../1d/utilities/scale");
|
|
36
12
|
const DimensionLayout_1 = require("../../2d/utilities/DimensionLayout");
|
|
37
13
|
const scale_2 = require("../../2d/utilities/scale");
|
|
38
14
|
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
39
15
|
const GroupByInfoKey_1 = __importDefault(require("../../utility/GroupByInfoKey"));
|
|
40
|
-
const getSpectraByNucleus_1 = require("../../utility/getSpectraByNucleus");
|
|
41
16
|
const Constants_1 = require("../core/Constants");
|
|
42
17
|
const Zoom1DManager_1 = require("../helper/Zoom1DManager");
|
|
43
18
|
const ZoomHistoryManager_1 = __importDefault(require("../helper/ZoomHistoryManager"));
|
|
@@ -53,47 +28,66 @@ function getStrongestPeak(draft) {
|
|
|
53
28
|
return {
|
|
54
29
|
xValue: activeData.x[index],
|
|
55
30
|
yValue: strongestPeakValue,
|
|
56
|
-
index
|
|
31
|
+
index,
|
|
57
32
|
};
|
|
58
33
|
}
|
|
59
34
|
}
|
|
60
|
-
function
|
|
35
|
+
function checkFilterHasTempData(selectedToolId) {
|
|
36
|
+
return [ToolTypes_1.options.phaseCorrection.id, ToolTypes_1.options.baselineCorrection.id].includes(selectedToolId);
|
|
37
|
+
}
|
|
38
|
+
function setFilterChanges(draft, selectedFilterID) {
|
|
61
39
|
const activeSpectrumId = draft.activeSpectrum?.id;
|
|
62
|
-
//
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const
|
|
40
|
+
// If the user selects the filter from the filters list or selects its tool and has a record in the filter list for preview and edit
|
|
41
|
+
if (checkFilterHasTempData(selectedFilterID)) {
|
|
42
|
+
//return back the spectra data to point of time before applying a specific filter
|
|
43
|
+
const dataSavePoint = (0, FiltersActions_1.resetSpectrumByFilter)(draft, selectedFilterID, {
|
|
44
|
+
updateDomain: false,
|
|
66
45
|
rollback: true,
|
|
67
46
|
searchBy: 'name',
|
|
68
47
|
returnCurrentDatum: true,
|
|
69
48
|
});
|
|
49
|
+
// create a temporary clone of the data
|
|
70
50
|
draft.tempData = (0, immer_1.current)(draft).data;
|
|
71
|
-
if (
|
|
72
|
-
draft.tempData[
|
|
73
|
-
datumAfterPhaseCorrection?.datum;
|
|
51
|
+
if (dataSavePoint) {
|
|
52
|
+
draft.tempData[dataSavePoint?.index] = dataSavePoint?.datum;
|
|
74
53
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
54
|
+
switch (selectedFilterID) {
|
|
55
|
+
case ToolTypes_1.options.phaseCorrection.id: {
|
|
56
|
+
// look for the strongest peak to set it as a pivot
|
|
57
|
+
const { xValue, index } = getStrongestPeak(draft) || {
|
|
58
|
+
xValue: 0,
|
|
59
|
+
index: 0,
|
|
60
|
+
};
|
|
61
|
+
draft.toolOptions.data.pivot = { value: xValue, index };
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
case ToolTypes_1.options.baselineCorrection.id: {
|
|
65
|
+
if (draft.activeSpectrum?.id) {
|
|
66
|
+
const baselineCorrectionFilter = (0, immer_1.current)(draft).data[draft.activeSpectrum.index].filters.find((filter) => filter.name === ToolTypes_1.options.baselineCorrection.id);
|
|
67
|
+
draft.toolOptions.data.baselineCorrection.zones =
|
|
68
|
+
baselineCorrectionFilter
|
|
69
|
+
? baselineCorrectionFilter.value.zones
|
|
70
|
+
: [];
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
default:
|
|
75
|
+
break;
|
|
86
76
|
}
|
|
87
77
|
}
|
|
78
|
+
else if (checkFilterHasTempData(draft.toolOptions.selectedTool)) {
|
|
79
|
+
draft.toolOptions.data.activeFilterID = null;
|
|
80
|
+
const spectrumIndex = draft.data.findIndex((spectrum) => spectrum.id === activeSpectrumId);
|
|
81
|
+
draft.data[spectrumIndex].data = draft.tempData[spectrumIndex].data;
|
|
82
|
+
}
|
|
88
83
|
}
|
|
89
84
|
function resetTool(draft, setDefaultTool = true) {
|
|
90
85
|
// reset temp range
|
|
91
|
-
draft.toolOptions.data.tempRange = null;
|
|
92
86
|
setSelectedOptionPanel(draft, null);
|
|
93
87
|
if (setDefaultTool) {
|
|
94
88
|
draft.toolOptions.selectedTool = ToolTypes_1.options.zoom.id;
|
|
95
89
|
}
|
|
96
|
-
draft.toolOptions.data.
|
|
90
|
+
draft.toolOptions.data.baselineCorrection = { zones: [], options: [] };
|
|
97
91
|
if (draft.toolOptions.data.activeFilterID) {
|
|
98
92
|
(0, FiltersActions_1.resetSpectrumByFilter)(draft);
|
|
99
93
|
}
|
|
@@ -116,10 +110,7 @@ function setSelectedTool(draft, action) {
|
|
|
116
110
|
if (selectedTool) {
|
|
117
111
|
// start Range edit mode
|
|
118
112
|
if (selectedTool === ToolTypes_1.options.editRange.id) {
|
|
119
|
-
draft.toolOptions.data.
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
draft.toolOptions.data.tempRange = null;
|
|
113
|
+
draft.toolOptions.data.showMultiplicityTrees = true;
|
|
123
114
|
}
|
|
124
115
|
if (selectedTool !== draft.toolOptions.selectedTool) {
|
|
125
116
|
resetTool(draft, false);
|
|
@@ -166,19 +157,21 @@ function handleAddBaseLineZone(draft, { from, to }) {
|
|
|
166
157
|
else {
|
|
167
158
|
zone = [start, end];
|
|
168
159
|
}
|
|
169
|
-
const zones = draft.toolOptions.data.
|
|
160
|
+
const zones = draft.toolOptions.data.baselineCorrection.zones;
|
|
170
161
|
zones.push({
|
|
171
162
|
id: (0, generateID_1.default)(),
|
|
172
163
|
from: zone[0],
|
|
173
164
|
to: zone[1],
|
|
174
165
|
});
|
|
175
|
-
draft.toolOptions.data.
|
|
166
|
+
draft.toolOptions.data.baselineCorrection.zones = zones.slice();
|
|
167
|
+
(0, FiltersActions_1.calculateBaseLineCorrection)(draft);
|
|
176
168
|
}
|
|
177
169
|
exports.handleAddBaseLineZone = handleAddBaseLineZone;
|
|
178
170
|
function handleDeleteBaseLineZone(draft, id) {
|
|
179
171
|
const state = (0, immer_1.original)(draft);
|
|
180
|
-
draft.toolOptions.data.
|
|
181
|
-
state.toolOptions.data.
|
|
172
|
+
draft.toolOptions.data.baselineCorrection.zones =
|
|
173
|
+
state.toolOptions.data.baselineCorrection.zones.filter((zone) => zone.id !== id);
|
|
174
|
+
(0, FiltersActions_1.calculateBaseLineCorrection)(draft);
|
|
182
175
|
}
|
|
183
176
|
exports.handleDeleteBaseLineZone = handleDeleteBaseLineZone;
|
|
184
177
|
function handleToggleRealImaginaryVisibility(draft) {
|
|
@@ -255,24 +248,21 @@ function handleZoom(draft, action) {
|
|
|
255
248
|
}
|
|
256
249
|
}
|
|
257
250
|
}
|
|
258
|
-
else {
|
|
259
|
-
if (
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
draft.integralsYDomains[activeSpectrum?.id] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
const domain = draft.yDomains[activeSpectrum?.id];
|
|
267
|
-
draft.yDomains[activeSpectrum?.id] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
268
|
-
}
|
|
251
|
+
else if (activeSpectrum?.id) {
|
|
252
|
+
if ((showRangesIntegrals || selectedTool === ToolTypes_1.options.integral.id) &&
|
|
253
|
+
event.shiftKey) {
|
|
254
|
+
const domain = draft.integralsYDomains[activeSpectrum?.id];
|
|
255
|
+
draft.integralsYDomains[activeSpectrum?.id] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
269
256
|
}
|
|
270
257
|
else {
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
258
|
+
const domain = draft.yDomains[activeSpectrum?.id];
|
|
259
|
+
draft.yDomains[activeSpectrum?.id] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
for (const key of Object.keys(draft.yDomains)) {
|
|
264
|
+
const domain = draft.yDomains[key];
|
|
265
|
+
draft.yDomains[key] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
276
266
|
}
|
|
277
267
|
}
|
|
278
268
|
}
|
|
@@ -347,7 +337,7 @@ function setMargin(draft) {
|
|
|
347
337
|
draft.margin = Constants_1.MARGIN['1D'];
|
|
348
338
|
}
|
|
349
339
|
}
|
|
350
|
-
function
|
|
340
|
+
function processing2DData(draft, data) {
|
|
351
341
|
if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_2D) {
|
|
352
342
|
let _data = {};
|
|
353
343
|
for (const datum of data[draft.activeTab]) {
|
|
@@ -430,7 +420,7 @@ function setActiveTab(draft, options) {
|
|
|
430
420
|
const currentTab = !tab || !tabs.includes(tab || '') ? tabs[0] : tab;
|
|
431
421
|
setTab(draft, dataGroupByNucleus, currentTab, refreshActiveTab);
|
|
432
422
|
resetTool(draft);
|
|
433
|
-
|
|
423
|
+
processing2DData(draft, dataGroupByNucleus);
|
|
434
424
|
(0, DomainActions_1.setDomain)(draft, domainOptions);
|
|
435
425
|
(0, DomainActions_1.setIntegralsYDomain)(draft, dataGroupByNucleus[currentTab]);
|
|
436
426
|
const zoomHistory = (0, ZoomHistoryManager_1.default)(draft.zoom.history, draft.activeTab);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSpectrum = void 0;
|
|
4
|
+
function getSpectrum(state, value) {
|
|
5
|
+
if (value === undefined) {
|
|
6
|
+
if (state.activeSpectrum?.id) {
|
|
7
|
+
const index = state.activeSpectrum.index;
|
|
8
|
+
return state.data[index];
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
if (typeof value === 'number') {
|
|
12
|
+
return state.data[value] || undefined;
|
|
13
|
+
}
|
|
14
|
+
if (typeof value === 'string') {
|
|
15
|
+
return state.data.find((spectrum) => spectrum.id === value);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.getSpectrum = getSpectrum;
|
|
@@ -59,7 +59,7 @@ function initPreferences(draft, action) {
|
|
|
59
59
|
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(data));
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
62
|
-
|
|
62
|
+
draft.workspaces[draft.workspace.current] = (0, merge_1.default)({}, currentWorkspacePreferences, resProps);
|
|
63
63
|
}
|
|
64
64
|
draft.dispatch = dispatch;
|
|
65
65
|
}
|
|
@@ -51,12 +51,12 @@ const databaseDefaultValues = {
|
|
|
51
51
|
showSmiles: true,
|
|
52
52
|
showSolvent: false,
|
|
53
53
|
showNames: true,
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
range: { show: false, format: '0.00' },
|
|
55
|
+
delta: { show: true, format: '0.00' },
|
|
56
56
|
showAssignment: false,
|
|
57
|
-
|
|
57
|
+
coupling: { show: true, format: '0.0' },
|
|
58
58
|
showMultiplicity: true,
|
|
59
|
-
color: '
|
|
59
|
+
color: '#C0B000',
|
|
60
60
|
marginBottom: 30,
|
|
61
61
|
};
|
|
62
62
|
exports.databaseDefaultValues = databaseDefaultValues;
|
|
@@ -14,7 +14,7 @@ const resetPreferences_1 = require("./actions/resetPreferences");
|
|
|
14
14
|
const setPanelsPreferences_1 = require("./actions/setPanelsPreferences");
|
|
15
15
|
const setPreferences_1 = require("./actions/setPreferences");
|
|
16
16
|
const setWorkspace_1 = require("./actions/setWorkspace");
|
|
17
|
-
const LOCAL_STORAGE_VERSION =
|
|
17
|
+
const LOCAL_STORAGE_VERSION = 9;
|
|
18
18
|
exports.WORKSPACES = [
|
|
19
19
|
{
|
|
20
20
|
key: 'default',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.APPLY_FFT_FILTER = exports.APPLY_ZERO_FILLING_FILTER = exports.DELETE_SPECTRA_FILTER = exports.DELETE_FILTER = exports.ENABLE_FILTER = exports.RESET_DOMAIN = exports.BRUSH_END = exports.RESIZE_INTEGRAL = exports.CHANGE_SPECTRUM_DISPLAY_VIEW_MODE = exports.DELETE_SPECTRA = exports.SET_CORRELATIONS_TOLERANCE = exports.SET_CORRELATIONS_MF = exports.DELETE_CORRELATION = exports.SET_CORRELATIONS = exports.SET_CORRELATION = exports.CHANGE_MOLECULE_LABEL = exports.FLOAT_MOLECULE_OVER_SPECTRUM = exports.DELETE_MOLECULE = exports.SET_MOLECULE = exports.ADD_MOLECULE = exports.SET_ZOOM = exports.TOGGLE_REAL_IMAGINARY_VISIBILITY = exports.DELETE_INTEGRAL = exports.ADD_INTEGRAL = exports.CHANGE_SPECTRUM_COLOR = exports.CHANGE_ACTIVE_SPECTRUM = exports.CHANGE_PEAKS_MARKERS_VISIBILITY = exports.CHANGE_VISIBILITY = exports.FULL_ZOOM_OUT = exports.CHANGE_SPECTRUM_TYPE = exports.CHANGE_SPECTRUM_SETTING = exports.SET_SELECTED_FILTER = exports.SET_SELECTED_TOOL = exports.SET_DIMENSIONS = exports.SET_WIDTH = exports.SET_ORIGINAL_DOMAIN = exports.SET_Y_DOMAIN = exports.SET_X_DOMAIN = exports.SHIFT_SPECTRUM = exports.DELETE_PEAK_NOTATION = exports.ADD_PEAKS = exports.ADD_PEAK = exports.LOAD_JDF_FILE = exports.LOAD_ZIP_FILE = exports.LOAD_MOL_FILE = exports.LOAD_NMREDATA_FILE = exports.LOAD_JCAMP_FILE = exports.LOAD_JSON_FILE = exports.SAVE_DATA_AS_JSON = exports.INITIATE = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.SET_AUTOMATIC_ASSIGNMENTS = exports.SHOW_J_GRAPH = exports.RESURRECTING_SPECTRUM_FROM_RANGES = exports.GENERATE_SPECTRUM_FROM_PUBLICATION_STRING = exports.AUTO_ZONES_SPECTRA_PICKING = exports.AUTO_RANGES_SPECTRA_PICKING = exports.SHOW_RANGES_INTEGRALS = exports.SHOW_MULTIPLICTY_TREES = exports.
|
|
4
|
+
exports.SAVE_EDITED_ZONE = exports.CHANGE_ZONE_SIGNAL_KIND = exports.CHANGE_ZONE_SIGNAL_VALUE = exports.ALIGN_SPECTRA = exports.FILTER_SPECTRA_COLUMN = exports.SET_ANALYZE_SPECTRA_COLUMNS = exports.RESIZE_ANALYZE_SPECTRA_RANGE = exports.DELETE_ANALYZE_SPECTRA_RANGE = exports.ANALYZE_SPECTRA = exports.CHANGE_INTEGRAL_RELATIVE = exports.SET_DIAID_RANGE = exports.UNLINK_RANGE = exports.SAVE_EDITED_RANGE = exports.CHANGE_RANGE_SIGNAL_KIND = exports.CHANGE_RANGE_SIGNAL_VALUE = exports.CHANGE_RANGE_RELATIVE = exports.SET_FILTER_SNAPSHOT = exports.ADD_MISSING_PROJECTION = exports.SET_2D_SIGNAL_PATH_LENGTH = exports.DELETE_2D_SIGNAL = exports.DELETE_2D_ZONE = exports.ADD_2D_ZONE = exports.SET_2D_LEVEL = exports.ADD_RANGE = exports.CHANGE_RANGE_SUM = exports.RESIZE_RANGE = exports.APPLY_KEY_PREFERENCES = exports.SET_KEY_PREFERENCES = exports.APPLY_BASE_LINE_CORRECTION_FILTER = exports.DELETE_BASE_LINE_ZONE = exports.ADD_BASE_LINE_ZONE = exports.CHANGE_INTEGRAL_SUM = exports.SET_ACTIVE_TAB = exports.CHANGE_INTEGRAL_DATA = exports.SAVE_AS_SVG = exports.SET_SPECTRUMS_VERTICAL_ALIGN = exports.RESET_SELECTED_TOOL = exports.SET_LOADING_FLAG = exports.SET_SELECTED_OPTIONS_PANEL = exports.DELETE_1D_SIGNAL = exports.DELETE_RANGE = exports.AUTO_ZONES_DETECTION = exports.AUTO_RANGES_DETECTION = exports.AUTO_PEAK_PICKING = exports.SET_VERTICAL_INDICATOR_X_POSITION = exports.APPLY_ABSOLUTE_FILTER = exports.APPLY_AUTO_PHASE_CORRECTION_FILTER = exports.APPLY_MANUAL_PHASE_CORRECTION_FILTER = exports.CALCULATE_BASE_LINE_CORRECTION_FILTER = exports.CALCULATE_MANUAL_PHASE_CORRECTION_FILTER = void 0;
|
|
5
|
+
exports.SET_AUTOMATIC_ASSIGNMENTS = exports.SHOW_J_GRAPH = exports.RESURRECTING_SPECTRUM_FROM_JCAMP = exports.RESURRECTING_SPECTRUM_FROM_RANGES = exports.GENERATE_SPECTRUM_FROM_PUBLICATION_STRING = exports.AUTO_ZONES_SPECTRA_PICKING = exports.AUTO_RANGES_SPECTRA_PICKING = exports.SHOW_RANGES_INTEGRALS = exports.SHOW_MULTIPLICTY_TREES = exports.UPDATE_RANGE = exports.CHANGE_ZONES_NOISE_FACTOR = exports.CHANGE_INTEGRALS_SUM_FLAG = exports.CHANGE_RANGES_SUM_FLAG = exports.DELETE_EXCLUSION_ZONE = exports.ADD_EXCLUSION_ZONE = exports.APPLY_MULTIPLE_SPECTRA_FILTER = exports.SET_MOUSE_OVER_DISPLAYER = exports.RESET_SPECTRA_SCALE = exports.SET_SPECTRA_SAME_TOP = exports.PREDICT_SPECTRA = exports.SET_DIAID_ZONE = exports.UNLINK_ZONE = void 0;
|
|
6
6
|
exports.INITIATE = 'INITIATE';
|
|
7
7
|
exports.SAVE_DATA_AS_JSON = 'SAVE_DATA_AS_JSON';
|
|
8
8
|
exports.LOAD_JSON_FILE = 'LOAD_JSON_FILE';
|
|
@@ -54,6 +54,7 @@ exports.DELETE_SPECTRA_FILTER = 'DELETE_SPECTRA_FILTER';
|
|
|
54
54
|
exports.APPLY_ZERO_FILLING_FILTER = 'APPLY_ZERO_FILLING_FILTER';
|
|
55
55
|
exports.APPLY_FFT_FILTER = 'APPLY_FFT_FILTER';
|
|
56
56
|
exports.CALCULATE_MANUAL_PHASE_CORRECTION_FILTER = 'CALCULATE_MANUAL_PHASE_CORRECTION_FILTER';
|
|
57
|
+
exports.CALCULATE_BASE_LINE_CORRECTION_FILTER = 'CALCULATE_BASE_LINE_CORRECTION_FILTER';
|
|
57
58
|
exports.APPLY_MANUAL_PHASE_CORRECTION_FILTER = 'APPLY_MANUAL_PHASE_CORRECTION_FILTER';
|
|
58
59
|
exports.APPLY_AUTO_PHASE_CORRECTION_FILTER = 'APPLY_AUTO_PHASE_CORRECTION_FILTER';
|
|
59
60
|
exports.APPLY_ABSOLUTE_FILTER = 'APPLY_ABSOLUTE_FILTER';
|
|
@@ -114,12 +115,13 @@ exports.DELETE_EXCLUSION_ZONE = 'DELETE_EXCLUSION_ZONE';
|
|
|
114
115
|
exports.CHANGE_RANGES_SUM_FLAG = 'CHANGE_RANGES_SUM_FLAG';
|
|
115
116
|
exports.CHANGE_INTEGRALS_SUM_FLAG = 'CHANGE_INTEGRALS_SUM_FLAG';
|
|
116
117
|
exports.CHANGE_ZONES_NOISE_FACTOR = 'CHANGE_ZONES_NOISE_FACTOR';
|
|
117
|
-
exports.
|
|
118
|
+
exports.UPDATE_RANGE = 'UPDATE_RANGE';
|
|
118
119
|
exports.SHOW_MULTIPLICTY_TREES = 'SHOW_MULTIPLICTY_TREES';
|
|
119
120
|
exports.SHOW_RANGES_INTEGRALS = 'SHOW_RANGES_INTEGRALS';
|
|
120
121
|
exports.AUTO_RANGES_SPECTRA_PICKING = 'AUTO_RANGES_SPECTRA_PICKING';
|
|
121
122
|
exports.AUTO_ZONES_SPECTRA_PICKING = 'AUTO_ZONES_SPECTRA_PICKING';
|
|
122
123
|
exports.GENERATE_SPECTRUM_FROM_PUBLICATION_STRING = 'GENERATE_SPECTRUM_FROM_PUBLICATION_STRING';
|
|
123
124
|
exports.RESURRECTING_SPECTRUM_FROM_RANGES = 'RESURRECTING_SPECTRUM_FROM_RANGES';
|
|
125
|
+
exports.RESURRECTING_SPECTRUM_FROM_JCAMP = 'RESURRECTING_SPECTRUM_FROM_JCAMP';
|
|
124
126
|
exports.SHOW_J_GRAPH = 'SHOW_J_GRAPH';
|
|
125
127
|
exports.SET_AUTOMATIC_ASSIGNMENTS = 'SET_AUTOMATIC_ASSIGNMENTS';
|
|
@@ -19,7 +19,7 @@ const allowTools = [
|
|
|
19
19
|
ToolTypes_1.options.peakPicking.id,
|
|
20
20
|
ToolTypes_1.options.integral.id,
|
|
21
21
|
ToolTypes_1.options.phaseCorrection.id,
|
|
22
|
-
ToolTypes_1.options.
|
|
22
|
+
ToolTypes_1.options.baselineCorrection.id,
|
|
23
23
|
ToolTypes_1.options.rangesPicking.id,
|
|
24
24
|
ToolTypes_1.options.exclusionZones.id,
|
|
25
25
|
];
|
|
@@ -21,7 +21,7 @@ const allowTools = [
|
|
|
21
21
|
ToolTypes_1.options.peakPicking.id,
|
|
22
22
|
ToolTypes_1.options.integral.id,
|
|
23
23
|
ToolTypes_1.options.phaseCorrection.id,
|
|
24
|
-
ToolTypes_1.options.
|
|
24
|
+
ToolTypes_1.options.baselineCorrection.id,
|
|
25
25
|
ToolTypes_1.options.rangesPicking.id,
|
|
26
26
|
ToolTypes_1.options.zone2D.id,
|
|
27
27
|
ToolTypes_1.options.slicingTool.id,
|
|
@@ -18,7 +18,7 @@ const styles = {
|
|
|
18
18
|
const allowTools = [
|
|
19
19
|
ToolTypes_1.options.zoom.id,
|
|
20
20
|
ToolTypes_1.options.equalizerTool.id,
|
|
21
|
-
ToolTypes_1.options.
|
|
21
|
+
ToolTypes_1.options.baselineCorrection.id,
|
|
22
22
|
ToolTypes_1.options.zone2D.id,
|
|
23
23
|
ToolTypes_1.options.slicingTool.id,
|
|
24
24
|
ToolTypes_1.options.integral.id,
|
|
@@ -33,6 +33,7 @@ const style = (0, react_1.css) `
|
|
|
33
33
|
`;
|
|
34
34
|
function DraggableStructure(props) {
|
|
35
35
|
const { zones, ranges, molecule, activeTab, displayerMode, index } = props;
|
|
36
|
+
const [molfile, setMolFile] = (0, react_2.useState)(molecule.molfile);
|
|
36
37
|
const { viewerRef } = (0, GlobalContext_1.useGlobal)();
|
|
37
38
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
38
39
|
const openMoleculeEditor = (0, MoleculeStructureEditorModal_1.useMoleculeEditor)();
|
|
@@ -43,8 +44,8 @@ function DraggableStructure(props) {
|
|
|
43
44
|
payload: { key: molecule.key },
|
|
44
45
|
});
|
|
45
46
|
}, [dispatch, molecule]);
|
|
46
|
-
return ((0, jsx_runtime_1.jsx)(SVGDraggable_1.default, { width: 150, height: 100, initialPosition: { x: 100, y: 50 }, dragHandleClassName: "handle", parentElement: viewerRef, children: (width, height) => ((0, jsx_runtime_1.jsxs)("foreignObject", { width: width, height: height + 30, "data-replace-float-structure": "true", css: style, onDoubleClick: () => openMoleculeEditor(molecule), children: [(0, jsx_runtime_1.jsx)(ActionsButton_1.default, { onFloatBtnClick: floatMoleculeHandler }), (0, jsx_runtime_1.jsx)(react_ocl_nmr_1.default, { OCL: full_1.default, autoCrop: true, id: `molSVG${index || ''}`, width: width - 20, height: height, molfile:
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(SVGDraggable_1.default, { width: 150, height: 100, initialPosition: { x: 100, y: 50 }, dragHandleClassName: "handle", parentElement: viewerRef, children: (width, height) => ((0, jsx_runtime_1.jsxs)("foreignObject", { width: width, height: height + 30, "data-replace-float-structure": "true", css: style, onDoubleClick: () => openMoleculeEditor(molecule), children: [(0, jsx_runtime_1.jsx)(ActionsButton_1.default, { onFloatBtnClick: floatMoleculeHandler }), (0, jsx_runtime_1.jsx)(react_ocl_nmr_1.default, { OCL: full_1.default, autoCrop: true, id: `molSVG${index || ''}`, width: width - 20, height: height, molfile: molfile, setSelectedAtom: handleOnClickAtom, atomHighlightColor: currentDiaIDsToHighlight?.length > 0 ? 'red' : '#FFD700', atomHighlightOpacity: 0.35, highlights: currentDiaIDsToHighlight?.length > 0
|
|
47
48
|
? currentDiaIDsToHighlight
|
|
48
|
-
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover, setMolfile:
|
|
49
|
+
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover, setMolfile: setMolFile })] })) }, molecule.key));
|
|
49
50
|
}
|
|
50
51
|
exports.DraggableStructure = DraggableStructure;
|
|
@@ -117,7 +117,6 @@ function BasicToolBarInner({ info, verticalAlign, displayerMode, ftCounter, fidC
|
|
|
117
117
|
openImportPublicationStringModal();
|
|
118
118
|
break;
|
|
119
119
|
default:
|
|
120
|
-
return;
|
|
121
120
|
}
|
|
122
121
|
}, [openLoader, importJCAMPFile, openImportPublicationStringModal]);
|
|
123
122
|
const exportHandler = (0, react_1.useCallback)(({ id }) => {
|