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
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const react_1 = require("react");
|
|
4
4
|
const ChartContext_1 = require("../../../context/ChartContext");
|
|
5
5
|
const Utilities_1 = require("./Utilities");
|
|
6
|
-
function
|
|
6
|
+
function useInView({ correlation }) {
|
|
7
7
|
const { data: spectraData, xDomain, yDomain, displayerMode, activeTab, activeSpectrum, } = (0, ChartContext_1.useChartData)();
|
|
8
8
|
return (0, react_1.useMemo)(() => (0, Utilities_1.isInView)(spectraData, activeTab, activeSpectrum, xDomain, yDomain, displayerMode, correlation), [
|
|
9
9
|
activeSpectrum,
|
|
@@ -15,4 +15,4 @@ function IsInView({ correlation }) {
|
|
|
15
15
|
yDomain,
|
|
16
16
|
]);
|
|
17
17
|
}
|
|
18
|
-
exports.default =
|
|
18
|
+
exports.default = useInView;
|
|
@@ -69,7 +69,7 @@ function ActionsColumn({ rowData, rowSpanTags }) {
|
|
|
69
69
|
const openEditZoneHandler = (0, react_1.useCallback)(() => {
|
|
70
70
|
dispatch({
|
|
71
71
|
type: Types_1.SET_SELECTED_TOOL,
|
|
72
|
-
payload: { selectedTool: ToolTypes_1.options.editRange.id
|
|
72
|
+
payload: { selectedTool: ToolTypes_1.options.editRange.id },
|
|
73
73
|
});
|
|
74
74
|
modal.show((0, jsx_runtime_1.jsx)(EditZoneModal_1.default, { onCloseEditZoneModal: () => modal.close(), onSaveEditZoneModal: saveEditZoneHandler, onZoomEditZoneModal: () => zoomZoneHandler(), rowData: rowData }), {
|
|
75
75
|
position: Modal_1.positions.MIDDLE_RIGHT,
|
|
@@ -130,18 +130,18 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, experiment }) {
|
|
|
130
130
|
const visibilityHandler = (0, react_2.useCallback)((key) => {
|
|
131
131
|
Events_1.default.emit('onZonesVisibilityChange', { key });
|
|
132
132
|
}, []);
|
|
133
|
-
return ((0, jsx_runtime_1.
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
133
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: [
|
|
134
|
+
BasicPanelStyle_1.tablePanelStyle,
|
|
135
|
+
style,
|
|
136
|
+
isFlipped &&
|
|
137
|
+
(0, react_1.css) `
|
|
138
|
+
th {
|
|
139
|
+
position: relative;
|
|
140
|
+
}
|
|
141
|
+
`,
|
|
142
|
+
], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter: zones.values ? zones.values.length : 0, onDelete: handleDeleteAll, deleteToolTip: "Delete All Zones", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all zones' : 'Hide zones out of view', filterIsActive: filterIsActive, counterFiltered: tableData?.length, showSettingButton: true, onSettingClick: settingsPanelHandler, children: [(0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: `Remove all Assignments`, popupPlacement: "right", children: (0, jsx_runtime_1.jsx)("button", { className: "remove-assignments-btn", type: "button", onClick: handleOnRemoveAssignments, disabled: !zones.values || zones.values.length === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaUnlink, {}) }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: "show/hide zones", popupPlacement: "right", defaultValue: true, onClick: () => visibilityHandler('zones'), children: (0, jsx_runtime_1.jsx)("span", { style: { fontSize: '12px', pointerEvents: 'none' }, children: "z" }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: "show/hide signals", popupPlacement: "right", defaultValue: true, onClick: () => visibilityHandler('signals'), children: (0, jsx_runtime_1.jsx)("span", { style: { fontSize: '12px', pointerEvents: 'none' }, children: "s" }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: "show/hide peaks", popupPlacement: "right", defaultValue: true, onClick: () => visibilityHandler('peaks'), children: (0, jsx_runtime_1.jsx)("span", { style: { fontSize: '12px', pointerEvents: 'none' }, children: "p" }) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)("div", { className: "table-container", children: tableData && tableData.length > 0 ? ((0, jsx_runtime_1.jsx)(ZonesTable_1.default, { tableData: tableData, onUnlink: unlinkZoneHandler, nuclei: activeTab && activeTab.split(',').length === 2
|
|
143
|
+
? activeTab.split(',')
|
|
144
|
+
: ['?', '?'], experiment: experiment })) : ((0, jsx_runtime_1.jsx)(NoTableData_1.default, {})) })) : ((0, jsx_runtime_1.jsx)(ZonesPreferences_1.default, { ref: settingRef })) })] }));
|
|
145
145
|
}
|
|
146
146
|
const MemoizedZonesPanel = (0, react_2.memo)(ZonesPanelInner);
|
|
147
147
|
const emptyData = { zones: {}, info: {} };
|
|
@@ -6,16 +6,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
7
|
/** @jsxImportSource @emotion/react */
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
|
+
const analysis_ui_components_1 = require("analysis-ui-components");
|
|
9
10
|
const react_2 = require("react");
|
|
11
|
+
const bs_1 = require("react-icons/bs");
|
|
10
12
|
const fa_1 = require("react-icons/fa");
|
|
11
13
|
const io5_1 = require("react-icons/io5");
|
|
12
14
|
const database_1 = require("../../../data/data1d/database");
|
|
13
15
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
14
16
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
17
|
+
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
18
|
+
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
15
19
|
const Input_1 = __importDefault(require("../../elements/Input"));
|
|
16
20
|
const Select_1 = __importDefault(require("../../elements/Select"));
|
|
17
21
|
const ToggleButton_1 = __importDefault(require("../../elements/ToggleButton"));
|
|
18
22
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
23
|
+
const Modal_1 = require("../../elements/popup/Modal");
|
|
19
24
|
const useFormatNumberByNucleus_1 = require("../../hooks/useFormatNumberByNucleus");
|
|
20
25
|
const useToolsFunctions_1 = __importDefault(require("../../hooks/useToolsFunctions"));
|
|
21
26
|
const Types_1 = require("../../reducer/types/Types");
|
|
@@ -27,8 +32,8 @@ const NoTableData_1 = __importDefault(require("../extra/placeholder/NoTableData"
|
|
|
27
32
|
const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
|
|
28
33
|
const PreferencesHeader_1 = __importDefault(require("../header/PreferencesHeader"));
|
|
29
34
|
const DatabasePreferences_1 = __importDefault(require("./DatabasePreferences"));
|
|
35
|
+
const DatabaseStructureSearchModal_1 = require("./DatabaseStructureSearchModal");
|
|
30
36
|
const DatabaseTable_1 = __importDefault(require("./DatabaseTable"));
|
|
31
|
-
const useDatabases_1 = require("./useDatabases");
|
|
32
37
|
const style = (0, react_1.css) `
|
|
33
38
|
.header {
|
|
34
39
|
height: 30px;
|
|
@@ -49,21 +54,24 @@ const emptyKeywords = {
|
|
|
49
54
|
solvent: '',
|
|
50
55
|
searchKeywords: '',
|
|
51
56
|
};
|
|
52
|
-
function DatabasePanelInner({ nucleus, selectedTool }) {
|
|
57
|
+
function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase, }) {
|
|
53
58
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
54
59
|
const alert = (0, Alert_1.useAlert)();
|
|
60
|
+
const modal = (0, Modal_1.useModal)();
|
|
61
|
+
const { item } = (0, analysis_ui_components_1.useAccordionContext)('Databases');
|
|
55
62
|
const { handleChangeOption } = (0, useToolsFunctions_1.default)();
|
|
56
63
|
const format = (0, useFormatNumberByNucleus_1.useFormatNumberByNucleus)(nucleus);
|
|
57
|
-
const databases = (0, useDatabases_1.useDatabases)();
|
|
58
64
|
const [isFlipped, setFlipStatus] = (0, react_2.useState)(false);
|
|
59
65
|
const settingRef = (0, react_2.useRef)();
|
|
60
66
|
const [keywords, setKeywords] = (0, react_2.useState)(emptyKeywords);
|
|
61
67
|
const databaseInstance = (0, react_2.useRef)(null);
|
|
68
|
+
const databaseDataRef = (0, react_2.useRef)([]);
|
|
62
69
|
const [result, setResult] = (0, react_2.useState)({
|
|
63
70
|
data: [],
|
|
64
71
|
databases: [],
|
|
65
72
|
solvents: [],
|
|
66
73
|
});
|
|
74
|
+
const [idCode, setIdCode] = (0, react_2.useState)();
|
|
67
75
|
const settingsPanelHandler = (0, react_2.useCallback)(() => {
|
|
68
76
|
setFlipStatus(!isFlipped);
|
|
69
77
|
}, [isFlipped]);
|
|
@@ -85,8 +93,9 @@ function DatabasePanelInner({ nucleus, selectedTool }) {
|
|
|
85
93
|
}, []);
|
|
86
94
|
(0, react_2.useEffect)(() => {
|
|
87
95
|
const { solvent, searchKeywords } = keywords;
|
|
88
|
-
setTimeout(() => {
|
|
96
|
+
setTimeout(async () => {
|
|
89
97
|
if (databaseInstance.current) {
|
|
98
|
+
const hideLoading = await alert.showLoading(`Preparing of the Result`);
|
|
90
99
|
if (!solvent && !searchKeywords) {
|
|
91
100
|
const data = databaseInstance.current.data;
|
|
92
101
|
const solvents = mapSolventsToSelect(databaseInstance.current.getSolvents());
|
|
@@ -100,9 +109,10 @@ function DatabasePanelInner({ nucleus, selectedTool }) {
|
|
|
100
109
|
const data = databaseInstance.current.search(values.join(' '));
|
|
101
110
|
setResult((prevResult) => ({ ...prevResult, data }));
|
|
102
111
|
}
|
|
112
|
+
hideLoading();
|
|
103
113
|
}
|
|
104
|
-
});
|
|
105
|
-
}, [keywords]);
|
|
114
|
+
}, 0);
|
|
115
|
+
}, [alert, keywords]);
|
|
106
116
|
(0, react_2.useEffect)(() => {
|
|
107
117
|
function handle(event) {
|
|
108
118
|
if (selectedTool === ToolTypes_1.options.databaseRangesSelection.id) {
|
|
@@ -124,14 +134,14 @@ function DatabasePanelInner({ nucleus, selectedTool }) {
|
|
|
124
134
|
Events_1.default.off('brushEnd', handle);
|
|
125
135
|
};
|
|
126
136
|
}, [format, selectedTool]);
|
|
127
|
-
const handleChangeDatabase = (0, react_2.useCallback)((
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
137
|
+
const handleChangeDatabase = (0, react_2.useCallback)((databaseKey) => {
|
|
138
|
+
const database = databases.find((item) => item.key === databaseKey);
|
|
139
|
+
setTimeout(async () => {
|
|
140
|
+
if (database?.url) {
|
|
141
|
+
const { url, label } = database;
|
|
132
142
|
const hideLoading = await alert.showLoading(`load ${label} database`);
|
|
133
143
|
try {
|
|
134
|
-
|
|
144
|
+
databaseDataRef.current = await fetch(url)
|
|
135
145
|
.then((response) => response.json())
|
|
136
146
|
.then((databaseRecords) => databaseRecords.map((record) => ({
|
|
137
147
|
...record,
|
|
@@ -146,24 +156,46 @@ function DatabasePanelInner({ nucleus, selectedTool }) {
|
|
|
146
156
|
}
|
|
147
157
|
}
|
|
148
158
|
else {
|
|
149
|
-
|
|
159
|
+
databaseDataRef.current = database
|
|
160
|
+
?.value;
|
|
150
161
|
}
|
|
151
|
-
|
|
162
|
+
const hideLoading = await alert.showLoading(`loading / preparing of the database`);
|
|
163
|
+
databaseInstance.current = (0, database_1.initiateDatabase)(databaseDataRef.current, nucleus);
|
|
152
164
|
setKeywords({ ...emptyKeywords });
|
|
153
|
-
|
|
165
|
+
hideLoading();
|
|
166
|
+
}, 0);
|
|
154
167
|
}, [alert, databases, nucleus]);
|
|
168
|
+
(0, react_2.useEffect)(() => {
|
|
169
|
+
setTimeout(async () => {
|
|
170
|
+
if (databaseInstance.current) {
|
|
171
|
+
const hideLoading = await alert.showLoading(`loading / preparing of the database`);
|
|
172
|
+
databaseInstance.current = (0, database_1.initiateDatabase)(databaseDataRef.current, nucleus);
|
|
173
|
+
hideLoading();
|
|
174
|
+
setKeywords({ ...emptyKeywords });
|
|
175
|
+
}
|
|
176
|
+
}, 0);
|
|
177
|
+
}, [alert, nucleus]);
|
|
178
|
+
(0, react_2.useEffect)(() => {
|
|
179
|
+
if (item?.isOpen && defaultDatabase && !databaseInstance.current) {
|
|
180
|
+
handleChangeDatabase(defaultDatabase);
|
|
181
|
+
}
|
|
182
|
+
}, [databases, defaultDatabase, handleChangeDatabase, item?.isOpen, nucleus]);
|
|
155
183
|
const tableData = (0, react_2.useMemo)(() => {
|
|
156
184
|
return (0, database_1.prepareData)(result.data);
|
|
157
185
|
}, [result.data]);
|
|
158
186
|
const resurrectHandler = (0, react_2.useCallback)((row) => {
|
|
159
187
|
const { index, baseURL, jcampURL: jcampRelativeURL } = row.original;
|
|
188
|
+
const { ranges, solvent, names = [] } = result.data[index];
|
|
160
189
|
if (jcampRelativeURL) {
|
|
161
|
-
|
|
190
|
+
setTimeout(async () => {
|
|
162
191
|
const hideLoading = await alert.showLoading(`load jcamp in progress...`);
|
|
163
192
|
try {
|
|
164
193
|
const jcampURL = new URL(jcampRelativeURL, baseURL);
|
|
165
194
|
const result = await (0, FileUtility_1.loadFile)(jcampURL);
|
|
166
|
-
dispatch({
|
|
195
|
+
dispatch({
|
|
196
|
+
type: Types_1.RESURRECTING_SPECTRUM_FROM_JCAMP,
|
|
197
|
+
payload: { file: result, ranges, jcampURL },
|
|
198
|
+
});
|
|
167
199
|
}
|
|
168
200
|
catch (e) {
|
|
169
201
|
alert.error(`Failed to load Jcamp`);
|
|
@@ -171,10 +203,9 @@ function DatabasePanelInner({ nucleus, selectedTool }) {
|
|
|
171
203
|
finally {
|
|
172
204
|
hideLoading();
|
|
173
205
|
}
|
|
174
|
-
})
|
|
206
|
+
}, 0);
|
|
175
207
|
}
|
|
176
208
|
else {
|
|
177
|
-
const { ranges, solvent, names = [] } = result.data[index];
|
|
178
209
|
dispatch({
|
|
179
210
|
type: Types_1.RESURRECTING_SPECTRUM_FROM_RANGES,
|
|
180
211
|
payload: { ranges, info: { solvent, nucleus, name: names[0] } },
|
|
@@ -188,6 +219,22 @@ function DatabasePanelInner({ nucleus, selectedTool }) {
|
|
|
188
219
|
const tool = !flag ? ToolTypes_1.options.zoom.id : ToolTypes_1.options.databaseRangesSelection.id;
|
|
189
220
|
handleChangeOption(tool);
|
|
190
221
|
}, [handleChangeOption]);
|
|
222
|
+
const searchByStructureHandler = (idCodeValue) => {
|
|
223
|
+
setTimeout(async () => {
|
|
224
|
+
const hideLoading = await alert.showLoading(`Searching in progress...`);
|
|
225
|
+
const data = databaseInstance.current?.searchByStructure(idCodeValue) || [];
|
|
226
|
+
setResult((prevResult) => ({ ...prevResult, data }));
|
|
227
|
+
setIdCode(idCodeValue);
|
|
228
|
+
hideLoading();
|
|
229
|
+
}, 0);
|
|
230
|
+
};
|
|
231
|
+
const openSearchByStructure = () => {
|
|
232
|
+
modal.show((0, jsx_runtime_1.jsx)(DatabaseStructureSearchModal_1.DatabaseStructureSearchModal, { onChange: searchByStructureHandler, idCode: idCode }), {
|
|
233
|
+
position: Modal_1.positions.MIDDLE,
|
|
234
|
+
transition: Modal_1.transitions.SCALE,
|
|
235
|
+
isBackgroundBlur: false,
|
|
236
|
+
});
|
|
237
|
+
};
|
|
191
238
|
return ((0, jsx_runtime_1.jsxs)("div", { css: [
|
|
192
239
|
BasicPanelStyle_1.tablePanelStyle,
|
|
193
240
|
style,
|
|
@@ -204,16 +251,23 @@ function DatabasePanelInner({ nucleus, selectedTool }) {
|
|
|
204
251
|
pointerEvents: 'none',
|
|
205
252
|
fontSize: '12px',
|
|
206
253
|
transform: 'rotate(90deg)',
|
|
207
|
-
} }) }, `${selectedTool}`), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 2 }, data: mapDatabasesToSelect(databases), onChange: handleChangeDatabase, placeholder: "Select database" }), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 1 }, data: result.solvents, placeholder: "Solvent", onChange: handleSearch }), (0, jsx_runtime_1.jsx)(Input_1.default, { value: keywords.searchKeywords, renderIcon: () => (0, jsx_runtime_1.jsx)(io5_1.IoSearchOutline, {}), style: { inputWrapper: { flex: 3 } }, className: "search-input", type: "text", debounceTime: 250, placeholder: "Search for parameter...", onChange: handleSearch, onClear: clearHandler, canClear: true })
|
|
254
|
+
} }) }, `${selectedTool}`), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 2 }, data: mapDatabasesToSelect(databases), onChange: handleChangeDatabase, placeholder: "Select database", defaultValue: defaultDatabase }), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 1 }, data: result.solvents, placeholder: "Solvent", onChange: handleSearch }), (0, jsx_runtime_1.jsx)(Input_1.default, { value: keywords.searchKeywords, renderIcon: () => (0, jsx_runtime_1.jsx)(io5_1.IoSearchOutline, {}), style: { inputWrapper: { flex: 3 } }, className: "search-input", type: "text", debounceTime: 250, placeholder: "Search for parameter...", onChange: handleSearch, onClear: clearHandler, canClear: true }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", onClick: openSearchByStructure, style: { marginLeft: '5px' }, children: !idCode ? ((0, jsx_runtime_1.jsx)(bs_1.BsHexagon, { style: {
|
|
255
|
+
fontSize: '14px',
|
|
256
|
+
} })) : ((0, jsx_runtime_1.jsx)(bs_1.BsHexagonFill, { style: {
|
|
257
|
+
fontSize: '14px',
|
|
258
|
+
} })) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? (tableData && tableData.length > 0 ? ((0, jsx_runtime_1.jsx)(DatabaseTable_1.default, { data: tableData, onAdd: resurrectHandler })) : ((0, jsx_runtime_1.jsx)(NoTableData_1.default, { text: databases && databases?.length > 0
|
|
208
259
|
? 'Please select a database'
|
|
209
260
|
: 'Please add databases URL in the general preferences' }))) : ((0, jsx_runtime_1.jsx)(DatabasePreferences_1.default, { ref: settingRef })) })] }));
|
|
210
261
|
}
|
|
211
262
|
const MemoizedDatabasePanel = (0, react_2.memo)(DatabasePanelInner);
|
|
212
263
|
function PeaksPanel() {
|
|
213
264
|
const { activeTab, toolOptions: { selectedTool }, } = (0, ChartContext_1.useChartData)();
|
|
265
|
+
const { current } = (0, PreferencesContext_1.usePreferences)();
|
|
266
|
+
const { data, defaultDatabase } = current.databases;
|
|
267
|
+
const databases = database_1.DATA_BASES.concat(data.filter((datum) => datum.enabled));
|
|
214
268
|
if (!activeTab)
|
|
215
269
|
return (0, jsx_runtime_1.jsx)("div", {});
|
|
216
|
-
return ((0, jsx_runtime_1.jsx)(MemoizedDatabasePanel, { nucleus: activeTab, selectedTool: selectedTool }));
|
|
270
|
+
return ((0, jsx_runtime_1.jsx)(MemoizedDatabasePanel, { nucleus: activeTab, selectedTool: selectedTool, databases: databases, defaultDatabase: defaultDatabase }));
|
|
217
271
|
}
|
|
218
272
|
exports.default = PeaksPanel;
|
|
219
273
|
function mapSolventsToSelect(solvents) {
|
|
@@ -228,9 +282,9 @@ function mapSolventsToSelect(solvents) {
|
|
|
228
282
|
return result;
|
|
229
283
|
}
|
|
230
284
|
function mapDatabasesToSelect(databases) {
|
|
231
|
-
return databases.map(({ label }
|
|
232
|
-
key
|
|
233
|
-
value:
|
|
285
|
+
return databases.map(({ label, key }) => ({
|
|
286
|
+
key,
|
|
287
|
+
value: key,
|
|
234
288
|
label,
|
|
235
289
|
}));
|
|
236
290
|
}
|
|
@@ -35,6 +35,6 @@ function DatabasePreferences(props, ref) {
|
|
|
35
35
|
formRef.current.submitForm();
|
|
36
36
|
},
|
|
37
37
|
}));
|
|
38
|
-
return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { onSubmit: saveHandler, ref: formRef, children: [(0, jsx_runtime_1.jsxs)(PreferencesGroup_1.PreferencesGroup, { children: [(0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Preview jcamp", checkControllerName: "previewJcamp", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColorInput_1.default, { name: "color" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Margin bottom (px) :", style: { label: { padding: 0, flex: 4 }, wrapper: { flex: 8 } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "marginBottom", type: "number" }) })] }), (0, jsx_runtime_1.jsxs)(PreferencesGroup_1.PreferencesGroup, { header: "Table Preferences", children: [(0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Structure", checkControllerName: "showSmiles", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Solvent", checkControllerName: "showSolvent", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Names", checkControllerName: "showNames", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Range", checkControllerName: "
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { onSubmit: saveHandler, ref: formRef, children: [(0, jsx_runtime_1.jsxs)(PreferencesGroup_1.PreferencesGroup, { children: [(0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Preview jcamp", checkControllerName: "previewJcamp", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColorInput_1.default, { name: "color" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Margin bottom (px) :", style: { label: { padding: 0, flex: 4 }, wrapper: { flex: 8 } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "marginBottom", type: "number" }) })] }), (0, jsx_runtime_1.jsxs)(PreferencesGroup_1.PreferencesGroup, { header: "Table Preferences", children: [(0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Structure", checkControllerName: "showSmiles", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Solvent", checkControllerName: "showSolvent", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Names", checkControllerName: "showNames", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Range", checkControllerName: "range.show", formatControllerName: "range.format" }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "\u03B4 (ppm)", checkControllerName: "delta.show", formatControllerName: "delta.format" }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Assignment", checkControllerName: "showAssignment", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "J (Hz)", checkControllerName: "coupling.show", formatControllerName: "coupling.format" }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Multiplicity", checkControllerName: "showMultiplicity", hideFormatField: true })] })] }) }));
|
|
39
39
|
}
|
|
40
40
|
exports.default = (0, react_1.forwardRef)(DatabasePreferences);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DatabaseStructureSearchModal = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
8
|
+
/** @jsxImportSource @emotion/react */
|
|
9
|
+
const full_1 = require("react-ocl/full");
|
|
10
|
+
const CloseButton_1 = __importDefault(require("../../elements/CloseButton"));
|
|
11
|
+
const ModalStyle_1 = require("../../modal/ModalStyle");
|
|
12
|
+
function DatabaseStructureSearchModal({ onChange, idCode, onClose, }) {
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Search by structure" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { className: "main-content", children: (0, jsx_runtime_1.jsx)(full_1.StructureEditor, { initialIDCode: idCode, svgMenu: true, fragment: true, onChange: (mplFile, molecule, idCode) => onChange(idCode) }) })] }));
|
|
14
|
+
}
|
|
15
|
+
exports.DatabaseStructureSearchModal = DatabaseStructureSearchModal;
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
7
|
/** @jsxImportSource @emotion/react */
|
|
8
|
+
const get_1 = __importDefault(require("lodash/get"));
|
|
8
9
|
const react_1 = require("react");
|
|
9
10
|
const react_d3_utils_1 = require("react-d3-utils");
|
|
10
11
|
const fa_1 = require("react-icons/fa");
|
|
@@ -13,12 +14,13 @@ const ReactTable_1 = __importDefault(require("../../elements/ReactTable/ReactTab
|
|
|
13
14
|
const addCustomColumn_1 = __importDefault(require("../../elements/ReactTable/utility/addCustomColumn"));
|
|
14
15
|
const highlight_1 = require("../../highlight");
|
|
15
16
|
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
17
|
+
const formatNumber_1 = require("../../utility/formatNumber");
|
|
16
18
|
const overFlowStyle = {
|
|
17
19
|
overflow: 'hidden',
|
|
18
20
|
whiteSpace: 'nowrap',
|
|
19
21
|
textOverflow: 'ellipsis',
|
|
20
22
|
};
|
|
21
|
-
const
|
|
23
|
+
const databaseTableColumns = (databasePreferences) => [
|
|
22
24
|
{
|
|
23
25
|
showWhen: 'showNames',
|
|
24
26
|
index: 1,
|
|
@@ -33,17 +35,20 @@ const COLUMNS = [
|
|
|
33
35
|
},
|
|
34
36
|
},
|
|
35
37
|
{
|
|
36
|
-
showWhen: '
|
|
38
|
+
showWhen: 'range.show',
|
|
37
39
|
index: 2,
|
|
38
40
|
Header: 'From - To',
|
|
39
|
-
accessor: (row) =>
|
|
41
|
+
accessor: (row) => {
|
|
42
|
+
const rangeFormat = databasePreferences.range.format;
|
|
43
|
+
return `${(0, formatNumber_1.formatNumber)(row.from, rangeFormat)} - ${(0, formatNumber_1.formatNumber)(row.to, rangeFormat)}`;
|
|
44
|
+
},
|
|
40
45
|
enableRowSpan: true,
|
|
41
46
|
},
|
|
42
47
|
{
|
|
43
|
-
showWhen: '
|
|
48
|
+
showWhen: 'delta.show',
|
|
44
49
|
index: 3,
|
|
45
50
|
Header: 'δ (ppm)',
|
|
46
|
-
accessor:
|
|
51
|
+
accessor: (row) => `${(0, formatNumber_1.formatNumber)(row.delta, databasePreferences.delta.format)}`,
|
|
47
52
|
},
|
|
48
53
|
{
|
|
49
54
|
showWhen: 'showAssignment',
|
|
@@ -58,10 +63,10 @@ const COLUMNS = [
|
|
|
58
63
|
accessor: 'multiplicity',
|
|
59
64
|
},
|
|
60
65
|
{
|
|
61
|
-
showWhen: '
|
|
66
|
+
showWhen: 'coupling.show',
|
|
62
67
|
index: 6,
|
|
63
68
|
Header: 'J (Hz)',
|
|
64
|
-
accessor:
|
|
69
|
+
accessor: (row) => `${(0, formatNumber_1.formatNumber)(row.coupling, databasePreferences.coupling.format)}`,
|
|
65
70
|
style: {
|
|
66
71
|
width: '60px',
|
|
67
72
|
minWidth: '60px',
|
|
@@ -120,9 +125,9 @@ function DatabaseTable({ data, onAdd }) {
|
|
|
120
125
|
], [onAdd]);
|
|
121
126
|
const tableColumns = (0, react_1.useMemo)(() => {
|
|
122
127
|
let columns = [...initialColumns];
|
|
123
|
-
for (const col of
|
|
128
|
+
for (const col of databaseTableColumns(databasePreferences)) {
|
|
124
129
|
const { showWhen, ...colParams } = col;
|
|
125
|
-
if (databasePreferences
|
|
130
|
+
if ((0, get_1.default)(databasePreferences, showWhen, false)) {
|
|
126
131
|
(0, addCustomColumn_1.default)(columns, colParams);
|
|
127
132
|
}
|
|
128
133
|
}
|
|
@@ -12,11 +12,9 @@ class ColumnsHelper {
|
|
|
12
12
|
this.defaultPreference = defaultPreference;
|
|
13
13
|
}
|
|
14
14
|
checkPreferences(preferencesToCheck, key) {
|
|
15
|
-
const val = preferencesToCheck === undefined ||
|
|
15
|
+
const val = !!(preferencesToCheck === undefined ||
|
|
16
16
|
Object.keys(preferencesToCheck).length === 0 ||
|
|
17
|
-
(preferencesToCheck && preferencesToCheck[key] === true)
|
|
18
|
-
? true
|
|
19
|
-
: false;
|
|
17
|
+
(preferencesToCheck && preferencesToCheck[key] === true));
|
|
20
18
|
return val;
|
|
21
19
|
}
|
|
22
20
|
setCustomColumn(array, index, columnLabel, cellHandler) {
|
|
@@ -40,9 +40,7 @@ const styles = (0, react_1.css) `
|
|
|
40
40
|
}
|
|
41
41
|
`;
|
|
42
42
|
function DefaultPanelHeader({ counter, onDelete = () => null, deleteToolTip = 'Delete', onFilter = () => null, filterToolTip = '', filterIsActive = false, counterFiltered = 0, children, onSettingClick = () => null, showSettingButton = false, canDelete = true, style = {}, className = '', }) {
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: styles, ...{ style, className }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "left-container", children: [canDelete && ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: deleteToolTip, popupPlacement: "right", children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onDelete, disabled: counter === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) }) })), filterToolTip ? ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: filterToolTip, popupPlacement: "right", onClick: onFilter, defaultValue: filterIsActive, children: (0, jsx_runtime_1.jsx)(fa_1.FaFilter, { style: { pointerEvents: 'none', fontSize: '12px' } }) })) : null, children] }), counter !== undefined && ((0, jsx_runtime_1.jsxs)("p", { className: "counter-label", children: ["[", ' ', filterIsActive &&
|
|
44
|
-
filterIsActive === true &&
|
|
45
|
-
counterFiltered !== undefined
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: styles, ...{ style, className }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "left-container", children: [canDelete && ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: deleteToolTip, popupPlacement: "right", children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onDelete, disabled: counter === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) }) })), filterToolTip ? ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: filterToolTip, popupPlacement: "right", onClick: onFilter, defaultValue: filterIsActive, children: (0, jsx_runtime_1.jsx)(fa_1.FaFilter, { style: { pointerEvents: 'none', fontSize: '12px' } }) })) : null, children] }), counter !== undefined && ((0, jsx_runtime_1.jsxs)("p", { className: "counter-label", children: ["[", ' ', filterIsActive && counterFiltered !== undefined
|
|
46
44
|
? `${counterFiltered}/${counter}`
|
|
47
45
|
: counter, ' ', "]"] })), showSettingButton && ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: "preferences", popupPlacement: "left", children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onSettingClick, children: (0, jsx_runtime_1.jsx)(fa_1.FaCog, {}) }) }))] }));
|
|
48
46
|
}
|
|
@@ -29,7 +29,7 @@ function SpectraAutomaticPickingButton() {
|
|
|
29
29
|
})();
|
|
30
30
|
}, [dispatch, alert]);
|
|
31
31
|
if ((Array.isArray(data) && data.length === 0) ||
|
|
32
|
-
!isToolVisible('
|
|
32
|
+
!isToolVisible('rangePickingTool')) {
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
35
|
return ((0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Automatic Ranges/Zones picking for all spectra", onClick: automaticPickingHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrRangePicking, {}) }));
|
|
@@ -112,11 +112,13 @@ const getInitialState = () => ({
|
|
|
112
112
|
selectedTool: ToolTypes_1.options.zoom.id,
|
|
113
113
|
selectedOptionPanel: null,
|
|
114
114
|
data: {
|
|
115
|
-
|
|
115
|
+
baselineCorrection: {
|
|
116
|
+
options: {},
|
|
117
|
+
zones: [],
|
|
118
|
+
},
|
|
116
119
|
pivot: { value: 0, index: 0 },
|
|
117
120
|
zonesNoiseFactor: 1,
|
|
118
121
|
activeFilterID: null,
|
|
119
|
-
tempRange: null,
|
|
120
122
|
showMultiplicityTrees: false,
|
|
121
123
|
showRangesIntegrals: true,
|
|
122
124
|
showJGraph: false,
|
|
@@ -284,6 +286,10 @@ function innerSpectrumReducer(draft, action) {
|
|
|
284
286
|
return FiltersActions.handleAddExclusionZone(draft, action);
|
|
285
287
|
case types.DELETE_EXCLUSION_ZONE:
|
|
286
288
|
return FiltersActions.handleDeleteExclusionZone(draft, action);
|
|
289
|
+
case types.APPLY_BASE_LINE_CORRECTION_FILTER:
|
|
290
|
+
return FiltersActions.handleBaseLineCorrectionFilter(draft, action);
|
|
291
|
+
case types.CALCULATE_BASE_LINE_CORRECTION_FILTER:
|
|
292
|
+
return FiltersActions.calculateBaseLineCorrection(draft, action);
|
|
287
293
|
case types.CHANGE_VISIBILITY:
|
|
288
294
|
return SpectrumsActions.handleSpectrumVisibility(draft, action);
|
|
289
295
|
case types.CHANGE_PEAKS_MARKERS_VISIBILITY:
|
|
@@ -372,8 +378,8 @@ function innerSpectrumReducer(draft, action) {
|
|
|
372
378
|
return RangesActions.handleUnlinkRange(draft, action);
|
|
373
379
|
case types.SET_DIAID_RANGE:
|
|
374
380
|
return RangesActions.handleSetDiaIDRange(draft, action);
|
|
375
|
-
case types.
|
|
376
|
-
return RangesActions.
|
|
381
|
+
case types.UPDATE_RANGE:
|
|
382
|
+
return RangesActions.handleUpdateRange(draft, action);
|
|
377
383
|
case types.SHOW_MULTIPLICTY_TREES:
|
|
378
384
|
return RangesActions.handleShowMultiplicityTrees(draft);
|
|
379
385
|
case types.SHOW_RANGES_INTEGRALS:
|
|
@@ -388,8 +394,6 @@ function innerSpectrumReducer(draft, action) {
|
|
|
388
394
|
return ToolsActions.handleAddBaseLineZone(draft, action.zone);
|
|
389
395
|
case types.DELETE_BASE_LINE_ZONE:
|
|
390
396
|
return ToolsActions.handleDeleteBaseLineZone(draft, action.id);
|
|
391
|
-
case types.APPLY_BASE_LINE_CORRECTION_FILTER:
|
|
392
|
-
return FiltersActions.handleBaseLineCorrectionFilter(draft, action);
|
|
393
397
|
case types.SET_KEY_PREFERENCES:
|
|
394
398
|
return (0, PreferencesActions_1.setKeyPreferencesHandler)(draft, action.keyCode);
|
|
395
399
|
case types.APPLY_KEY_PREFERENCES:
|
|
@@ -429,7 +433,9 @@ function innerSpectrumReducer(draft, action) {
|
|
|
429
433
|
case types.FILTER_SPECTRA_COLUMN:
|
|
430
434
|
return SpectraAnalysisActions.handleFilterColumn(draft, action);
|
|
431
435
|
case types.RESURRECTING_SPECTRUM_FROM_RANGES:
|
|
432
|
-
return DatabaseActions.
|
|
436
|
+
return DatabaseActions.handleResurrectSpectrumFromRanges(draft, action);
|
|
437
|
+
case types.RESURRECTING_SPECTRUM_FROM_JCAMP:
|
|
438
|
+
return DatabaseActions.handleResurrectSpectrumFromJcamp(draft, action);
|
|
433
439
|
case types.SET_AUTOMATIC_ASSIGNMENTS:
|
|
434
440
|
return AssignmentsActions.setAutomaticAssignmentsHandler(draft, action);
|
|
435
441
|
case HistoryTypes_1.UNDO:
|
|
@@ -441,7 +447,6 @@ function innerSpectrumReducer(draft, action) {
|
|
|
441
447
|
case types.SET_MOUSE_OVER_DISPLAYER:
|
|
442
448
|
return GlobalActions.setIsOverDisplayer(draft, action);
|
|
443
449
|
default:
|
|
444
|
-
return;
|
|
445
450
|
}
|
|
446
451
|
}
|
|
447
452
|
exports.spectrumReducer = (0, immer_1.produce)(innerSpectrumReducer);
|
|
@@ -1,14 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.handleResurrectSpectrumFromJcamp = exports.handleResurrectSpectrumFromRanges = void 0;
|
|
4
|
+
const SpectraManager_1 = require("../../../data/SpectraManager");
|
|
5
|
+
const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
|
|
4
6
|
const generateSpectrumFromRanges_1 = require("../../../data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges");
|
|
5
7
|
const Zoom1DManager_1 = require("../helper/Zoom1DManager");
|
|
6
8
|
const DomainActions_1 = require("./DomainActions");
|
|
7
|
-
function
|
|
9
|
+
function handleResurrectSpectrumFromJcamp(draft, action) {
|
|
10
|
+
const { ranges, file, jcampURL } = action.payload;
|
|
11
|
+
let spectra = [];
|
|
12
|
+
(0, SpectraManager_1.addJcamp)(spectra, file, {
|
|
13
|
+
source: {
|
|
14
|
+
jcampURL,
|
|
15
|
+
},
|
|
16
|
+
}, draft.usedColors);
|
|
17
|
+
const spectrum = spectra[0];
|
|
18
|
+
spectrum.ranges.values = (0, Spectrum1D_1.mapRanges)(ranges, spectrum);
|
|
19
|
+
draft.data.push(spectrum);
|
|
20
|
+
(0, DomainActions_1.setDomain)(draft);
|
|
21
|
+
(0, DomainActions_1.setIntegralsYDomain)(draft, [spectrum]);
|
|
22
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8, spectrumID: spectrum.id });
|
|
23
|
+
}
|
|
24
|
+
exports.handleResurrectSpectrumFromJcamp = handleResurrectSpectrumFromJcamp;
|
|
25
|
+
function handleResurrectSpectrumFromRanges(draft, action) {
|
|
8
26
|
const { ranges, info } = action.payload;
|
|
9
27
|
const datum = (0, generateSpectrumFromRanges_1.generateSpectrumFromRanges)(ranges, info, draft.usedColors);
|
|
10
28
|
draft.data.push(datum);
|
|
11
29
|
(0, DomainActions_1.setDomain)(draft, { yDomain: { isShared: false } });
|
|
30
|
+
(0, DomainActions_1.setIntegralsYDomain)(draft, [datum]);
|
|
12
31
|
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8, spectrumID: datum.id });
|
|
13
32
|
}
|
|
14
|
-
exports.
|
|
33
|
+
exports.handleResurrectSpectrumFromRanges = handleResurrectSpectrumFromRanges;
|
|
@@ -26,12 +26,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.handleDeleteExclusionZone = exports.handleAddExclusionZone = exports.resetSpectrumByFilter = exports.filterSnapshotHandler = exports.handleBaseLineCorrectionFilter = exports.deleteSpectraFilter = exports.deleteFilter = exports.enableFilter = exports.handleMultipleSpectraFilter = exports.calculateManualPhaseCorrection = exports.applyAbsoluteFilter = exports.applyAutoPhaseCorrectionFilter = exports.applyManualPhaseCorrectionFilter = exports.applyFFTFilter = exports.applyZeroFillingFilter = exports.shiftSpectrumAlongXAxis = void 0;
|
|
29
|
+
exports.handleDeleteExclusionZone = exports.handleAddExclusionZone = exports.resetSpectrumByFilter = exports.filterSnapshotHandler = exports.handleBaseLineCorrectionFilter = exports.deleteSpectraFilter = exports.deleteFilter = exports.enableFilter = exports.handleMultipleSpectraFilter = exports.calculateBaseLineCorrection = exports.calculateManualPhaseCorrection = exports.applyAbsoluteFilter = exports.applyAutoPhaseCorrectionFilter = exports.applyManualPhaseCorrectionFilter = exports.applyFFTFilter = exports.applyZeroFillingFilter = exports.shiftSpectrumAlongXAxis = void 0;
|
|
30
30
|
const immer_1 = require("immer");
|
|
31
31
|
const Filters = __importStar(require("../../../data/Filters"));
|
|
32
32
|
const FiltersManager = __importStar(require("../../../data/FiltersManager"));
|
|
33
33
|
const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
|
|
34
34
|
const autoPhaseCorrection_1 = require("../../../data/data1d/filter1d/autoPhaseCorrection");
|
|
35
|
+
const baselineCorrection_1 = require("../../../data/data1d/filter1d/baselineCorrection");
|
|
35
36
|
const phaseCorrection_1 = require("../../../data/data1d/filter1d/phaseCorrection");
|
|
36
37
|
const Spectrum2D_1 = require("../../../data/data2d/Spectrum2D");
|
|
37
38
|
const generateID_1 = __importDefault(require("../../../data/utilities/generateID"));
|
|
@@ -124,12 +125,33 @@ function applyAutoPhaseCorrectionFilter(draft) {
|
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
127
|
exports.applyAutoPhaseCorrectionFilter = applyAutoPhaseCorrectionFilter;
|
|
128
|
+
function calculateBaseLineCorrection(draft, action) {
|
|
129
|
+
if (draft.activeSpectrum) {
|
|
130
|
+
const { index } = draft.activeSpectrum;
|
|
131
|
+
const { data: { x, re, im }, info, } = draft.data[index];
|
|
132
|
+
// save the baseline options temporary
|
|
133
|
+
draft.toolOptions.data.baselineCorrection = {
|
|
134
|
+
...draft.toolOptions.data.baselineCorrection,
|
|
135
|
+
...(action?.options ? { options: action.options } : {}),
|
|
136
|
+
};
|
|
137
|
+
const { zones, options } = draft.toolOptions.data.baselineCorrection;
|
|
138
|
+
let _data = { data: { x, re, im }, info };
|
|
139
|
+
(0, baselineCorrection_1.apply)(_data, {
|
|
140
|
+
zones,
|
|
141
|
+
...options,
|
|
142
|
+
});
|
|
143
|
+
const { im: newIm, re: newRe } = _data.data;
|
|
144
|
+
draft.tempData[index].data.im = newIm;
|
|
145
|
+
draft.tempData[index].data.re = newRe;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
exports.calculateBaseLineCorrection = calculateBaseLineCorrection;
|
|
127
149
|
function calculateManualPhaseCorrection(draft, filterOptions) {
|
|
128
150
|
if (draft.activeSpectrum) {
|
|
129
151
|
const { index } = draft.activeSpectrum;
|
|
130
152
|
const { data: { x, re, im }, info, } = draft.data[index];
|
|
131
153
|
const { ph0, ph1 } = filterOptions;
|
|
132
|
-
let _data = { data: { x
|
|
154
|
+
let _data = { data: { x, re, im }, info };
|
|
133
155
|
(0, phaseCorrection_1.apply)(_data, { ph0, ph1 });
|
|
134
156
|
const { im: newIm, re: newRe } = _data.data;
|
|
135
157
|
draft.tempData[index].data.im = newIm;
|
|
@@ -204,16 +226,16 @@ exports.deleteSpectraFilter = deleteSpectraFilter;
|
|
|
204
226
|
function handleBaseLineCorrectionFilter(draft, action) {
|
|
205
227
|
if (draft.activeSpectrum?.id) {
|
|
206
228
|
const { index } = draft.activeSpectrum;
|
|
229
|
+
const { zones } = draft.toolOptions.data.baselineCorrection;
|
|
207
230
|
FiltersManager.applyFilter(draft.data[index], [
|
|
208
231
|
{
|
|
209
232
|
name: Filters.baselineCorrection.id,
|
|
210
233
|
options: {
|
|
211
|
-
zones
|
|
234
|
+
zones,
|
|
212
235
|
...action.options,
|
|
213
236
|
},
|
|
214
237
|
},
|
|
215
238
|
]);
|
|
216
|
-
draft.toolOptions.data.baseLineZones = [];
|
|
217
239
|
const xDomainSnapshot = draft.xDomain.slice();
|
|
218
240
|
(0, ToolsActions_1.resetSelectedTool)(draft);
|
|
219
241
|
(0, DomainActions_1.setDomain)(draft);
|