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
|
@@ -4,14 +4,13 @@ import { applyFilter } from '../../../data/FiltersManager';
|
|
|
4
4
|
import { generateSpectrumFromPublicationString, getReferenceShift, } from '../../../data/data1d/Spectrum1D';
|
|
5
5
|
import { getMissingProjection } from '../../../data/data2d/Spectrum2D';
|
|
6
6
|
import { options } from '../../toolbar/ToolTypes';
|
|
7
|
-
import
|
|
7
|
+
import groupByInfoKey from '../../utility/GroupByInfoKey';
|
|
8
8
|
import { setZoom } from '../helper/Zoom1DManager';
|
|
9
9
|
import { setDomain, setMode } from './DomainActions';
|
|
10
10
|
import { resetSpectrumByFilter } from './FiltersActions';
|
|
11
11
|
import { setTab, setActiveTab } from './ToolsActions';
|
|
12
12
|
function checkIsVisible2D(datum) {
|
|
13
|
-
if (datum.display.isPositiveVisible
|
|
14
|
-
datum.display.isNegativeVisible === false) {
|
|
13
|
+
if (!datum.display.isPositiveVisible && !datum.display.isNegativeVisible) {
|
|
15
14
|
return false;
|
|
16
15
|
}
|
|
17
16
|
return true;
|
|
@@ -75,10 +74,8 @@ function handleChangeActiveSpectrum(draft, activeSpectrum) {
|
|
|
75
74
|
newActiveSpectrum.display.isVisible = true;
|
|
76
75
|
if (oldIndex !== -1) {
|
|
77
76
|
refreshDomain =
|
|
78
|
-
draft.data[oldIndex].info.isFid
|
|
79
|
-
newActiveSpectrum.info.isFid
|
|
80
|
-
? false
|
|
81
|
-
: true;
|
|
77
|
+
draft.data[oldIndex].info.isFid !==
|
|
78
|
+
newActiveSpectrum.info.isFid;
|
|
82
79
|
}
|
|
83
80
|
else {
|
|
84
81
|
refreshDomain = newActiveSpectrum.info.isFid || false;
|
|
@@ -101,7 +98,7 @@ function handleChangeActiveSpectrum(draft, activeSpectrum) {
|
|
|
101
98
|
}
|
|
102
99
|
if (options[draft.toolOptions.selectedTool].isFilter) {
|
|
103
100
|
draft.toolOptions.selectedTool = options.zoom.id;
|
|
104
|
-
draft.toolOptions.data.
|
|
101
|
+
draft.toolOptions.data.baselineCorrection = { zones: [], options: {} };
|
|
105
102
|
draft.toolOptions.selectedOptionPanel = null;
|
|
106
103
|
draft.tempData = null;
|
|
107
104
|
}
|
|
@@ -151,7 +148,7 @@ function addMissingProjectionHandler(draft, action) {
|
|
|
151
148
|
const datum1D = getMissingProjection(state.data[index], n, draft.usedColors);
|
|
152
149
|
draft.data.push(datum1D);
|
|
153
150
|
}
|
|
154
|
-
const groupByNucleus =
|
|
151
|
+
const groupByNucleus = groupByInfoKey('nucleus');
|
|
155
152
|
const dataGroupByNucleus = groupByNucleus(draft.data);
|
|
156
153
|
setTab(draft, dataGroupByNucleus, draft.activeTab, true);
|
|
157
154
|
setDomain(draft);
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { max } from 'd3';
|
|
2
2
|
import { original, current } from 'immer';
|
|
3
3
|
import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
4
|
-
import * as Filters from '../../../data/Filters';
|
|
5
4
|
import generateID from '../../../data/utilities/generateID';
|
|
6
5
|
import { getYScale, getXScale } from '../../1d/utilities/scale';
|
|
7
6
|
import { LAYOUT } from '../../2d/utilities/DimensionLayout';
|
|
8
7
|
import { get2DYScale } from '../../2d/utilities/scale';
|
|
9
8
|
import { options } from '../../toolbar/ToolTypes';
|
|
10
|
-
import
|
|
11
|
-
import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
|
|
9
|
+
import groupByInfoKey from '../../utility/GroupByInfoKey';
|
|
12
10
|
import { DISPLAYER_MODE, MARGIN } from '../core/Constants';
|
|
13
11
|
import { setZoom, wheelZoom, ZoomType } from '../helper/Zoom1DManager';
|
|
14
12
|
import zoomHistoryManager from '../helper/ZoomHistoryManager';
|
|
15
13
|
import { setDomain, setIntegralsYDomain, setMode, } from './DomainActions';
|
|
16
|
-
import { resetSpectrumByFilter } from './FiltersActions';
|
|
14
|
+
import { calculateBaseLineCorrection, resetSpectrumByFilter, } from './FiltersActions';
|
|
17
15
|
import { changeSpectrumVerticalAlignment } from './PreferencesActions';
|
|
18
16
|
function getStrongestPeak(draft) {
|
|
19
17
|
const { activeSpectrum, data } = draft;
|
|
@@ -24,47 +22,66 @@ function getStrongestPeak(draft) {
|
|
|
24
22
|
return {
|
|
25
23
|
xValue: activeData.x[index],
|
|
26
24
|
yValue: strongestPeakValue,
|
|
27
|
-
index
|
|
25
|
+
index,
|
|
28
26
|
};
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
|
-
function
|
|
29
|
+
function checkFilterHasTempData(selectedToolId) {
|
|
30
|
+
return [options.phaseCorrection.id, options.baselineCorrection.id].includes(selectedToolId);
|
|
31
|
+
}
|
|
32
|
+
function setFilterChanges(draft, selectedFilterID) {
|
|
32
33
|
const activeSpectrumId = draft.activeSpectrum?.id;
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
34
|
+
// 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
|
|
35
|
+
if (checkFilterHasTempData(selectedFilterID)) {
|
|
36
|
+
//return back the spectra data to point of time before applying a specific filter
|
|
37
|
+
const dataSavePoint = resetSpectrumByFilter(draft, selectedFilterID, {
|
|
38
|
+
updateDomain: false,
|
|
37
39
|
rollback: true,
|
|
38
40
|
searchBy: 'name',
|
|
39
41
|
returnCurrentDatum: true,
|
|
40
42
|
});
|
|
43
|
+
// create a temporary clone of the data
|
|
41
44
|
draft.tempData = current(draft).data;
|
|
42
|
-
if (
|
|
43
|
-
draft.tempData[
|
|
44
|
-
datumAfterPhaseCorrection?.datum;
|
|
45
|
+
if (dataSavePoint) {
|
|
46
|
+
draft.tempData[dataSavePoint?.index] = dataSavePoint?.datum;
|
|
45
47
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
switch (selectedFilterID) {
|
|
49
|
+
case options.phaseCorrection.id: {
|
|
50
|
+
// look for the strongest peak to set it as a pivot
|
|
51
|
+
const { xValue, index } = getStrongestPeak(draft) || {
|
|
52
|
+
xValue: 0,
|
|
53
|
+
index: 0,
|
|
54
|
+
};
|
|
55
|
+
draft.toolOptions.data.pivot = { value: xValue, index };
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
case options.baselineCorrection.id: {
|
|
59
|
+
if (draft.activeSpectrum?.id) {
|
|
60
|
+
const baselineCorrectionFilter = current(draft).data[draft.activeSpectrum.index].filters.find((filter) => filter.name === options.baselineCorrection.id);
|
|
61
|
+
draft.toolOptions.data.baselineCorrection.zones =
|
|
62
|
+
baselineCorrectionFilter
|
|
63
|
+
? baselineCorrectionFilter.value.zones
|
|
64
|
+
: [];
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
default:
|
|
69
|
+
break;
|
|
57
70
|
}
|
|
58
71
|
}
|
|
72
|
+
else if (checkFilterHasTempData(draft.toolOptions.selectedTool)) {
|
|
73
|
+
draft.toolOptions.data.activeFilterID = null;
|
|
74
|
+
const spectrumIndex = draft.data.findIndex((spectrum) => spectrum.id === activeSpectrumId);
|
|
75
|
+
draft.data[spectrumIndex].data = draft.tempData[spectrumIndex].data;
|
|
76
|
+
}
|
|
59
77
|
}
|
|
60
78
|
function resetTool(draft, setDefaultTool = true) {
|
|
61
79
|
// reset temp range
|
|
62
|
-
draft.toolOptions.data.tempRange = null;
|
|
63
80
|
setSelectedOptionPanel(draft, null);
|
|
64
81
|
if (setDefaultTool) {
|
|
65
82
|
draft.toolOptions.selectedTool = options.zoom.id;
|
|
66
83
|
}
|
|
67
|
-
draft.toolOptions.data.
|
|
84
|
+
draft.toolOptions.data.baselineCorrection = { zones: [], options: [] };
|
|
68
85
|
if (draft.toolOptions.data.activeFilterID) {
|
|
69
86
|
resetSpectrumByFilter(draft);
|
|
70
87
|
}
|
|
@@ -86,10 +103,7 @@ function setSelectedTool(draft, action) {
|
|
|
86
103
|
if (selectedTool) {
|
|
87
104
|
// start Range edit mode
|
|
88
105
|
if (selectedTool === options.editRange.id) {
|
|
89
|
-
draft.toolOptions.data.
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
draft.toolOptions.data.tempRange = null;
|
|
106
|
+
draft.toolOptions.data.showMultiplicityTrees = true;
|
|
93
107
|
}
|
|
94
108
|
if (selectedTool !== draft.toolOptions.selectedTool) {
|
|
95
109
|
resetTool(draft, false);
|
|
@@ -132,18 +146,20 @@ function handleAddBaseLineZone(draft, { from, to }) {
|
|
|
132
146
|
else {
|
|
133
147
|
zone = [start, end];
|
|
134
148
|
}
|
|
135
|
-
const zones = draft.toolOptions.data.
|
|
149
|
+
const zones = draft.toolOptions.data.baselineCorrection.zones;
|
|
136
150
|
zones.push({
|
|
137
151
|
id: generateID(),
|
|
138
152
|
from: zone[0],
|
|
139
153
|
to: zone[1],
|
|
140
154
|
});
|
|
141
|
-
draft.toolOptions.data.
|
|
155
|
+
draft.toolOptions.data.baselineCorrection.zones = zones.slice();
|
|
156
|
+
calculateBaseLineCorrection(draft);
|
|
142
157
|
}
|
|
143
158
|
function handleDeleteBaseLineZone(draft, id) {
|
|
144
159
|
const state = original(draft);
|
|
145
|
-
draft.toolOptions.data.
|
|
146
|
-
state.toolOptions.data.
|
|
160
|
+
draft.toolOptions.data.baselineCorrection.zones =
|
|
161
|
+
state.toolOptions.data.baselineCorrection.zones.filter((zone) => zone.id !== id);
|
|
162
|
+
calculateBaseLineCorrection(draft);
|
|
147
163
|
}
|
|
148
164
|
function handleToggleRealImaginaryVisibility(draft) {
|
|
149
165
|
if (draft.activeSpectrum != null) {
|
|
@@ -216,24 +232,21 @@ function handleZoom(draft, action) {
|
|
|
216
232
|
}
|
|
217
233
|
}
|
|
218
234
|
}
|
|
219
|
-
else {
|
|
220
|
-
if (
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
draft.integralsYDomains[activeSpectrum?.id] = wheelZoom(event, domain);
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
const domain = draft.yDomains[activeSpectrum?.id];
|
|
228
|
-
draft.yDomains[activeSpectrum?.id] = wheelZoom(event, domain);
|
|
229
|
-
}
|
|
235
|
+
else if (activeSpectrum?.id) {
|
|
236
|
+
if ((showRangesIntegrals || selectedTool === options.integral.id) &&
|
|
237
|
+
event.shiftKey) {
|
|
238
|
+
const domain = draft.integralsYDomains[activeSpectrum?.id];
|
|
239
|
+
draft.integralsYDomains[activeSpectrum?.id] = wheelZoom(event, domain);
|
|
230
240
|
}
|
|
231
241
|
else {
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
242
|
+
const domain = draft.yDomains[activeSpectrum?.id];
|
|
243
|
+
draft.yDomains[activeSpectrum?.id] = wheelZoom(event, domain);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
for (const key of Object.keys(draft.yDomains)) {
|
|
248
|
+
const domain = draft.yDomains[key];
|
|
249
|
+
draft.yDomains[key] = wheelZoom(event, domain);
|
|
237
250
|
}
|
|
238
251
|
}
|
|
239
252
|
}
|
|
@@ -306,7 +319,7 @@ function setMargin(draft) {
|
|
|
306
319
|
draft.margin = MARGIN['1D'];
|
|
307
320
|
}
|
|
308
321
|
}
|
|
309
|
-
function
|
|
322
|
+
function processing2DData(draft, data) {
|
|
310
323
|
if (draft.displayerMode === DISPLAYER_MODE.DM_2D) {
|
|
311
324
|
let _data = {};
|
|
312
325
|
for (const datum of data[draft.activeTab]) {
|
|
@@ -382,13 +395,13 @@ function setTab(draft, dataGroupByTab, tab, refresh = false) {
|
|
|
382
395
|
}
|
|
383
396
|
function setActiveTab(draft, options) {
|
|
384
397
|
const { tab = null, refreshActiveTab = false, domainOptions = {}, } = options || {};
|
|
385
|
-
const groupByNucleus =
|
|
398
|
+
const groupByNucleus = groupByInfoKey('nucleus');
|
|
386
399
|
const dataGroupByNucleus = groupByNucleus(draft.data, true);
|
|
387
400
|
const tabs = Object.keys(dataGroupByNucleus);
|
|
388
401
|
const currentTab = !tab || !tabs.includes(tab || '') ? tabs[0] : tab;
|
|
389
402
|
setTab(draft, dataGroupByNucleus, currentTab, refreshActiveTab);
|
|
390
403
|
resetTool(draft);
|
|
391
|
-
|
|
404
|
+
processing2DData(draft, dataGroupByNucleus);
|
|
392
405
|
setDomain(draft, domainOptions);
|
|
393
406
|
setIntegralsYDomain(draft, dataGroupByNucleus[currentTab]);
|
|
394
407
|
const zoomHistory = zoomHistoryManager(draft.zoom.history, draft.activeTab);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Draft } from 'immer';
|
|
2
|
+
import { State } from '../Reducer';
|
|
3
|
+
export declare function getSpectrum(state: Draft<State>): any;
|
|
4
|
+
export declare function getSpectrum(state: Draft<State>, index: number): any;
|
|
5
|
+
export declare function getSpectrum(state: Draft<State>, id: string): any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function getSpectrum(state, value) {
|
|
2
|
+
if (value === undefined) {
|
|
3
|
+
if (state.activeSpectrum?.id) {
|
|
4
|
+
const index = state.activeSpectrum.index;
|
|
5
|
+
return state.data[index];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
if (typeof value === 'number') {
|
|
9
|
+
return state.data[value] || undefined;
|
|
10
|
+
}
|
|
11
|
+
if (typeof value === 'string') {
|
|
12
|
+
return state.data.find((spectrum) => spectrum.id === value);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -53,7 +53,7 @@ export function initPreferences(draft, action) {
|
|
|
53
53
|
storeData('nmr-general-settings', JSON.stringify(data));
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
|
-
|
|
56
|
+
draft.workspaces[draft.workspace.current] = lodashMerge({}, currentWorkspacePreferences, resProps);
|
|
57
57
|
}
|
|
58
58
|
draft.dispatch = dispatch;
|
|
59
59
|
}
|
|
@@ -44,12 +44,12 @@ const databaseDefaultValues = {
|
|
|
44
44
|
showSmiles: true,
|
|
45
45
|
showSolvent: false,
|
|
46
46
|
showNames: true,
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
range: { show: false, format: '0.00' },
|
|
48
|
+
delta: { show: true, format: '0.00' },
|
|
49
49
|
showAssignment: false,
|
|
50
|
-
|
|
50
|
+
coupling: { show: true, format: '0.0' },
|
|
51
51
|
showMultiplicity: true,
|
|
52
|
-
color: '
|
|
52
|
+
color: '#C0B000',
|
|
53
53
|
marginBottom: 30,
|
|
54
54
|
};
|
|
55
55
|
export { getPeaksDefaultValues, getIntegralDefaultValues, getRangeDefaultValues, getZoneDefaultValues, databaseDefaultValues, };
|
|
@@ -160,10 +160,10 @@ declare const preferencesReducer: (base: {
|
|
|
160
160
|
readonly integralTool?: boolean | undefined;
|
|
161
161
|
readonly zonePickingTool?: boolean | undefined;
|
|
162
162
|
readonly slicingTool?: boolean | undefined;
|
|
163
|
-
readonly
|
|
163
|
+
readonly rangePickingTool?: boolean | undefined;
|
|
164
164
|
readonly zeroFillingTool?: boolean | undefined;
|
|
165
165
|
readonly phaseCorrectionTool?: boolean | undefined;
|
|
166
|
-
readonly
|
|
166
|
+
readonly baselineCorrectionTool?: boolean | undefined;
|
|
167
167
|
readonly FFTTool?: boolean | undefined;
|
|
168
168
|
readonly multipleSpectraAnalysisTool?: boolean | undefined;
|
|
169
169
|
readonly exclusionZonesTool?: boolean | undefined;
|
|
@@ -282,21 +282,34 @@ declare const preferencesReducer: (base: {
|
|
|
282
282
|
readonly showSmiles: boolean;
|
|
283
283
|
readonly showSolvent: boolean;
|
|
284
284
|
readonly showNames: boolean;
|
|
285
|
-
readonly
|
|
286
|
-
|
|
285
|
+
readonly range: {
|
|
286
|
+
readonly show: boolean;
|
|
287
|
+
readonly format: string;
|
|
288
|
+
};
|
|
289
|
+
readonly delta: {
|
|
290
|
+
readonly show: boolean;
|
|
291
|
+
readonly format: string;
|
|
292
|
+
};
|
|
287
293
|
readonly showAssignment: boolean;
|
|
288
|
-
readonly
|
|
294
|
+
readonly coupling: {
|
|
295
|
+
readonly show: boolean;
|
|
296
|
+
readonly format: string;
|
|
297
|
+
};
|
|
289
298
|
readonly showMultiplicity: boolean;
|
|
290
299
|
readonly color: string;
|
|
291
300
|
readonly marginBottom: number;
|
|
292
301
|
} | undefined;
|
|
293
302
|
};
|
|
294
303
|
};
|
|
295
|
-
readonly databases:
|
|
296
|
-
readonly
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
304
|
+
readonly databases: {
|
|
305
|
+
readonly data: readonly {
|
|
306
|
+
readonly key: string;
|
|
307
|
+
readonly label: string;
|
|
308
|
+
readonly url: string;
|
|
309
|
+
readonly enabled: boolean;
|
|
310
|
+
}[];
|
|
311
|
+
readonly defaultDatabase: string;
|
|
312
|
+
};
|
|
300
313
|
};
|
|
301
314
|
};
|
|
302
315
|
readonly dispatch: (action?: PreferencesActions) => void;
|
|
@@ -8,7 +8,7 @@ import { resetPreferences } from './actions/resetPreferences';
|
|
|
8
8
|
import { setPanelsPreferences } from './actions/setPanelsPreferences';
|
|
9
9
|
import { setPreferences } from './actions/setPreferences';
|
|
10
10
|
import { setWorkspace } from './actions/setWorkspace';
|
|
11
|
-
const LOCAL_STORAGE_VERSION =
|
|
11
|
+
const LOCAL_STORAGE_VERSION = 9;
|
|
12
12
|
export const WORKSPACES = [
|
|
13
13
|
{
|
|
14
14
|
key: 'default',
|
|
@@ -55,6 +55,7 @@ export declare const DELETE_SPECTRA_FILTER = "DELETE_SPECTRA_FILTER";
|
|
|
55
55
|
export declare const APPLY_ZERO_FILLING_FILTER = "APPLY_ZERO_FILLING_FILTER";
|
|
56
56
|
export declare const APPLY_FFT_FILTER = "APPLY_FFT_FILTER";
|
|
57
57
|
export declare const CALCULATE_MANUAL_PHASE_CORRECTION_FILTER = "CALCULATE_MANUAL_PHASE_CORRECTION_FILTER";
|
|
58
|
+
export declare const CALCULATE_BASE_LINE_CORRECTION_FILTER = "CALCULATE_BASE_LINE_CORRECTION_FILTER";
|
|
58
59
|
export declare const APPLY_MANUAL_PHASE_CORRECTION_FILTER = "APPLY_MANUAL_PHASE_CORRECTION_FILTER";
|
|
59
60
|
export declare const APPLY_AUTO_PHASE_CORRECTION_FILTER = "APPLY_AUTO_PHASE_CORRECTION_FILTER";
|
|
60
61
|
export declare const APPLY_ABSOLUTE_FILTER = "APPLY_ABSOLUTE_FILTER";
|
|
@@ -115,12 +116,13 @@ export declare const DELETE_EXCLUSION_ZONE = "DELETE_EXCLUSION_ZONE";
|
|
|
115
116
|
export declare const CHANGE_RANGES_SUM_FLAG = "CHANGE_RANGES_SUM_FLAG";
|
|
116
117
|
export declare const CHANGE_INTEGRALS_SUM_FLAG = "CHANGE_INTEGRALS_SUM_FLAG";
|
|
117
118
|
export declare const CHANGE_ZONES_NOISE_FACTOR = "CHANGE_ZONES_NOISE_FACTOR";
|
|
118
|
-
export declare const
|
|
119
|
+
export declare const UPDATE_RANGE = "UPDATE_RANGE";
|
|
119
120
|
export declare const SHOW_MULTIPLICTY_TREES = "SHOW_MULTIPLICTY_TREES";
|
|
120
121
|
export declare const SHOW_RANGES_INTEGRALS = "SHOW_RANGES_INTEGRALS";
|
|
121
122
|
export declare const AUTO_RANGES_SPECTRA_PICKING = "AUTO_RANGES_SPECTRA_PICKING";
|
|
122
123
|
export declare const AUTO_ZONES_SPECTRA_PICKING = "AUTO_ZONES_SPECTRA_PICKING";
|
|
123
124
|
export declare const GENERATE_SPECTRUM_FROM_PUBLICATION_STRING = "GENERATE_SPECTRUM_FROM_PUBLICATION_STRING";
|
|
124
125
|
export declare const RESURRECTING_SPECTRUM_FROM_RANGES = "RESURRECTING_SPECTRUM_FROM_RANGES";
|
|
126
|
+
export declare const RESURRECTING_SPECTRUM_FROM_JCAMP = "RESURRECTING_SPECTRUM_FROM_JCAMP";
|
|
125
127
|
export declare const SHOW_J_GRAPH = "SHOW_J_GRAPH";
|
|
126
128
|
export declare const SET_AUTOMATIC_ASSIGNMENTS = "SET_AUTOMATIC_ASSIGNMENTS";
|
|
@@ -49,6 +49,7 @@ export const DELETE_SPECTRA_FILTER = 'DELETE_SPECTRA_FILTER';
|
|
|
49
49
|
export const APPLY_ZERO_FILLING_FILTER = 'APPLY_ZERO_FILLING_FILTER';
|
|
50
50
|
export const APPLY_FFT_FILTER = 'APPLY_FFT_FILTER';
|
|
51
51
|
export const CALCULATE_MANUAL_PHASE_CORRECTION_FILTER = 'CALCULATE_MANUAL_PHASE_CORRECTION_FILTER';
|
|
52
|
+
export const CALCULATE_BASE_LINE_CORRECTION_FILTER = 'CALCULATE_BASE_LINE_CORRECTION_FILTER';
|
|
52
53
|
export const APPLY_MANUAL_PHASE_CORRECTION_FILTER = 'APPLY_MANUAL_PHASE_CORRECTION_FILTER';
|
|
53
54
|
export const APPLY_AUTO_PHASE_CORRECTION_FILTER = 'APPLY_AUTO_PHASE_CORRECTION_FILTER';
|
|
54
55
|
export const APPLY_ABSOLUTE_FILTER = 'APPLY_ABSOLUTE_FILTER';
|
|
@@ -109,12 +110,13 @@ export const DELETE_EXCLUSION_ZONE = 'DELETE_EXCLUSION_ZONE';
|
|
|
109
110
|
export const CHANGE_RANGES_SUM_FLAG = 'CHANGE_RANGES_SUM_FLAG';
|
|
110
111
|
export const CHANGE_INTEGRALS_SUM_FLAG = 'CHANGE_INTEGRALS_SUM_FLAG';
|
|
111
112
|
export const CHANGE_ZONES_NOISE_FACTOR = 'CHANGE_ZONES_NOISE_FACTOR';
|
|
112
|
-
export const
|
|
113
|
+
export const UPDATE_RANGE = 'UPDATE_RANGE';
|
|
113
114
|
export const SHOW_MULTIPLICTY_TREES = 'SHOW_MULTIPLICTY_TREES';
|
|
114
115
|
export const SHOW_RANGES_INTEGRALS = 'SHOW_RANGES_INTEGRALS';
|
|
115
116
|
export const AUTO_RANGES_SPECTRA_PICKING = 'AUTO_RANGES_SPECTRA_PICKING';
|
|
116
117
|
export const AUTO_ZONES_SPECTRA_PICKING = 'AUTO_ZONES_SPECTRA_PICKING';
|
|
117
118
|
export const GENERATE_SPECTRUM_FROM_PUBLICATION_STRING = 'GENERATE_SPECTRUM_FROM_PUBLICATION_STRING';
|
|
118
119
|
export const RESURRECTING_SPECTRUM_FROM_RANGES = 'RESURRECTING_SPECTRUM_FROM_RANGES';
|
|
120
|
+
export const RESURRECTING_SPECTRUM_FROM_JCAMP = 'RESURRECTING_SPECTRUM_FROM_JCAMP';
|
|
119
121
|
export const SHOW_J_GRAPH = 'SHOW_J_GRAPH';
|
|
120
122
|
export const SET_AUTOMATIC_ASSIGNMENTS = 'SET_AUTOMATIC_ASSIGNMENTS';
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import OCL from 'openchemlib/full';
|
|
5
|
-
import { useCallback } from 'react';
|
|
5
|
+
import { useCallback, useState } from 'react';
|
|
6
6
|
import OCLnmr from 'react-ocl-nmr';
|
|
7
7
|
import { useDispatch } from '../../context/DispatchContext';
|
|
8
8
|
import { useGlobal } from '../../context/GlobalContext';
|
|
@@ -27,6 +27,7 @@ const style = css `
|
|
|
27
27
|
`;
|
|
28
28
|
export function DraggableStructure(props) {
|
|
29
29
|
const { zones, ranges, molecule, activeTab, displayerMode, index } = props;
|
|
30
|
+
const [molfile, setMolFile] = useState(molecule.molfile);
|
|
30
31
|
const { viewerRef } = useGlobal();
|
|
31
32
|
const dispatch = useDispatch();
|
|
32
33
|
const openMoleculeEditor = useMoleculeEditor();
|
|
@@ -37,7 +38,7 @@ export function DraggableStructure(props) {
|
|
|
37
38
|
payload: { key: molecule.key },
|
|
38
39
|
});
|
|
39
40
|
}, [dispatch, molecule]);
|
|
40
|
-
return (_jsx(SVGDraggable, { width: 150, height: 100, initialPosition: { x: 100, y: 50 }, dragHandleClassName: "handle", parentElement: viewerRef, children: (width, height) => (_jsxs("foreignObject", { width: width, height: height + 30, "data-replace-float-structure": "true", css: style, onDoubleClick: () => openMoleculeEditor(molecule), children: [_jsx(ActionsButton, { onFloatBtnClick: floatMoleculeHandler }), _jsx(OCLnmr, { OCL: OCL, autoCrop: true, id: `molSVG${index || ''}`, width: width - 20, height: height, molfile:
|
|
41
|
+
return (_jsx(SVGDraggable, { width: 150, height: 100, initialPosition: { x: 100, y: 50 }, dragHandleClassName: "handle", parentElement: viewerRef, children: (width, height) => (_jsxs("foreignObject", { width: width, height: height + 30, "data-replace-float-structure": "true", css: style, onDoubleClick: () => openMoleculeEditor(molecule), children: [_jsx(ActionsButton, { onFloatBtnClick: floatMoleculeHandler }), _jsx(OCLnmr, { OCL: OCL, 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
|
|
41
42
|
? currentDiaIDsToHighlight
|
|
42
|
-
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover, setMolfile:
|
|
43
|
+
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover, setMolfile: setMolFile })] })) }, molecule.key));
|
|
43
44
|
}
|
|
@@ -112,7 +112,6 @@ function BasicToolBarInner({ info, verticalAlign, displayerMode, ftCounter, fidC
|
|
|
112
112
|
openImportPublicationStringModal();
|
|
113
113
|
break;
|
|
114
114
|
default:
|
|
115
|
-
return;
|
|
116
115
|
}
|
|
117
116
|
}, [openLoader, importJCAMPFile, openImportPublicationStringModal]);
|
|
118
117
|
const exportHandler = useCallback(({ id }) => {
|
|
@@ -33,26 +33,22 @@ function FunctionToolBarInner({ defaultValue, activeSpectrum, info, datum, displ
|
|
|
33
33
|
});
|
|
34
34
|
dispatch({ type: SET_SELECTED_FILTER, selectedFilter: null });
|
|
35
35
|
}, [dispatch]);
|
|
36
|
-
return (_jsxs(_Fragment, { children: [_jsxs(ToggleButtonGroup, { value: option, onChange: handleChange, children: [isButtonVisible('zoomTool') && (_jsx(ToggleButton, { value: options.zoom.id, id: "zoomIn", title: `${options.zoom.label} ( Press z )`, children: _jsx("div", { style: { fontSize: 14 }, children: _jsx(FaSearchPlus, {}) }) }, options.zoom.id)), isButtonVisible('zoomOutTool') && (_jsx(Toolbar.Item, { id: "zoom-out", onClick: handleFullZoomOut, title: "Horizontal zoom out ( Press f ), Horizontal and Vertical zoom out, double click ( Press ff )", children: _jsx("div", { style: { fontSize: 14 }, children: _jsx(FaExpand, {}) }) })), displayerMode === DISPLAYER_MODE.DM_1D && isButtonVisible('peakTool') && (_jsx(ToggleButton, { value: options.peakPicking.id, title: `${options.peakPicking.label} ( Press p )`, isVisible: activeSpectrum && !info?.isFid
|
|
37
|
-
isButtonVisible('integralTool') && (_jsx(ToggleButton, { value: options.integral.id, isVisible: activeSpectrum && !info?.isFid
|
|
38
|
-
isButtonVisible('zonePickingTool') && (_jsx(ToggleButton, { value: options.zone2D.id, id: "zone2d", isVisible: activeSpectrum && !info?.isFid
|
|
39
|
-
isButtonVisible('slicingTool') && (_jsx(ToggleButton, { value: options.slicingTool.id, isVisible: activeSpectrum && !info?.isFid
|
|
40
|
-
isButtonVisible('
|
|
36
|
+
return (_jsxs(_Fragment, { children: [_jsxs(ToggleButtonGroup, { value: option, onChange: handleChange, children: [isButtonVisible('zoomTool') && (_jsx(ToggleButton, { value: options.zoom.id, id: "zoomIn", title: `${options.zoom.label} ( Press z )`, children: _jsx("div", { style: { fontSize: 14 }, children: _jsx(FaSearchPlus, {}) }) }, options.zoom.id)), isButtonVisible('zoomOutTool') && (_jsx(Toolbar.Item, { id: "zoom-out", onClick: handleFullZoomOut, title: "Horizontal zoom out ( Press f ), Horizontal and Vertical zoom out, double click ( Press ff )", children: _jsx("div", { style: { fontSize: 14 }, children: _jsx(FaExpand, {}) }) })), displayerMode === DISPLAYER_MODE.DM_1D && isButtonVisible('peakTool') && (_jsx(ToggleButton, { value: options.peakPicking.id, title: `${options.peakPicking.label} ( Press p )`, isVisible: !!(activeSpectrum && !info?.isFid), id: "peakPicking", children: _jsx(SvgNmrPeakPicking, {}) }, options.peakPicking.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
37
|
+
isButtonVisible('integralTool') && (_jsx(ToggleButton, { value: options.integral.id, isVisible: !!(activeSpectrum && !info?.isFid), id: "integralPicking", title: `${options.integral.label} ( Press i )`, children: _jsx(SvgNmrIntegrate, {}) }, options.integral.id)), displayerMode === DISPLAYER_MODE.DM_2D &&
|
|
38
|
+
isButtonVisible('zonePickingTool') && (_jsx(ToggleButton, { value: options.zone2D.id, id: "zone2d", isVisible: !!(activeSpectrum && !info?.isFid), title: `${options.zone2D.label} ( Press r )`, children: _jsx(FaDiceFour, {}) }, options.zone2D.id)), displayerMode === DISPLAYER_MODE.DM_2D &&
|
|
39
|
+
isButtonVisible('slicingTool') && (_jsx(ToggleButton, { value: options.slicingTool.id, isVisible: !!(activeSpectrum && !info?.isFid), id: "slic", title: `${options.slicingTool.label}`, children: _jsx("p", { children: "Slic" }) }, options.slicingTool.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
40
|
+
isButtonVisible('rangePickingTool') && (_jsx(ToggleButton, { value: options.rangesPicking.id, isVisible: !!(activeSpectrum && !info?.isFid), title: `${options.rangesPicking.label} ( Press r )`, id: "ranges-pick", children: _jsx(SvgNmrRangePicking, {}) }, options.rangesPicking.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
41
41
|
isButtonVisible('multipleSpectraAnalysisTool') &&
|
|
42
42
|
ftCounter > 1 &&
|
|
43
43
|
mode === 'RTL' && (_jsx(ToggleButton, { value: options.multipleSpectraAnalysis.id, id: "multipleSpectraAnalysis", title: options.multipleSpectraAnalysis.label, children: _jsx(SvgNmrMultipleAnalysis, {}) }, options.multipleSpectraAnalysis.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
44
44
|
isButtonVisible('zeroFillingTool') && (_jsx(ToggleButton, { value: options.zeroFilling.id, isVisible: Filters.zeroFilling.isApplicable({ info }), id: "zeroFilling", title: options.zeroFilling.label, children: _jsx(SvgNmrZeroFilling, {}) }, options.zeroFilling.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
45
|
-
isButtonVisible('phaseCorrectionTool') && (_jsx(ToggleButton, { value: options.phaseCorrection.id, id: "phaseCorrection", title: `${options.phaseCorrection.label} ( Press a )`, isVisible: activeSpectrum &&
|
|
45
|
+
isButtonVisible('phaseCorrectionTool') && (_jsx(ToggleButton, { value: options.phaseCorrection.id, id: "phaseCorrection", title: `${options.phaseCorrection.label} ( Press a )`, isVisible: !!(activeSpectrum &&
|
|
46
46
|
info &&
|
|
47
47
|
Filters.phaseCorrection.isApplicable({ info }) &&
|
|
48
|
-
datum.im
|
|
49
|
-
|
|
50
|
-
: false, children: _jsx(SvgNmrPhaseCorrection, {}) }, options.phaseCorrection.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
51
|
-
isButtonVisible('baseLineCorrectionTool') && (_jsx(ToggleButton, { value: options.baseLineCorrection.id, id: "baseLineCorrection", title: `${options.baseLineCorrection.label} ( Press b )`, isVisible: activeSpectrum &&
|
|
48
|
+
datum.im), children: _jsx(SvgNmrPhaseCorrection, {}) }, options.phaseCorrection.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
49
|
+
isButtonVisible('baselineCorrectionTool') && (_jsx(ToggleButton, { value: options.baselineCorrection.id, id: "baselineCorrection", title: `${options.baselineCorrection.label} ( Press b )`, isVisible: !!(activeSpectrum &&
|
|
52
50
|
info &&
|
|
53
|
-
Filters.baselineCorrection.isApplicable({ info })
|
|
54
|
-
? true
|
|
55
|
-
: false, children: _jsx(SvgNmrBaselineCorrection, {}) }, options.baseLineCorrection.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
51
|
+
Filters.baselineCorrection.isApplicable({ info })), children: _jsx(SvgNmrBaselineCorrection, {}) }, options.baselineCorrection.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
56
52
|
isButtonVisible('exclusionZonesTool') &&
|
|
57
53
|
!info?.isFid &&
|
|
58
54
|
ftCounter > 0 && (_jsx(ToggleButton, { value: options.exclusionZones.id, title: `${options.exclusionZones.label} ( Press e )`, id: "exclusionZones", children: _jsx("div", { style: { fontSize: 18 }, children: _jsx(SvgNmrMultipleAnalysis, {}) }) }, options.exclusionZones.id))] }), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
@@ -4,6 +4,6 @@ interface OptionItem {
|
|
|
4
4
|
hasOptionPanel: boolean;
|
|
5
5
|
isFilter: boolean;
|
|
6
6
|
}
|
|
7
|
-
declare type RecordOptions = Record<'zoom' | 'peakPicking' | 'integral' | 'zone2D' | 'slicingTool' | 'HMove' | 'equalizerTool' | 'rangesPicking' | 'zeroFilling' | 'phaseCorrection' | '
|
|
7
|
+
declare type RecordOptions = Record<'zoom' | 'peakPicking' | 'integral' | 'zone2D' | 'slicingTool' | 'HMove' | 'equalizerTool' | 'rangesPicking' | 'zeroFilling' | 'phaseCorrection' | 'baselineCorrection' | 'generalSelector' | 'editRange' | 'multipleSpectraAnalysis' | 'exclusionZones' | 'databaseRangesSelection', OptionItem>;
|
|
8
8
|
export declare const options: RecordOptions;
|
|
9
9
|
export {};
|
|
@@ -60,9 +60,9 @@ export const options = {
|
|
|
60
60
|
hasOptionPanel: true,
|
|
61
61
|
isFilter: true,
|
|
62
62
|
},
|
|
63
|
-
|
|
64
|
-
id:
|
|
65
|
-
label:
|
|
63
|
+
baselineCorrection: {
|
|
64
|
+
id: Filters.baselineCorrection.id,
|
|
65
|
+
label: Filters.baselineCorrection.name,
|
|
66
66
|
hasOptionPanel: true,
|
|
67
67
|
isFilter: true,
|
|
68
68
|
},
|
|
@@ -14,4 +14,10 @@ declare function exportAsMol(data: any, fileName?: string): void;
|
|
|
14
14
|
declare function exportAsSVG(rootRef: HTMLDivElement, elementID: string, fileName?: string): void;
|
|
15
15
|
declare function exportAsPng(rootRef: HTMLDivElement, elementID: string, fileName?: string): void;
|
|
16
16
|
declare function copyPNGToClipboard(rootRef: HTMLDivElement, elementID: string): void;
|
|
17
|
-
export
|
|
17
|
+
export interface BlobObject {
|
|
18
|
+
blob: Blob;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
}
|
|
22
|
+
declare function getBlob(rootRef: HTMLDivElement, elementID: string): BlobObject;
|
|
23
|
+
export { exportAsSVG, exportAsJSON, exportAsNMRE, exportAsPng, copyPNGToClipboard, copyTextToClipboard, copyHTMLToClipboard, exportAsMol, exportAsMatrix, getBlob, };
|
|
@@ -206,8 +206,8 @@ function getBlob(rootRef, elementID) {
|
|
|
206
206
|
let _svg = rootRef.getRootNode()
|
|
207
207
|
.getElementById(elementID)
|
|
208
208
|
?.cloneNode(true);
|
|
209
|
-
const width = _svg?.getAttribute('width').replace('px', '');
|
|
210
|
-
const height = _svg?.getAttribute('height').replace('px', '');
|
|
209
|
+
const width = Number(_svg?.getAttribute('width').replace('px', ''));
|
|
210
|
+
const height = Number(_svg?.getAttribute('height').replace('px', ''));
|
|
211
211
|
_svg
|
|
212
212
|
.querySelectorAll('[data-no-export="true"]')
|
|
213
213
|
.forEach((element) => element.remove());
|
|
@@ -235,4 +235,4 @@ function getBlob(rootRef, elementID) {
|
|
|
235
235
|
const blob = new Blob([svg], { type: 'image/svg+xml' });
|
|
236
236
|
return { blob, width, height };
|
|
237
237
|
}
|
|
238
|
-
export { exportAsSVG, exportAsJSON, exportAsNMRE, exportAsPng, copyPNGToClipboard, copyTextToClipboard, copyHTMLToClipboard, exportAsMol, exportAsMatrix, };
|
|
238
|
+
export { exportAsSVG, exportAsJSON, exportAsNMRE, exportAsPng, copyPNGToClipboard, copyTextToClipboard, copyHTMLToClipboard, exportAsMol, exportAsMatrix, getBlob, };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare function formatNumber(value: any, format: any, prefix?: string, suffix?: string):
|
|
1
|
+
declare function formatNumber(value: any, format: any, prefix?: string, suffix?: string): any;
|
|
2
2
|
declare function getNumberOfDecimals(value: number | string): number;
|
|
3
3
|
export { formatNumber, getNumberOfDecimals };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import numeral from 'numeral';
|
|
2
2
|
function formatNumber(value, format, prefix = '', suffix = '') {
|
|
3
|
-
return
|
|
3
|
+
return (value || value === 0) && !isNaN(value)
|
|
4
|
+
? prefix + numeral(value).format(format) + suffix
|
|
5
|
+
: value;
|
|
4
6
|
}
|
|
5
7
|
function getNumberOfDecimals(value) {
|
|
6
8
|
value = String(value).trim();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isGoogleDocument(url: string): boolean;
|