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
|
@@ -61,26 +61,22 @@ function FunctionToolBarInner({ defaultValue, activeSpectrum, info, datum, displ
|
|
|
61
61
|
});
|
|
62
62
|
dispatch({ type: Types_1.SET_SELECTED_FILTER, selectedFilter: null });
|
|
63
63
|
}, [dispatch]);
|
|
64
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(ToggleButtonGroup_1.default, { value: option, onChange: handleChange, children: [isButtonVisible('zoomTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.zoom.id, id: "zoomIn", title: `${ToolTypes_1.options.zoom.label} ( Press z )`, children: (0, jsx_runtime_1.jsx)("div", { style: { fontSize: 14 }, children: (0, jsx_runtime_1.jsx)(fa_1.FaSearchPlus, {}) }) }, ToolTypes_1.options.zoom.id)), isButtonVisible('zoomOutTool') && ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.Toolbar.Item, { id: "zoom-out", onClick: handleFullZoomOut, title: "Horizontal zoom out ( Press f ), Horizontal and Vertical zoom out, double click ( Press ff )", children: (0, jsx_runtime_1.jsx)("div", { style: { fontSize: 14 }, children: (0, jsx_runtime_1.jsx)(fa_1.FaExpand, {}) }) })), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D && isButtonVisible('peakTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.peakPicking.id, title: `${ToolTypes_1.options.peakPicking.label} ( Press p )`, isVisible: activeSpectrum && !info?.isFid
|
|
65
|
-
isButtonVisible('integralTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.integral.id, isVisible: activeSpectrum && !info?.isFid
|
|
66
|
-
isButtonVisible('zonePickingTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.zone2D.id, id: "zone2d", isVisible: activeSpectrum && !info?.isFid
|
|
67
|
-
isButtonVisible('slicingTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.slicingTool.id, isVisible: activeSpectrum && !info?.isFid
|
|
68
|
-
isButtonVisible('
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(ToggleButtonGroup_1.default, { value: option, onChange: handleChange, children: [isButtonVisible('zoomTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.zoom.id, id: "zoomIn", title: `${ToolTypes_1.options.zoom.label} ( Press z )`, children: (0, jsx_runtime_1.jsx)("div", { style: { fontSize: 14 }, children: (0, jsx_runtime_1.jsx)(fa_1.FaSearchPlus, {}) }) }, ToolTypes_1.options.zoom.id)), isButtonVisible('zoomOutTool') && ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.Toolbar.Item, { id: "zoom-out", onClick: handleFullZoomOut, title: "Horizontal zoom out ( Press f ), Horizontal and Vertical zoom out, double click ( Press ff )", children: (0, jsx_runtime_1.jsx)("div", { style: { fontSize: 14 }, children: (0, jsx_runtime_1.jsx)(fa_1.FaExpand, {}) }) })), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D && isButtonVisible('peakTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.peakPicking.id, title: `${ToolTypes_1.options.peakPicking.label} ( Press p )`, isVisible: !!(activeSpectrum && !info?.isFid), id: "peakPicking", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPeakPicking, {}) }, ToolTypes_1.options.peakPicking.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
65
|
+
isButtonVisible('integralTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.integral.id, isVisible: !!(activeSpectrum && !info?.isFid), id: "integralPicking", title: `${ToolTypes_1.options.integral.label} ( Press i )`, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrIntegrate, {}) }, ToolTypes_1.options.integral.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_2D &&
|
|
66
|
+
isButtonVisible('zonePickingTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.zone2D.id, id: "zone2d", isVisible: !!(activeSpectrum && !info?.isFid), title: `${ToolTypes_1.options.zone2D.label} ( Press r )`, children: (0, jsx_runtime_1.jsx)(fa_1.FaDiceFour, {}) }, ToolTypes_1.options.zone2D.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_2D &&
|
|
67
|
+
isButtonVisible('slicingTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.slicingTool.id, isVisible: !!(activeSpectrum && !info?.isFid), id: "slic", title: `${ToolTypes_1.options.slicingTool.label}`, children: (0, jsx_runtime_1.jsx)("p", { children: "Slic" }) }, ToolTypes_1.options.slicingTool.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
68
|
+
isButtonVisible('rangePickingTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.rangesPicking.id, isVisible: !!(activeSpectrum && !info?.isFid), title: `${ToolTypes_1.options.rangesPicking.label} ( Press r )`, id: "ranges-pick", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrRangePicking, {}) }, ToolTypes_1.options.rangesPicking.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
69
69
|
isButtonVisible('multipleSpectraAnalysisTool') &&
|
|
70
70
|
ftCounter > 1 &&
|
|
71
71
|
mode === 'RTL' && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.multipleSpectraAnalysis.id, id: "multipleSpectraAnalysis", title: ToolTypes_1.options.multipleSpectraAnalysis.label, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrMultipleAnalysis, {}) }, ToolTypes_1.options.multipleSpectraAnalysis.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
72
72
|
isButtonVisible('zeroFillingTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.zeroFilling.id, isVisible: Filters.zeroFilling.isApplicable({ info }), id: "zeroFilling", title: ToolTypes_1.options.zeroFilling.label, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrZeroFilling, {}) }, ToolTypes_1.options.zeroFilling.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
73
|
-
isButtonVisible('phaseCorrectionTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.phaseCorrection.id, id: "phaseCorrection", title: `${ToolTypes_1.options.phaseCorrection.label} ( Press a )`, isVisible: activeSpectrum &&
|
|
73
|
+
isButtonVisible('phaseCorrectionTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.phaseCorrection.id, id: "phaseCorrection", title: `${ToolTypes_1.options.phaseCorrection.label} ( Press a )`, isVisible: !!(activeSpectrum &&
|
|
74
74
|
info &&
|
|
75
75
|
Filters.phaseCorrection.isApplicable({ info }) &&
|
|
76
|
-
datum.im
|
|
77
|
-
|
|
78
|
-
: false, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPhaseCorrection, {}) }, ToolTypes_1.options.phaseCorrection.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
79
|
-
isButtonVisible('baseLineCorrectionTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.baseLineCorrection.id, id: "baseLineCorrection", title: `${ToolTypes_1.options.baseLineCorrection.label} ( Press b )`, isVisible: activeSpectrum &&
|
|
76
|
+
datum.im), children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPhaseCorrection, {}) }, ToolTypes_1.options.phaseCorrection.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
77
|
+
isButtonVisible('baselineCorrectionTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.baselineCorrection.id, id: "baselineCorrection", title: `${ToolTypes_1.options.baselineCorrection.label} ( Press b )`, isVisible: !!(activeSpectrum &&
|
|
80
78
|
info &&
|
|
81
|
-
Filters.baselineCorrection.isApplicable({ info })
|
|
82
|
-
? true
|
|
83
|
-
: false, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrBaselineCorrection, {}) }, ToolTypes_1.options.baseLineCorrection.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
79
|
+
Filters.baselineCorrection.isApplicable({ info })), children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrBaselineCorrection, {}) }, ToolTypes_1.options.baselineCorrection.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
84
80
|
isButtonVisible('exclusionZonesTool') &&
|
|
85
81
|
!info?.isFid &&
|
|
86
82
|
ftCounter > 0 && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.exclusionZones.id, title: `${ToolTypes_1.options.exclusionZones.label} ( Press e )`, id: "exclusionZones", children: (0, jsx_runtime_1.jsx)("div", { style: { fontSize: 18 }, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrMultipleAnalysis, {}) }) }, ToolTypes_1.options.exclusionZones.id))] }), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
@@ -86,9 +86,9 @@ exports.options = {
|
|
|
86
86
|
hasOptionPanel: true,
|
|
87
87
|
isFilter: true,
|
|
88
88
|
},
|
|
89
|
-
|
|
90
|
-
id:
|
|
91
|
-
label:
|
|
89
|
+
baselineCorrection: {
|
|
90
|
+
id: Filters.baselineCorrection.id,
|
|
91
|
+
label: Filters.baselineCorrection.name,
|
|
92
92
|
hasOptionPanel: true,
|
|
93
93
|
isFilter: true,
|
|
94
94
|
},
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.exportAsMatrix = exports.exportAsMol = exports.copyHTMLToClipboard = exports.copyTextToClipboard = exports.copyPNGToClipboard = exports.exportAsPng = exports.exportAsNMRE = exports.exportAsJSON = exports.exportAsSVG = void 0;
|
|
6
|
+
exports.getBlob = exports.exportAsMatrix = exports.exportAsMol = exports.copyHTMLToClipboard = exports.copyTextToClipboard = exports.copyPNGToClipboard = exports.exportAsPng = exports.exportAsNMRE = exports.exportAsJSON = exports.exportAsSVG = void 0;
|
|
7
7
|
const file_saver_1 = require("file-saver");
|
|
8
8
|
const jszip_1 = __importDefault(require("jszip"));
|
|
9
9
|
function copyFormattedHtml(html) {
|
|
@@ -221,8 +221,8 @@ function getBlob(rootRef, elementID) {
|
|
|
221
221
|
let _svg = rootRef.getRootNode()
|
|
222
222
|
.getElementById(elementID)
|
|
223
223
|
?.cloneNode(true);
|
|
224
|
-
const width = _svg?.getAttribute('width').replace('px', '');
|
|
225
|
-
const height = _svg?.getAttribute('height').replace('px', '');
|
|
224
|
+
const width = Number(_svg?.getAttribute('width').replace('px', ''));
|
|
225
|
+
const height = Number(_svg?.getAttribute('height').replace('px', ''));
|
|
226
226
|
_svg
|
|
227
227
|
.querySelectorAll('[data-no-export="true"]')
|
|
228
228
|
.forEach((element) => element.remove());
|
|
@@ -250,3 +250,4 @@ function getBlob(rootRef, elementID) {
|
|
|
250
250
|
const blob = new Blob([svg], { type: 'image/svg+xml' });
|
|
251
251
|
return { blob, width, height };
|
|
252
252
|
}
|
|
253
|
+
exports.getBlob = getBlob;
|
|
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getNumberOfDecimals = exports.formatNumber = void 0;
|
|
7
7
|
const numeral_1 = __importDefault(require("numeral"));
|
|
8
8
|
function formatNumber(value, format, prefix = '', suffix = '') {
|
|
9
|
-
return
|
|
9
|
+
return (value || value === 0) && !isNaN(value)
|
|
10
|
+
? prefix + (0, numeral_1.default)(value).format(format) + suffix
|
|
11
|
+
: value;
|
|
10
12
|
}
|
|
11
13
|
exports.formatNumber = formatNumber;
|
|
12
14
|
function getNumberOfDecimals(value) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isGoogleDocument = void 0;
|
|
4
|
+
function isGoogleDocument(url) {
|
|
5
|
+
return /https:\/\/docs\.google\.com\/(?<type>document|spreadsheets)\/d/.test(url);
|
|
6
|
+
}
|
|
7
|
+
exports.isGoogleDocument = isGoogleDocument;
|
|
@@ -51,8 +51,7 @@ async function getSpectra(file, options = {}, usedColors = {}) {
|
|
|
51
51
|
return (0, SpectraManager_1.addBruker)({ xy, noContours, keepOriginal }, file.binary, usedColors);
|
|
52
52
|
default:
|
|
53
53
|
if (!jcampURL) {
|
|
54
|
-
new Error('file extension is not supported');
|
|
55
|
-
return;
|
|
54
|
+
throw new Error('file extension is not supported');
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
57
|
}
|
|
@@ -32,14 +32,14 @@ async function addSource(nmrRecord, options = {}) {
|
|
|
32
32
|
default:
|
|
33
33
|
if (!jcampURL)
|
|
34
34
|
break;
|
|
35
|
-
|
|
35
|
+
await fetch(jcampURL).then(async (jcamp) => {
|
|
36
36
|
if (!jcamp)
|
|
37
37
|
return;
|
|
38
38
|
let name = jcampURL.split('/').slice(-1);
|
|
39
39
|
const path = `jcamp/${dimension}/${name}`;
|
|
40
40
|
tag += `\nJcamp_Location=file:${path}\\`;
|
|
41
41
|
nmrRecord.file(path, await jcamp.arrayBuffer());
|
|
42
|
-
})
|
|
42
|
+
});
|
|
43
43
|
}
|
|
44
44
|
return tag;
|
|
45
45
|
}
|
|
@@ -14,7 +14,7 @@ exports.basic = {
|
|
|
14
14
|
panels: {
|
|
15
15
|
spectraPanel: { display: true, open: true },
|
|
16
16
|
informationPanel: { display: true, open: false },
|
|
17
|
-
peaksPanel: { display:
|
|
17
|
+
peaksPanel: { display: false, open: false },
|
|
18
18
|
integralsPanel: { display: true, open: false },
|
|
19
19
|
rangesPanel: { display: true, open: false },
|
|
20
20
|
structuresPanel: { display: true, open: false },
|
|
@@ -26,6 +26,9 @@ exports.basic = {
|
|
|
26
26
|
predictionPanel: { display: false, open: false },
|
|
27
27
|
automaticAssignmentPanel: { display: false, open: false },
|
|
28
28
|
},
|
|
29
|
+
toolBarButtons: {
|
|
30
|
+
peakTool: false,
|
|
31
|
+
},
|
|
29
32
|
},
|
|
30
33
|
controllers: {
|
|
31
34
|
dimmedSpectraTransparency: 0.1,
|
|
@@ -41,11 +44,15 @@ exports.basic = {
|
|
|
41
44
|
},
|
|
42
45
|
panels: {},
|
|
43
46
|
},
|
|
44
|
-
databases:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
databases: {
|
|
48
|
+
defaultDatabase: '',
|
|
49
|
+
data: [
|
|
50
|
+
{
|
|
51
|
+
key: 'toc',
|
|
52
|
+
label: 'Toc',
|
|
53
|
+
url: 'https://data.cheminfo.org/nmr/database/toc.json',
|
|
54
|
+
enabled: true,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
51
58
|
};
|
|
@@ -39,10 +39,10 @@ exports.exercise = {
|
|
|
39
39
|
integralTool: true,
|
|
40
40
|
zonePickingTool: false,
|
|
41
41
|
slicingTool: false,
|
|
42
|
-
|
|
42
|
+
rangePickingTool: false,
|
|
43
43
|
zeroFillingTool: false,
|
|
44
44
|
phaseCorrectionTool: false,
|
|
45
|
-
|
|
45
|
+
baselineCorrectionTool: false,
|
|
46
46
|
FFTTool: false,
|
|
47
47
|
multipleSpectraAnalysisTool: false,
|
|
48
48
|
exclusionZonesTool: false,
|
|
@@ -187,15 +187,13 @@ function calculateFrequency(nucleus, frequency) {
|
|
|
187
187
|
if (typeof nucleus === 'string') {
|
|
188
188
|
return (0, nmr_processing_1.getFrequency)(nucleus, { nucleus: '1H', frequency });
|
|
189
189
|
}
|
|
190
|
+
else if (nucleus[0] === nucleus[1]) {
|
|
191
|
+
return `${frequency},${frequency}`;
|
|
192
|
+
}
|
|
190
193
|
else {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
return `${frequency},${(0, nmr_processing_1.getFrequency)(nucleus[1], {
|
|
196
|
-
nucleus: nucleus[0],
|
|
197
|
-
frequency,
|
|
198
|
-
})}`;
|
|
199
|
-
}
|
|
194
|
+
return `${frequency},${(0, nmr_processing_1.getFrequency)(nucleus[1], {
|
|
195
|
+
nucleus: nucleus[0],
|
|
196
|
+
frequency,
|
|
197
|
+
})}`;
|
|
200
198
|
}
|
|
201
199
|
}
|
|
@@ -109,7 +109,7 @@ function addJDF(spectra, jdf, options = {}, usedColors = {}) {
|
|
|
109
109
|
spectra.push(Data1DManager.fromCSD(converted, {
|
|
110
110
|
...options,
|
|
111
111
|
display: { ...options.display },
|
|
112
|
-
info
|
|
112
|
+
info,
|
|
113
113
|
meta: metadata,
|
|
114
114
|
}, usedColors));
|
|
115
115
|
}
|
|
@@ -145,9 +145,9 @@ exports.fromJSON = fromJSON;
|
|
|
145
145
|
async function addBruker(options, data, usedColors) {
|
|
146
146
|
const spectra = [];
|
|
147
147
|
let result = await (0, nmr_parser_1.fromBruker)(data, {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
converter: {
|
|
149
|
+
xy: true,
|
|
150
|
+
},
|
|
151
151
|
});
|
|
152
152
|
let entries = result;
|
|
153
153
|
for (let entry of entries) {
|
|
@@ -161,16 +161,11 @@ async function addBruker(options, data, usedColors) {
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
else if (info.dimension === 2) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}, usedColors));
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
// in case of 2D FID spectrum
|
|
173
|
-
}
|
|
164
|
+
spectra.push(Data2DManager.fromBruker(entry, {
|
|
165
|
+
...options,
|
|
166
|
+
info,
|
|
167
|
+
display: { ...options.display },
|
|
168
|
+
}, usedColors));
|
|
174
169
|
}
|
|
175
170
|
}
|
|
176
171
|
return spectra;
|
|
@@ -226,17 +221,13 @@ function getPreferences(state) {
|
|
|
226
221
|
: {}),
|
|
227
222
|
};
|
|
228
223
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
* @param {object} state
|
|
232
|
-
*/
|
|
233
|
-
function toJSON(state, dataExportOption = DataExportOptions.DATA_SOURCE) {
|
|
234
|
-
const { data, molecules: mols, correlations, multipleAnalysis, toolOptions: { data: { exclusionZones }, }, } = state || {
|
|
224
|
+
function toJSON(state, target, dataExportOption = DataExportOptions.DATA_SOURCE) {
|
|
225
|
+
const { data, molecules: mols, correlations, multipleAnalysis, actionType, } = state || {
|
|
235
226
|
data: [],
|
|
236
227
|
molecules: [],
|
|
237
228
|
correlations: {},
|
|
238
229
|
multipleAnalysis: {},
|
|
239
|
-
|
|
230
|
+
actionType: '',
|
|
240
231
|
};
|
|
241
232
|
const spectra = data.map((ob) => {
|
|
242
233
|
return ob.info.dimension === 1
|
|
@@ -246,12 +237,12 @@ function toJSON(state, dataExportOption = DataExportOptions.DATA_SOURCE) {
|
|
|
246
237
|
const preferences = getPreferences(state);
|
|
247
238
|
const molecules = mols.map((mol) => Molecule.toJSON(mol));
|
|
248
239
|
return {
|
|
240
|
+
...(target === 'onDataChange' ? { actionType } : {}),
|
|
241
|
+
version: MigrationManager_1.CURRENT_EXPORT_VERSION,
|
|
249
242
|
spectra,
|
|
250
243
|
molecules,
|
|
251
244
|
correlations,
|
|
252
245
|
multipleAnalysis,
|
|
253
|
-
exclusionZones,
|
|
254
|
-
version: MigrationManager_1.CURRENT_EXPORT_VERSION,
|
|
255
246
|
preferences,
|
|
256
247
|
};
|
|
257
248
|
}
|
|
@@ -4,7 +4,14 @@ exports.fromParsedJcamp = exports.fromCSD = exports.fromBruker = void 0;
|
|
|
4
4
|
const Spectrum1D_1 = require("./Spectrum1D");
|
|
5
5
|
function fromBruker(result, options = {}, usedColors = {}) {
|
|
6
6
|
const { dependentVariables, info, meta, source } = result;
|
|
7
|
-
let data =
|
|
7
|
+
let { data } = dependentVariables[0].components[0];
|
|
8
|
+
const { x, re, im } = data;
|
|
9
|
+
if (x[0] > x[1]) {
|
|
10
|
+
x.reverse();
|
|
11
|
+
re.reverse();
|
|
12
|
+
if (im)
|
|
13
|
+
im.reverse();
|
|
14
|
+
}
|
|
8
15
|
if (data.im)
|
|
9
16
|
info.isComplex = true;
|
|
10
17
|
if (Array.isArray(info.nucleus))
|
|
@@ -71,17 +71,15 @@ function createLinks(ranges, jGraphTolerance = 0) {
|
|
|
71
71
|
}
|
|
72
72
|
end++;
|
|
73
73
|
}
|
|
74
|
+
else if (Math.abs(couplings[end - 1].coupling - nextCoupling.coupling) <
|
|
75
|
+
jGraphTolerance) {
|
|
76
|
+
start = end - 1;
|
|
77
|
+
}
|
|
74
78
|
else {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
else {
|
|
80
|
-
index++;
|
|
81
|
-
links[index] = initLink(couplings[end]);
|
|
82
|
-
start = end;
|
|
83
|
-
end = end + 1;
|
|
84
|
-
}
|
|
79
|
+
index++;
|
|
80
|
+
links[index] = initLink(couplings[end]);
|
|
81
|
+
start = end;
|
|
82
|
+
end = end + 1;
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
85
|
return links;
|
|
@@ -22,7 +22,7 @@ const References_1 = require("../../constants/References");
|
|
|
22
22
|
function getReferenceShift(datum1D, options) {
|
|
23
23
|
let { from, to, nbPeaks, targetX, reference } = options;
|
|
24
24
|
if (reference) {
|
|
25
|
-
let data = (0, References_1.getRange)({ reference
|
|
25
|
+
let data = (0, References_1.getRange)({ reference, nucleus: datum1D.nucleus });
|
|
26
26
|
from = data.from;
|
|
27
27
|
to = data.to;
|
|
28
28
|
nbPeaks = data.nbPeaks;
|
|
@@ -10,13 +10,11 @@ function updateRelatives(data, key, check, forceCalculateIntegral = false) {
|
|
|
10
10
|
if (data.options.isSumConstant || forceCalculateIntegral) {
|
|
11
11
|
factor = currentSum > 0 ? options.sum / currentSum : 0.0;
|
|
12
12
|
}
|
|
13
|
-
else {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
item.absolute;
|
|
19
|
-
}
|
|
13
|
+
else if (data.values?.[0]) {
|
|
14
|
+
const item = data.values[0];
|
|
15
|
+
factor =
|
|
16
|
+
(item[key] ? item[key] : options.sum) /
|
|
17
|
+
item.absolute;
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
20
|
data.values = data.values.map((value) => {
|
|
@@ -19,7 +19,7 @@ function autoPeakPicking(datum1D, options) {
|
|
|
19
19
|
let peaks = (0, nmr_processing_1.xyAutoPeaksPicking)({ x, y: re }, {
|
|
20
20
|
lookNegative,
|
|
21
21
|
noiseLevel: noise * noiseFactor,
|
|
22
|
-
minMaxRatio
|
|
22
|
+
minMaxRatio,
|
|
23
23
|
realTopDetection: true,
|
|
24
24
|
smoothY: false,
|
|
25
25
|
sgOptions: { windowSize: 15, polynomial: 3 },
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.addRange = void 0;
|
|
6
|
+
exports.addRange = exports.createRangeObj = void 0;
|
|
7
7
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
8
8
|
const SignalsKinds_1 = require("../../../constants/SignalsKinds");
|
|
9
9
|
const generateID_1 = __importDefault(require("../../../utilities/generateID"));
|
|
@@ -11,30 +11,54 @@ const SumManager_1 = require("../SumManager");
|
|
|
11
11
|
const detectSignal_1 = __importDefault(require("./detectSignal"));
|
|
12
12
|
const mapRanges_1 = require("./mapRanges");
|
|
13
13
|
const updateRangesRelativeValues_1 = require("./updateRangesRelativeValues");
|
|
14
|
+
function createRangeObj({ from, to, absolute, id, signal, }) {
|
|
15
|
+
return {
|
|
16
|
+
id: id ? id : (0, generateID_1.default)(),
|
|
17
|
+
from,
|
|
18
|
+
to,
|
|
19
|
+
absolute,
|
|
20
|
+
signals: [{ id: (0, generateID_1.default)(), ...signal }],
|
|
21
|
+
kind: SignalsKinds_1.DatumKind.signal,
|
|
22
|
+
integration: 0,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
exports.createRangeObj = createRangeObj;
|
|
14
26
|
function addRange(datum, options) {
|
|
15
|
-
const { from, to, molecules, nucleus } = options;
|
|
27
|
+
const { from, to, id, molecules, nucleus } = options;
|
|
16
28
|
const { x, re } = datum.data;
|
|
17
29
|
const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from, to, reverse: true });
|
|
18
30
|
// detectSignal use the advance multiplet-analysis that can crash if too many points
|
|
19
31
|
const signal = (0, detectSignal_1.default)(x, re, from, to, datum.info.originFrequency);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
let range;
|
|
33
|
+
if (!signal) {
|
|
34
|
+
if (id === 'new') {
|
|
35
|
+
range = createRangeObj({
|
|
36
|
+
from,
|
|
37
|
+
to,
|
|
38
|
+
id,
|
|
39
|
+
absolute,
|
|
40
|
+
signal: { multiplicity: 's', kind: 'signal', delta: 0, js: [] },
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
range = createRangeObj({
|
|
25
46
|
from,
|
|
26
47
|
to,
|
|
48
|
+
id,
|
|
27
49
|
absolute,
|
|
28
|
-
|
|
29
|
-
kind: SignalsKinds_1.DatumKind.signal,
|
|
30
|
-
integration: 0,
|
|
31
|
-
};
|
|
32
|
-
datum.ranges.options = (0, SumManager_1.initSumOptions)(datum.ranges.options, {
|
|
33
|
-
molecules,
|
|
34
|
-
nucleus,
|
|
50
|
+
signal,
|
|
35
51
|
});
|
|
36
|
-
|
|
37
|
-
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
if (range) {
|
|
55
|
+
datum.ranges.options = (0, SumManager_1.initSumOptions)(datum.ranges.options, {
|
|
56
|
+
molecules,
|
|
57
|
+
nucleus,
|
|
58
|
+
});
|
|
59
|
+
datum.ranges.values = datum.ranges.values.concat((0, mapRanges_1.mapRanges)([range], datum));
|
|
60
|
+
(0, updateRangesRelativeValues_1.updateRangesRelativeValues)(datum);
|
|
61
|
+
}
|
|
38
62
|
}
|
|
39
63
|
catch (e) {
|
|
40
64
|
throw new Error('Could not calculate the multiplicity');
|
|
@@ -6,8 +6,8 @@ const multiplet_analysis_1 = require("multiplet-analysis");
|
|
|
6
6
|
exports.MAX_LENGTH = 2048;
|
|
7
7
|
function detectSignal(x, re, from, to, frequency) {
|
|
8
8
|
const { fromIndex, toIndex } = (0, ml_spectra_processing_1.xGetFromToIndex)(x, {
|
|
9
|
-
from
|
|
10
|
-
to
|
|
9
|
+
from,
|
|
10
|
+
to,
|
|
11
11
|
});
|
|
12
12
|
if (toIndex - fromIndex <= exports.MAX_LENGTH) {
|
|
13
13
|
const data = {
|
|
@@ -15,7 +15,7 @@ function detectSignal(x, re, from, to, frequency) {
|
|
|
15
15
|
y: re.subarray(fromIndex, toIndex),
|
|
16
16
|
};
|
|
17
17
|
const result = (0, multiplet_analysis_1.analyseMultiplet)(data, {
|
|
18
|
-
frequency
|
|
18
|
+
frequency,
|
|
19
19
|
takeBestPartMultiplet: true,
|
|
20
20
|
symmetrizeEachStep: true,
|
|
21
21
|
});
|
|
@@ -23,7 +23,7 @@ function mapRanges(ranges, datum) {
|
|
|
23
23
|
const shiftX = (0, getShiftX_1.getShiftX)(datum);
|
|
24
24
|
const error = (0, getSpectrumErrorValue_1.getSpectrumErrorValue)(datum);
|
|
25
25
|
return ranges.reduce((acc, newRange) => {
|
|
26
|
-
if (checkRange(newRange, datum, error))
|
|
26
|
+
if (checkRange(newRange, datum, error) && newRange.id !== 'new')
|
|
27
27
|
return acc;
|
|
28
28
|
const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from: newRange.from, to: newRange.to, reverse: true });
|
|
29
29
|
const signals = newRange.signals.map((signal) => {
|
|
@@ -3,23 +3,35 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.prepareData = exports.initiateDatabase = exports.
|
|
6
|
+
exports.prepareData = exports.initiateDatabase = exports.DATA_BASES = void 0;
|
|
7
7
|
const nmr_processing_1 = require("nmr-processing");
|
|
8
|
+
const openchemlib_utils_1 = require("openchemlib-utils");
|
|
9
|
+
const full_1 = __importDefault(require("openchemlib/full"));
|
|
8
10
|
const smart_array_filter_1 = require("smart-array-filter");
|
|
9
11
|
const generateID_1 = __importDefault(require("../utilities/generateID"));
|
|
10
|
-
exports.
|
|
12
|
+
exports.DATA_BASES = [
|
|
11
13
|
{
|
|
14
|
+
key: 'local_solvent',
|
|
12
15
|
label: 'Solvent database',
|
|
13
16
|
value: prepareDataBase([...nmr_processing_1.protonImpurities, ...nmr_processing_1.carbonImpurities]),
|
|
14
17
|
},
|
|
15
18
|
];
|
|
16
19
|
function initiateDatabase(databases, nucleus) {
|
|
17
20
|
const data = databases.filter((datum) => datum.nucleus === nucleus);
|
|
21
|
+
const moleculesDB = prepareMoleculesDB(data);
|
|
18
22
|
const getSolvents = () => prepareGetSolvents(data);
|
|
19
23
|
const search = (keywords = []) => (0, smart_array_filter_1.filter)(data, { keywords });
|
|
20
|
-
|
|
24
|
+
const searchByStructure = (idCode) => processSearchByStructure(moleculesDB, idCode);
|
|
25
|
+
return { searchByStructure, data, getSolvents, search };
|
|
21
26
|
}
|
|
22
27
|
exports.initiateDatabase = initiateDatabase;
|
|
28
|
+
function processSearchByStructure(moleculesDB, idCode) {
|
|
29
|
+
// default format { format: 'idCode' }
|
|
30
|
+
// https://github.com/cheminfo/openchemlib-utils/blob/ef3a9c30be7efe225a24de04ea9cefc9299674aa/src/db/MoleculesDB.js#L102-L115
|
|
31
|
+
// todo: idCode may be null and the current version of search requires a string or molecule. `|| ''` will become useless in next release of openchemlib-util
|
|
32
|
+
const result = moleculesDB.search(idCode || '');
|
|
33
|
+
return result.map((entry) => entry.data, []);
|
|
34
|
+
}
|
|
23
35
|
function prepareGetSolvents(data) {
|
|
24
36
|
const result = [];
|
|
25
37
|
const map = new Map();
|
|
@@ -37,6 +49,44 @@ function prepareGetSolvents(data) {
|
|
|
37
49
|
// return { id: index, name: label };
|
|
38
50
|
// });
|
|
39
51
|
// }
|
|
52
|
+
function prepareMoleculesDB(array) {
|
|
53
|
+
let moleculesDB = new openchemlib_utils_1.MoleculesDB(full_1.default);
|
|
54
|
+
for (let entry of array) {
|
|
55
|
+
//@ts-expect-error property will be defined in next release of nmr-processing
|
|
56
|
+
if (entry.ocl) {
|
|
57
|
+
try {
|
|
58
|
+
const molecule = full_1.default.Molecule.fromIDCode(
|
|
59
|
+
//@ts-expect-error property will be defined in next release of nmr-processing
|
|
60
|
+
entry.ocl.idCode,
|
|
61
|
+
//@ts-expect-error property will be defined in next release of nmr-processing
|
|
62
|
+
entry.ocl.coordinates);
|
|
63
|
+
moleculesDB.pushEntry(molecule, entry, {}, {
|
|
64
|
+
//@ts-expect-error property will be defined in next release of nmr-processing
|
|
65
|
+
idCode: entry.ocl.idCode,
|
|
66
|
+
//@ts-expect-error property will be defined in next release of nmr-processing
|
|
67
|
+
index: entry.ocl.index,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
// eslint-disable-next-line no-console
|
|
72
|
+
console.log(`Could not parse idCode: ${JSON.stringify(
|
|
73
|
+
//@ts-expect-error property will be defined in next release of nmr-processing
|
|
74
|
+
entry.ocl)}`, e);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
else if (entry.smiles) {
|
|
78
|
+
try {
|
|
79
|
+
const molecule = full_1.default.Molecule.fromSmiles(entry.smiles);
|
|
80
|
+
moleculesDB.pushEntry(molecule, entry);
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
// eslint-disable-next-line no-console
|
|
84
|
+
console.log(`Could not parse smiles: ${entry.smiles}`, e);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return moleculesDB;
|
|
89
|
+
}
|
|
40
90
|
function prepareDataBase(array) {
|
|
41
91
|
return array.map((item) => {
|
|
42
92
|
item.ranges = item.ranges.map((range) => ({
|
|
@@ -78,13 +128,13 @@ exports.prepareData = prepareData;
|
|
|
78
128
|
function mapJs(js) {
|
|
79
129
|
if (js && js.length > 0) {
|
|
80
130
|
const { coupling, multiplicity } = js.reduce((acc, { coupling, multiplicity }) => {
|
|
81
|
-
acc.coupling.push(coupling
|
|
131
|
+
acc.coupling.push(coupling);
|
|
82
132
|
acc.multiplicity += multiplicity;
|
|
83
133
|
return acc;
|
|
84
134
|
}, { coupling: [], multiplicity: '' });
|
|
85
135
|
return { multiplicity, coupling: coupling.join(',') };
|
|
86
136
|
}
|
|
87
137
|
else {
|
|
88
|
-
return { multiplicity: '
|
|
138
|
+
return { multiplicity: '', coupling: '' };
|
|
89
139
|
}
|
|
90
140
|
}
|