nmrium 0.37.0 → 0.38.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/FooterBanner.js +1 -1
- package/lib/component/1d/Viewer1D.js +26 -21
- package/lib/component/1d/integral/Integral.d.ts +2 -6
- package/lib/component/1d/integral/IntegralResizable.d.ts +2 -6
- package/lib/component/1d/integral/IntegralResizable.js +2 -3
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
- package/lib/component/1d/peaks/PeakAnnotation.js +1 -2
- package/lib/component/1d/ranges/Range.js +9 -8
- package/lib/component/1d/ranges/Ranges.js +5 -7
- package/lib/component/1d/tool/BaseLineZones.js +1 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
- package/lib/component/2d/1d-tracer/Left1DChart.js +1 -1
- package/lib/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
- package/lib/component/2d/Chart2D.js +1 -1
- package/lib/component/2d/Viewer2D.js +10 -9
- package/lib/component/2d/fid/FidCanvas.js +4 -6
- package/lib/component/2d/ft/Contours.js +1 -1
- package/lib/component/2d/utilities/DimensionLayout.d.ts +9 -24
- package/lib/component/2d/utilities/scale.d.ts +2 -1
- package/lib/component/2d/utilities/scale.js +1 -1
- package/lib/component/2d/zones/Zones.js +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.js +28 -21
- package/lib/component/NMRium.js +15 -7
- package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
- package/lib/component/context/DispatchContext.d.ts +23 -3
- package/lib/component/context/DispatchContext.js +1 -1
- package/lib/component/context/LoggerContext.js +1 -1
- package/lib/component/elements/Button.js +7 -9
- package/lib/component/elements/IsotopesViewer.js +1 -1
- package/lib/component/elements/ReactTable/ReactTable.js +1 -2
- package/lib/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib/component/elements/formik/FormikColorInput.js +1 -1
- package/lib/component/elements/formik/FormikColorPicker.js +1 -1
- package/lib/component/elements/formik/FormikColumnFormatField.js +1 -1
- package/lib/component/elements/formik/FormikInput.js +1 -1
- package/lib/component/elements/formik/FormikSelect.js +2 -2
- package/lib/component/elements/formik/FormikSlider.js +1 -1
- package/lib/component/elements/formik/FormikTextarea.js +2 -2
- package/lib/component/header/ApodizationOptionsPanel.js +4 -5
- package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +4 -5
- package/lib/component/header/Header.js +4 -6
- package/lib/component/header/PhaseCorrectionPanel.js +7 -8
- package/lib/component/header/RangesPickingOptionPanel.js +1 -2
- package/lib/component/header/ZeroFillingOptionsPanel.js +3 -11
- package/lib/component/header/Zones2DOptionPanel.js +5 -6
- package/lib/component/hooks/useExport.js +1 -0
- package/lib/component/hooks/useToolsFunctions.js +8 -10
- package/lib/component/loader/DropZone.js +4 -5
- package/lib/component/loader/NoData.js +1 -1
- package/lib/component/modal/AlignSpectraModal.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.js +1 -2
- package/lib/component/modal/ImportPublicationStringModal.js +1 -2
- package/lib/component/modal/LoadJCAMPModal.js +2 -3
- package/lib/component/modal/MoleculeStructureEditorModal.js +24 -19
- package/lib/component/modal/PredictSpectraModal.js +24 -21
- package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +3 -4
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js +2 -3
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
- package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
- package/lib/component/panels/InformationPanel.js +6 -6
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +10 -10
- package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
- package/lib/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -5
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +4 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +2 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
- package/lib/component/panels/Panels.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +4 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +4 -5
- package/lib/component/panels/RangesPanel/RangesHeader.js +12 -15
- package/lib/component/panels/RangesPanel/RangesPanel.js +24 -29
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +39 -34
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +2 -13
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +15 -18
- package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -51
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +16 -0
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +52 -0
- package/lib/component/panels/databasePanel/DatabasePanel.js +9 -7
- package/lib/component/panels/filtersPanel/FilterPanel.js +1 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +8 -9
- package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
- package/lib/component/panels/predictionPanel/PredictionPanel.js +4 -5
- package/lib/component/reducer/IgnoreActions.d.ts +2 -1
- package/lib/component/reducer/IgnoreActions.js +35 -32
- package/lib/component/reducer/Reducer.d.ts +8 -5
- package/lib/component/reducer/Reducer.js +199 -221
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +7 -6
- package/lib/component/reducer/actions/AssignmentsActions.js +2 -2
- package/lib/component/reducer/actions/CorrelationsActions.d.ts +21 -13
- package/lib/component/reducer/actions/CorrelationsActions.js +25 -20
- package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -2
- package/lib/component/reducer/actions/DatabaseActions.js +5 -2
- package/lib/component/reducer/actions/DimensionsActions.d.ts +8 -3
- package/lib/component/reducer/actions/DimensionsActions.js +3 -5
- package/lib/component/reducer/actions/DomainActions.d.ts +11 -5
- package/lib/component/reducer/actions/DomainActions.js +13 -19
- package/lib/component/reducer/actions/FiltersActions.d.ts +70 -23
- package/lib/component/reducer/actions/FiltersActions.js +250 -255
- package/lib/component/reducer/actions/GlobalActions.d.ts +7 -2
- package/lib/component/reducer/actions/GlobalActions.js +3 -3
- package/lib/component/reducer/actions/IntegralsActions.d.ts +28 -7
- package/lib/component/reducer/actions/IntegralsActions.js +16 -15
- package/lib/component/reducer/actions/LoadActions.d.ts +23 -5
- package/lib/component/reducer/actions/LoadActions.js +52 -52
- package/lib/component/reducer/actions/MoleculeActions.d.ts +38 -9
- package/lib/component/reducer/actions/MoleculeActions.js +27 -18
- package/lib/component/reducer/actions/PeaksActions.d.ts +39 -8
- package/lib/component/reducer/actions/PeaksActions.js +19 -11
- package/lib/component/reducer/actions/PreferencesActions.d.ts +8 -3
- package/lib/component/reducer/actions/PreferencesActions.js +5 -3
- package/lib/component/reducer/actions/RangesActions.d.ts +85 -18
- package/lib/component/reducer/actions/RangesActions.js +80 -65
- package/lib/component/reducer/actions/SpectraAnalysisAction.d.ts +7 -1
- package/lib/component/reducer/actions/SpectrumsActions.d.ts +57 -24
- package/lib/component/reducer/actions/SpectrumsActions.js +69 -60
- package/lib/component/reducer/actions/ToolsActions.d.ts +59 -21
- package/lib/component/reducer/actions/ToolsActions.js +54 -32
- package/lib/component/reducer/actions/ZonesActions.d.ts +79 -15
- package/lib/component/reducer/actions/ZonesActions.js +68 -49
- package/lib/component/reducer/helper/Zoom1DManager.d.ts +6 -5
- package/lib/component/reducer/helper/Zoom1DManager.js +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -2
- package/lib/component/reducer/helper/get2DRange.d.ts +7 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/types/ActionType.d.ts +6 -0
- package/lib/component/reducer/types/ActionType.js +1 -0
- package/lib/component/toolbar/BasicToolBar.js +6 -9
- package/lib/component/toolbar/FunctionToolBar.js +4 -9
- package/lib/component/toolbar/ToolBar.js +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/utility/Events.d.ts +4 -4
- package/lib/component/utility/Events.js +2 -2
- package/lib/component/utility/GroupByInfoKey.js +1 -1
- package/lib/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib/data/PredictionManager.d.ts +5 -8
- package/lib/data/PredictionManager.js +3 -3
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +2 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +5 -3
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +1 -35
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +2 -35
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +7 -10
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +5 -1
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -0
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -0
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +2 -0
- package/lib/data/matrixGeneration.js +4 -2
- package/lib/data/molecules/Molecule.d.ts +3 -3
- package/lib/data/molecules/MoleculeManager.d.ts +5 -5
- package/lib/data/molecules/MoleculeManager.js +1 -1
- package/lib/data/utilities/generateColor.js +1 -1
- package/lib/data/utilities/isNumber.d.ts +1 -0
- package/lib/data/utilities/isNumber.js +3 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +25 -20
- package/lib-cjs/component/1d/integral/IntegralResizable.js +2 -3
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -2
- package/lib-cjs/component/1d/ranges/Range.js +9 -8
- package/lib-cjs/component/1d/ranges/Ranges.js +5 -7
- package/lib-cjs/component/1d/tool/BaseLineZones.js +1 -2
- package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
- package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
- package/lib-cjs/component/2d/1d-tracer/Left1DChart.js +1 -1
- package/lib-cjs/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
- package/lib-cjs/component/2d/Chart2D.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +10 -9
- package/lib-cjs/component/2d/fid/FidCanvas.js +4 -6
- package/lib-cjs/component/2d/ft/Contours.js +1 -1
- package/lib-cjs/component/2d/utilities/scale.js +1 -1
- package/lib-cjs/component/2d/zones/Zones.js +1 -1
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +28 -21
- package/lib-cjs/component/NMRium.js +15 -7
- package/lib-cjs/component/context/DispatchContext.js +1 -1
- package/lib-cjs/component/context/LoggerContext.js +1 -1
- package/lib-cjs/component/elements/Button.js +7 -9
- package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +1 -2
- package/lib-cjs/component/elements/Tab/Tabs.js +1 -1
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorInput.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +1 -1
- package/lib-cjs/component/elements/formik/FormikInput.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSelect.js +2 -2
- package/lib-cjs/component/elements/formik/FormikSlider.js +1 -1
- package/lib-cjs/component/elements/formik/FormikTextarea.js +2 -2
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +3 -4
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +1 -2
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +4 -5
- package/lib-cjs/component/header/Header.js +4 -6
- package/lib-cjs/component/header/PhaseCorrectionPanel.js +7 -8
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +1 -2
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -11
- package/lib-cjs/component/header/Zones2DOptionPanel.js +5 -6
- package/lib-cjs/component/highlight/index.js +1 -1
- package/lib-cjs/component/hooks/useExport.js +1 -0
- package/lib-cjs/component/hooks/useTableSortBy.js +1 -1
- package/lib-cjs/component/hooks/useToolsFunctions.js +8 -10
- package/lib-cjs/component/hooks/useXYReduce.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +4 -5
- package/lib-cjs/component/loader/NoData.js +1 -1
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
- package/lib-cjs/component/modal/EditPeakShapeModal.js +1 -2
- package/lib-cjs/component/modal/ImportPublicationStringModal.js +1 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -3
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +24 -19
- package/lib-cjs/component/modal/PredictSpectraModal.js +24 -21
- package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -4
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +2 -3
- package/lib-cjs/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
- package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
- package/lib-cjs/component/panels/InformationPanel.js +6 -6
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +10 -10
- package/lib-cjs/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
- package/lib-cjs/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
- package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -5
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
- package/lib-cjs/component/panels/Panels.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -5
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +4 -5
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +12 -15
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +24 -29
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +39 -34
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +15 -18
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -51
- package/lib-cjs/component/panels/ZonesPanel/hooks/useMapZones.js +56 -0
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +8 -6
- package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -2
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +8 -9
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +4 -5
- package/lib-cjs/component/reducer/IgnoreActions.js +35 -55
- package/lib-cjs/component/reducer/Reducer.js +199 -221
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +3 -3
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +23 -18
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +4 -1
- package/lib-cjs/component/reducer/actions/DimensionsActions.js +3 -6
- package/lib-cjs/component/reducer/actions/DomainActions.js +15 -23
- package/lib-cjs/component/reducer/actions/FiltersActions.js +267 -272
- package/lib-cjs/component/reducer/actions/GlobalActions.js +4 -4
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +19 -18
- package/lib-cjs/component/reducer/actions/LoadActions.js +55 -55
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +31 -22
- package/lib-cjs/component/reducer/actions/PeaksActions.js +23 -15
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +7 -5
- package/lib-cjs/component/reducer/actions/RangesActions.js +81 -64
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +77 -67
- package/lib-cjs/component/reducer/actions/ToolsActions.js +54 -31
- package/lib-cjs/component/reducer/actions/ZonesActions.js +73 -52
- package/lib-cjs/component/reducer/core/Constants.js +1 -1
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -2
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -2
- package/lib-cjs/component/reducer/types/ActionType.js +2 -0
- package/lib-cjs/component/toolbar/BasicToolBar.js +6 -9
- package/lib-cjs/component/toolbar/FunctionToolBar.js +4 -9
- package/lib-cjs/component/toolbar/ToolBar.js +1 -1
- package/lib-cjs/component/utility/GroupByInfoKey.js +1 -1
- package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib-cjs/data/PredictionManager.js +3 -3
- package/lib-cjs/data/SpectraManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +2 -2
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
- package/lib-cjs/data/matrixGeneration.js +4 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
- package/lib-cjs/data/utilities/generateColor.js +1 -1
- package/lib-cjs/data/utilities/isNumber.js +7 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +24 -23
- package/lib/component/reducer/actions/HistoryActions.d.ts +0 -4
- package/lib/component/reducer/actions/HistoryActions.js +0 -40
- package/lib/component/reducer/types/HistoryTypes.d.ts +0 -4
- package/lib/component/reducer/types/HistoryTypes.js +0 -4
- package/lib/component/reducer/types/Types.d.ts +0 -132
- package/lib/component/reducer/types/Types.js +0 -126
- package/lib/component/toolbar/HistoryToolBar.d.ts +0 -8
- package/lib/component/toolbar/HistoryToolBar.js +0 -30
- package/lib/data/utilities/isMolFileEmpty.d.ts +0 -1
- package/lib/data/utilities/isMolFileEmpty.js +0 -6
- package/lib-cjs/component/reducer/actions/HistoryActions.js +0 -45
- package/lib-cjs/component/reducer/types/HistoryTypes.js +0 -7
- package/lib-cjs/component/reducer/types/Types.js +0 -131
- package/lib-cjs/component/toolbar/HistoryToolBar.js +0 -35
- package/lib-cjs/data/utilities/isMolFileEmpty.js +0 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AssignmentsData, Axis } from '../../../assignment/AssignmentsContext';
|
|
2
|
-
import {
|
|
2
|
+
import { ZoneData } from '../hooks/useMapZones';
|
|
3
3
|
interface SignalAssignmentsColumnsProps {
|
|
4
|
-
rowData:
|
|
4
|
+
rowData: ZoneData;
|
|
5
5
|
onHoverSignalX: any;
|
|
6
6
|
onHoverSignalY: any;
|
|
7
7
|
onClick: (event: any, assignment: AssignmentsData, axis: Axis) => void;
|
|
@@ -3,7 +3,6 @@ import lodashGet from 'lodash/get';
|
|
|
3
3
|
import { Fragment, useCallback } from 'react';
|
|
4
4
|
import { useDispatch } from '../../../context/DispatchContext';
|
|
5
5
|
import EditableColumn from '../../../elements/EditableColumn';
|
|
6
|
-
import { CHANGE_ZONE_SIGNAL_VALUE } from '../../../reducer/types/Types';
|
|
7
6
|
import { formatNumber } from '../../../utility/formatNumber';
|
|
8
7
|
function SignalDeltaColumn({ rowData, onHoverSignalX, onHoverSignalY, format, }) {
|
|
9
8
|
const dispatch = useDispatch();
|
|
@@ -13,20 +12,20 @@ function SignalDeltaColumn({ rowData, onHoverSignalX, onHoverSignalY, format, })
|
|
|
13
12
|
const saveXHandler = useCallback((event) => {
|
|
14
13
|
const value = event.target.value;
|
|
15
14
|
dispatch({
|
|
16
|
-
type: CHANGE_ZONE_SIGNAL_VALUE,
|
|
15
|
+
type: 'CHANGE_ZONE_SIGNAL_VALUE',
|
|
17
16
|
payload: {
|
|
18
|
-
|
|
19
|
-
signal: { id,
|
|
17
|
+
zoneId: rowData.id,
|
|
18
|
+
signal: { id, deltaX: value },
|
|
20
19
|
},
|
|
21
20
|
});
|
|
22
21
|
}, [dispatch, id, rowData.id]);
|
|
23
22
|
const saveYHandler = useCallback((event) => {
|
|
24
23
|
const value = event.target.value;
|
|
25
24
|
dispatch({
|
|
26
|
-
type: CHANGE_ZONE_SIGNAL_VALUE,
|
|
25
|
+
type: 'CHANGE_ZONE_SIGNAL_VALUE',
|
|
27
26
|
payload: {
|
|
28
|
-
|
|
29
|
-
signal: { id,
|
|
27
|
+
zoneId: rowData.id,
|
|
28
|
+
signal: { id, deltaY: value },
|
|
30
29
|
},
|
|
31
30
|
});
|
|
32
31
|
}, [dispatch, id, rowData.id]);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
2
|
import { MouseEvent } from 'react';
|
|
3
3
|
import { AssignmentsData, Axis } from '../../../assignment/AssignmentsContext';
|
|
4
|
-
import {
|
|
4
|
+
import { ZoneData } from '../hooks/useMapZones';
|
|
5
5
|
export interface ZoneAssignmentColumnProps {
|
|
6
|
-
rowData:
|
|
6
|
+
rowData: ZoneData;
|
|
7
7
|
axis: any;
|
|
8
8
|
onHover: () => void;
|
|
9
9
|
onClick: (event: MouseEvent, assignment: AssignmentsData, axis: Axis) => void;
|
|
@@ -24,6 +24,6 @@ function ZoneAssignmentColumn({ rowData, assignment, highlight, onHover, onClick
|
|
|
24
24
|
for (const signal of rowData?.signals || []) {
|
|
25
25
|
totalNumberOfAtoms += signal?.[axis]?.nbAtoms || 0;
|
|
26
26
|
}
|
|
27
|
-
return (_jsx("td", { ...rowSpanTags, ...onHover,
|
|
27
|
+
return (_jsx("td", { ...rowSpanTags, ...onHover, onClick: (e) => onClick(e, assignment, axis), css: !isAssignmentActive && removeAssignmentCssStyle, children: (totalNumberOfAtoms > 0 || isAssignmentActive) && (_jsxs(_Fragment, { children: [totalNumberOfAtoms, " ", ' ( ', _jsx("span", { style: getStyle(flag, false), children: diaIDs?.length || 0 }), ' ) ', _jsx(RemoveAssignmentsButton, { onClick: (e) => onUnlink(e, true, axis) })] })) }));
|
|
28
28
|
}
|
|
29
29
|
export default ZoneAssignmentColumn;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AssignmentsData, Axis } from '../../../assignment/AssignmentsContext';
|
|
2
|
-
import {
|
|
2
|
+
import { ZoneData } from '../hooks/useMapZones';
|
|
3
3
|
interface ZoneAssignmentsColumnsProps {
|
|
4
|
-
rowData:
|
|
4
|
+
rowData: ZoneData;
|
|
5
5
|
onHoverZoneX: any;
|
|
6
6
|
onHoverZoneY: any;
|
|
7
7
|
onClick: (event: any, assignment: AssignmentsData, axis: Axis) => void;
|
|
@@ -11,7 +11,6 @@ import ToolTip from '../../elements/ToolTip/ToolTip';
|
|
|
11
11
|
import { useModal } from '../../elements/popup/Modal';
|
|
12
12
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
13
13
|
import { zoneStateInit } from '../../reducer/Reducer';
|
|
14
|
-
import { DELETE_2D_ZONE, SHOW_ZONES, SHOW_ZONES_PEAKS, SHOW_ZONES_SIGNALS, UNLINK_ZONE, } from '../../reducer/types/Types';
|
|
15
14
|
import { tablePanelStyle } from '../extra/BasicPanelStyle';
|
|
16
15
|
import NoTableData from '../extra/placeholder/NoTableData';
|
|
17
16
|
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
@@ -81,11 +80,11 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, experiment, showZ
|
|
|
81
80
|
const handleOnFilter = useCallback(() => {
|
|
82
81
|
setFilterIsActive(!filterIsActive);
|
|
83
82
|
}, [filterIsActive]);
|
|
84
|
-
const unlinkZoneHandler = useCallback((zoneData
|
|
83
|
+
const unlinkZoneHandler = useCallback((zoneData, isOnZoneLevel = undefined, signalIndex = -1, axis = undefined) => {
|
|
85
84
|
dispatch({
|
|
86
|
-
type: UNLINK_ZONE,
|
|
85
|
+
type: 'UNLINK_ZONE',
|
|
87
86
|
payload: {
|
|
88
|
-
zoneData,
|
|
87
|
+
zone: zoneData,
|
|
89
88
|
assignmentData,
|
|
90
89
|
isOnZoneLevel,
|
|
91
90
|
signalIndex,
|
|
@@ -109,7 +108,7 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, experiment, showZ
|
|
|
109
108
|
{
|
|
110
109
|
text: 'Yes',
|
|
111
110
|
handler: () => {
|
|
112
|
-
dispatch({ type: DELETE_2D_ZONE, payload: { assignmentData } });
|
|
111
|
+
dispatch({ type: 'DELETE_2D_ZONE', payload: { assignmentData } });
|
|
113
112
|
},
|
|
114
113
|
},
|
|
115
114
|
{ text: 'No' },
|
|
@@ -124,13 +123,13 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, experiment, showZ
|
|
|
124
123
|
setFlipStatus(false);
|
|
125
124
|
}, []);
|
|
126
125
|
const handleSetShowZones = () => {
|
|
127
|
-
dispatch({ type: SHOW_ZONES, payload: { id } });
|
|
126
|
+
dispatch({ type: 'SHOW_ZONES', payload: { id } });
|
|
128
127
|
};
|
|
129
128
|
const handleSetShowSignals = () => {
|
|
130
|
-
dispatch({ type: SHOW_ZONES_SIGNALS, payload: { id } });
|
|
129
|
+
dispatch({ type: 'SHOW_ZONES_SIGNALS', payload: { id } });
|
|
131
130
|
};
|
|
132
131
|
const handleSetShowPeaks = () => {
|
|
133
|
-
dispatch({ type: SHOW_ZONES_PEAKS, payload: { id } });
|
|
132
|
+
dispatch({ type: 'SHOW_ZONES_PEAKS', payload: { id } });
|
|
134
133
|
};
|
|
135
134
|
return (_jsxs("div", { css: [
|
|
136
135
|
tablePanelStyle,
|
|
@@ -151,14 +150,12 @@ export default function ZonesPanel() {
|
|
|
151
150
|
const { displayerKey, xDomain, yDomain, view: { zones: zoneState, spectra: { activeTab }, }, } = useChartData();
|
|
152
151
|
const { zones, info, id } = useSpectrum(emptyData);
|
|
153
152
|
const zoneProps = zoneState.find((r) => r.spectrumID === id) || zoneStateInit;
|
|
154
|
-
return (_jsx(MemoizedZonesPanel, {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
...zoneProps,
|
|
163
|
-
} }));
|
|
153
|
+
return (_jsx(MemoizedZonesPanel, { id,
|
|
154
|
+
xDomain,
|
|
155
|
+
yDomain,
|
|
156
|
+
activeTab,
|
|
157
|
+
displayerKey,
|
|
158
|
+
zones,
|
|
159
|
+
experiment: info.experiment,
|
|
160
|
+
...zoneProps }));
|
|
164
161
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { useMemo } from 'react';
|
|
5
4
|
import { FaLink } from 'react-icons/fa';
|
|
6
5
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
7
6
|
import useTableSortBy from '../../hooks/useTableSortBy';
|
|
8
7
|
import ZonesTableRow from './ZonesTableRow';
|
|
8
|
+
import { useMapZones } from './hooks/useMapZones';
|
|
9
9
|
const tableStyle = css `
|
|
10
10
|
border-spacing: 0;
|
|
11
11
|
border: 1px solid #dedede;
|
|
@@ -59,56 +59,7 @@ const tableStyle = css `
|
|
|
59
59
|
}
|
|
60
60
|
`;
|
|
61
61
|
function ZonesTable({ tableData, onUnlink, nuclei, experiment, }) {
|
|
62
|
-
const data =
|
|
63
|
-
const data = [];
|
|
64
|
-
for (const [i, zone] of tableData.entries()) {
|
|
65
|
-
if (zone.signals.length === 1) {
|
|
66
|
-
data.push({
|
|
67
|
-
...zone,
|
|
68
|
-
tableMetaInfo: {
|
|
69
|
-
...zone.tableMetaInfo,
|
|
70
|
-
signal: zone.signals[0],
|
|
71
|
-
rowIndex: i,
|
|
72
|
-
signalIndex: 0,
|
|
73
|
-
id: zone.signals[0].id,
|
|
74
|
-
experiment,
|
|
75
|
-
nuclei,
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
else if (zone.signals.length > 1) {
|
|
80
|
-
for (const [j, signal] of zone.signals.entries()) {
|
|
81
|
-
let hide = false;
|
|
82
|
-
let rowSpan = null;
|
|
83
|
-
if (j < zone.signals.length - 1) {
|
|
84
|
-
if (j === 0) {
|
|
85
|
-
rowSpan = zone.signals.length;
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
hide = true;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
hide = true;
|
|
93
|
-
}
|
|
94
|
-
data.push({
|
|
95
|
-
...zone,
|
|
96
|
-
tableMetaInfo: {
|
|
97
|
-
...zone.tableMetaInfo,
|
|
98
|
-
signal,
|
|
99
|
-
rowSpan,
|
|
100
|
-
hide,
|
|
101
|
-
rowIndex: i,
|
|
102
|
-
signalIndex: j,
|
|
103
|
-
id: signal.id,
|
|
104
|
-
experiment,
|
|
105
|
-
},
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return data;
|
|
111
|
-
}, [experiment, nuclei, tableData]);
|
|
62
|
+
const data = useMapZones(tableData, { nuclei, experiment });
|
|
112
63
|
const { items: sortedData, isSortedDesc, onSort } = useTableSortBy(data);
|
|
113
64
|
const { deltaPPM: deltaX } = usePanelPreferences('zones', nuclei[0]);
|
|
114
65
|
const { deltaPPM: deltaY } = usePanelPreferences('zones', nuclei[1]);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
2
|
import { Axis } from '../../assignment/AssignmentsContext';
|
|
3
3
|
import { ContextMenuProps } from '../../elements/ReactTable/ReactTable';
|
|
4
|
-
import {
|
|
4
|
+
import { ZoneData } from './hooks/useMapZones';
|
|
5
5
|
interface ZonesTableRowProps extends ContextMenuProps {
|
|
6
|
-
rowData:
|
|
7
|
-
onUnlink: (rowData:
|
|
6
|
+
rowData: ZoneData;
|
|
7
|
+
onUnlink: (rowData: ZoneData, isOnZoneLevel: boolean, signalIndex: any, axis: Axis) => void;
|
|
8
8
|
rowIndex: number;
|
|
9
9
|
format: {
|
|
10
10
|
x: string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Zone } from 'nmr-load-save';
|
|
2
|
+
export interface ZoneData extends Zone {
|
|
3
|
+
tableMetaInfo: {
|
|
4
|
+
id: number;
|
|
5
|
+
signalIndex: number;
|
|
6
|
+
rowSpan: any;
|
|
7
|
+
signal: {
|
|
8
|
+
kind: any;
|
|
9
|
+
};
|
|
10
|
+
experiment: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare function useMapZones(data: any, info: {
|
|
14
|
+
experiment: string;
|
|
15
|
+
nuclei: string[];
|
|
16
|
+
}): ZoneData[];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
export function useMapZones(data, info) {
|
|
3
|
+
return useMemo(() => {
|
|
4
|
+
const zonesData = [];
|
|
5
|
+
for (const [i, zone] of data.entries()) {
|
|
6
|
+
if (zone.signals.length === 1) {
|
|
7
|
+
zonesData.push({
|
|
8
|
+
...zone,
|
|
9
|
+
tableMetaInfo: {
|
|
10
|
+
...zone.tableMetaInfo,
|
|
11
|
+
signal: zone.signals[0],
|
|
12
|
+
rowIndex: i,
|
|
13
|
+
signalIndex: 0,
|
|
14
|
+
id: zone.signals[0].id,
|
|
15
|
+
...info,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
else if (zone.signals.length > 1) {
|
|
20
|
+
for (const [j, signal] of zone.signals.entries()) {
|
|
21
|
+
let hide = false;
|
|
22
|
+
let rowSpan = null;
|
|
23
|
+
if (j < zone.signals.length - 1) {
|
|
24
|
+
if (j === 0) {
|
|
25
|
+
rowSpan = zone.signals.length;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
hide = true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
hide = true;
|
|
33
|
+
}
|
|
34
|
+
zonesData.push({
|
|
35
|
+
...zone,
|
|
36
|
+
tableMetaInfo: {
|
|
37
|
+
...zone.tableMetaInfo,
|
|
38
|
+
signal,
|
|
39
|
+
rowSpan,
|
|
40
|
+
hide,
|
|
41
|
+
rowIndex: i,
|
|
42
|
+
signalIndex: j,
|
|
43
|
+
id: signal.id,
|
|
44
|
+
experiment: info.experiment,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return zonesData;
|
|
51
|
+
}, [data, info]);
|
|
52
|
+
}
|
|
@@ -8,7 +8,7 @@ import { BsHexagon, BsHexagonFill } from 'react-icons/bs';
|
|
|
8
8
|
import { FaICursor } from 'react-icons/fa';
|
|
9
9
|
import { IoSearchOutline } from 'react-icons/io5';
|
|
10
10
|
import { useAccordionContext } from 'react-science/ui';
|
|
11
|
-
import { mapRanges } from '../../../data/data1d/Spectrum1D';
|
|
11
|
+
import { isSpectrum1D, mapRanges } from '../../../data/data1d/Spectrum1D';
|
|
12
12
|
import { getSum } from '../../../data/data1d/Spectrum1D/SumManager';
|
|
13
13
|
import { initiateDatabase, prepareData, DATA_BASES, } from '../../../data/data1d/database';
|
|
14
14
|
import { useChartData } from '../../context/ChartContext';
|
|
@@ -23,7 +23,6 @@ import { positions, transitions, useModal } from '../../elements/popup/Modal';
|
|
|
23
23
|
import { useFormatNumberByNucleus } from '../../hooks/useFormatNumberByNucleus';
|
|
24
24
|
import useToolsFunctions from '../../hooks/useToolsFunctions';
|
|
25
25
|
import { DISPLAYER_MODE } from '../../reducer/core/Constants';
|
|
26
|
-
import { RESURRECTING_SPECTRUM_FROM_JCAMP, RESURRECTING_SPECTRUM_FROM_RANGES, } from '../../reducer/types/Types';
|
|
27
26
|
import { options } from '../../toolbar/ToolTypes';
|
|
28
27
|
import Events from '../../utility/Events';
|
|
29
28
|
import { exportAsJSON } from '../../utility/export';
|
|
@@ -198,10 +197,13 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
198
197
|
const { data } = await readFromWebSource({
|
|
199
198
|
entries: [{ baseURL, relativePath: jcampRelativeURL }],
|
|
200
199
|
});
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
200
|
+
const spectrum = data?.spectra?.[0] || null;
|
|
201
|
+
if (spectrum && isSpectrum1D(spectrum)) {
|
|
202
|
+
dispatch({
|
|
203
|
+
type: 'RESURRECTING_SPECTRUM_FROM_JCAMP',
|
|
204
|
+
payload: { ranges, spectrum },
|
|
205
|
+
});
|
|
206
|
+
}
|
|
205
207
|
}
|
|
206
208
|
catch {
|
|
207
209
|
alert.error(`Failed to load Jcamp`);
|
|
@@ -213,7 +215,7 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
213
215
|
}
|
|
214
216
|
else {
|
|
215
217
|
dispatch({
|
|
216
|
-
type: RESURRECTING_SPECTRUM_FROM_RANGES,
|
|
218
|
+
type: 'RESURRECTING_SPECTRUM_FROM_RANGES',
|
|
217
219
|
payload: { ranges, info: { solvent, nucleus, name: names[0] } },
|
|
218
220
|
});
|
|
219
221
|
}
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import { useDispatch } from '../../context/DispatchContext';
|
|
3
3
|
import { useAlert } from '../../elements/popup/Alert/Context';
|
|
4
4
|
import { useModal } from '../../elements/popup/Modal/Context';
|
|
5
|
-
import { DELETE_FILTER } from '../../reducer/types/Types';
|
|
6
5
|
import { tablePanelStyle } from '../extra/BasicPanelStyle';
|
|
7
6
|
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
8
7
|
import FiltersTable from './FiltersTable';
|
|
@@ -16,7 +15,7 @@ export default function FiltersPanel() {
|
|
|
16
15
|
text: 'Yes',
|
|
17
16
|
handler: async () => {
|
|
18
17
|
const hideLoading = await alert.showLoading('Delete filters process in progress');
|
|
19
|
-
dispatch({ type: DELETE_FILTER, payload: {} });
|
|
18
|
+
dispatch({ type: 'DELETE_FILTER', payload: {} });
|
|
20
19
|
hideLoading();
|
|
21
20
|
},
|
|
22
21
|
},
|
|
@@ -12,7 +12,6 @@ import { useAlert } from '../../elements/popup/Alert';
|
|
|
12
12
|
import { useModal } from '../../elements/popup/Modal';
|
|
13
13
|
import useSpectraByActiveNucleus from '../../hooks/useSpectraPerNucleus';
|
|
14
14
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
15
|
-
import { ENABLE_FILTER, DELETE_FILTER, SET_FILTER_SNAPSHOT, DELETE_SPECTRA_FILTER, } from '../../reducer/types/Types';
|
|
16
15
|
const rowColors = {
|
|
17
16
|
active: {
|
|
18
17
|
base: {
|
|
@@ -34,11 +33,11 @@ function FiltersTableInner({ filters, spectraCounter, activeFilterID, }) {
|
|
|
34
33
|
const modal = useModal();
|
|
35
34
|
const alert = useAlert();
|
|
36
35
|
const selectedFilterIndex = useRef();
|
|
37
|
-
const handelFilterCheck = useCallback((id,
|
|
36
|
+
const handelFilterCheck = useCallback((id, enabled) => {
|
|
38
37
|
void (async () => {
|
|
39
|
-
const hideLoading = await alert.showLoading(`${
|
|
38
|
+
const hideLoading = await alert.showLoading(`${enabled ? 'Enable' : 'Disable'} filter in progress`);
|
|
40
39
|
setTimeout(() => {
|
|
41
|
-
dispatch({ type: ENABLE_FILTER, id,
|
|
40
|
+
dispatch({ type: 'ENABLE_FILTER', payload: { id, enabled } });
|
|
42
41
|
hideLoading();
|
|
43
42
|
}, 0);
|
|
44
43
|
})();
|
|
@@ -49,7 +48,7 @@ function FiltersTableInner({ filters, spectraCounter, activeFilterID, }) {
|
|
|
49
48
|
text: 'Yes',
|
|
50
49
|
handler: async () => {
|
|
51
50
|
const hideLoading = await alert.showLoading('Delete filter process in progress');
|
|
52
|
-
dispatch({ type: DELETE_FILTER, payload: { id } });
|
|
51
|
+
dispatch({ type: 'DELETE_FILTER', payload: { id } });
|
|
53
52
|
hideLoading();
|
|
54
53
|
},
|
|
55
54
|
},
|
|
@@ -61,8 +60,8 @@ function FiltersTableInner({ filters, spectraCounter, activeFilterID, }) {
|
|
|
61
60
|
handler: async () => {
|
|
62
61
|
const hideLoading = await alert.showLoading('Delete all spectra filter process in progress');
|
|
63
62
|
dispatch({
|
|
64
|
-
type: DELETE_SPECTRA_FILTER,
|
|
65
|
-
payload: {
|
|
63
|
+
type: 'DELETE_SPECTRA_FILTER',
|
|
64
|
+
payload: { filterName: name },
|
|
66
65
|
});
|
|
67
66
|
hideLoading();
|
|
68
67
|
},
|
|
@@ -81,7 +80,7 @@ function FiltersTableInner({ filters, spectraCounter, activeFilterID, }) {
|
|
|
81
80
|
void (async () => {
|
|
82
81
|
const hideLoading = await alert.showLoading('Filter snapshot process in progress');
|
|
83
82
|
setTimeout(() => {
|
|
84
|
-
dispatch({ type: SET_FILTER_SNAPSHOT, payload: filter });
|
|
83
|
+
dispatch({ type: 'SET_FILTER_SNAPSHOT', payload: filter });
|
|
85
84
|
hideLoading();
|
|
86
85
|
}, 0);
|
|
87
86
|
})();
|
|
@@ -144,5 +143,5 @@ export default function FilterTable() {
|
|
|
144
143
|
const { toolOptions: { data: { activeFilterID }, }, } = useChartData();
|
|
145
144
|
const { filters } = useSpectrum(emptyData);
|
|
146
145
|
const spectraCounter = useSpectraByActiveNucleus().length;
|
|
147
|
-
return (_jsx(MemoizedFiltersTable, {
|
|
146
|
+
return (_jsx(MemoizedFiltersTable, { filters, spectraCounter, activeFilterID }));
|
|
148
147
|
}
|
|
@@ -27,7 +27,7 @@ const styles = css `
|
|
|
27
27
|
}
|
|
28
28
|
`;
|
|
29
29
|
function DefaultPanelHeader({ counter, onDelete = () => null, deleteToolTip = 'Delete', onFilter = () => null, filterToolTip = '', filterIsActive = false, counterFiltered = 0, children, onSettingClick = () => null, showSettingButton = false, canDelete = true, disableDelete = false, style = {}, className = '', renderRightButtons, }) {
|
|
30
|
-
return (_jsxs("div", { css: styles,
|
|
30
|
+
return (_jsxs("div", { css: styles, style, className, children: [_jsxs("div", { className: "left-container", children: [canDelete && (_jsx(Button.BarButton, { color: { base: 'black', hover: 'red' }, onClick: onDelete, disabled: counter === 0 || disableDelete, toolTip: deleteToolTip, tooltipOrientation: "horizontal", children: _jsx(FaRegTrashAlt, {}) })), filterToolTip ? (_jsx(ToggleButton, { popupTitle: filterToolTip, popupPlacement: "right", onClick: onFilter, defaultValue: filterIsActive, children: _jsx(FaFilter, { style: { pointerEvents: 'none', fontSize: '12px' } }) })) : null, children] }), renderRightButtons?.(), counter !== undefined && (_jsxs("p", { className: "counter-label", children: ["[", ' ', filterIsActive && counterFiltered !== undefined
|
|
31
31
|
? `${counterFiltered}/${counter}`
|
|
32
32
|
: counter, ' ', "]"] })), showSettingButton && (_jsx(ToolTip, { title: "Preferences", popupPlacement: "left", children: _jsx("button", { type: "button", onClick: onSettingClick, children: _jsx(FaCog, {}) }) }))] }));
|
|
33
33
|
}
|
|
@@ -6,7 +6,6 @@ import { useDispatch } from '../../context/DispatchContext';
|
|
|
6
6
|
import Button from '../../elements/Button';
|
|
7
7
|
import { useAlert } from '../../elements/popup/Alert';
|
|
8
8
|
import { useCheckToolsVisibility } from '../../hooks/useCheckToolsVisibility';
|
|
9
|
-
import { AUTO_RANGES_SPECTRA_PICKING, AUTO_ZONES_SPECTRA_PICKING, } from '../../reducer/types/Types';
|
|
10
9
|
export function SpectraAutomaticPickingButton() {
|
|
11
10
|
const dispatch = useDispatch();
|
|
12
11
|
const alert = useAlert();
|
|
@@ -16,8 +15,8 @@ export function SpectraAutomaticPickingButton() {
|
|
|
16
15
|
void (async () => {
|
|
17
16
|
const hideLoading = await alert.showLoading('Automatic Ranges/Zones detection for all spectra in progress');
|
|
18
17
|
setTimeout(() => {
|
|
19
|
-
dispatch({ type: AUTO_RANGES_SPECTRA_PICKING });
|
|
20
|
-
dispatch({ type: AUTO_ZONES_SPECTRA_PICKING });
|
|
18
|
+
dispatch({ type: 'AUTO_RANGES_SPECTRA_PICKING' });
|
|
19
|
+
dispatch({ type: 'AUTO_ZONES_SPECTRA_PICKING' });
|
|
21
20
|
hideLoading();
|
|
22
21
|
}, 0);
|
|
23
22
|
})();
|
|
@@ -4,7 +4,6 @@ import { useAccordionContext } from 'react-science/ui';
|
|
|
4
4
|
import { useChartData } from '../../context/ChartContext';
|
|
5
5
|
import { useDispatch } from '../../context/DispatchContext';
|
|
6
6
|
import { useAlert } from '../../elements/popup/Alert';
|
|
7
|
-
import { PREDICT_SPECTRA, SET_LOADING_FLAG } from '../../reducer/types/Types';
|
|
8
7
|
import MoleculePanel from '../MoleculesPanel/MoleculePanel';
|
|
9
8
|
import PredictionPreferences from './PredictionOptions';
|
|
10
9
|
export default function PredictionPane() {
|
|
@@ -20,13 +19,13 @@ export default function PredictionPane() {
|
|
|
20
19
|
void (async () => {
|
|
21
20
|
if (molecule) {
|
|
22
21
|
dispatch({
|
|
23
|
-
type: SET_LOADING_FLAG,
|
|
24
|
-
isLoading: true,
|
|
22
|
+
type: 'SET_LOADING_FLAG',
|
|
23
|
+
payload: { isLoading: true },
|
|
25
24
|
});
|
|
26
25
|
const hideLoading = await alert.showLoading(`Predict 1H, 13C, COSY, HSQC, and HMBC in progress`);
|
|
27
26
|
dispatch({
|
|
28
|
-
type: PREDICT_SPECTRA,
|
|
29
|
-
payload: {
|
|
27
|
+
type: 'PREDICT_SPECTRA',
|
|
28
|
+
payload: { molfile: molecule.molfile, options: values },
|
|
30
29
|
});
|
|
31
30
|
if (!spectraPanelState?.isOpen) {
|
|
32
31
|
openSpectraPanel();
|
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
import * as types from './types/Types';
|
|
2
1
|
const ignoreActions = new Set([
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
2
|
+
'INITIALIZE_NMRIUM',
|
|
3
|
+
'APPLY_KEY_PREFERENCES',
|
|
4
|
+
'BRUSH_END',
|
|
5
|
+
'RESET_SELECTED_TOOL',
|
|
6
|
+
'SET_KEY_PREFERENCES',
|
|
7
|
+
'SET_LOADING_FLAG',
|
|
8
|
+
'SET_SELECTED_TOOL',
|
|
9
|
+
'SET_SPECTRUMS_VERTICAL_ALIGN',
|
|
10
|
+
'SET_VERTICAL_INDICATOR_X_POSITION',
|
|
11
|
+
'SET_DIMENSIONS',
|
|
12
|
+
'SET_X_DOMAIN',
|
|
13
|
+
'SET_Y_DOMAIN',
|
|
14
|
+
'SET_ZOOM',
|
|
15
|
+
'CALCULATE_MANUAL_PHASE_CORRECTION_FILTER',
|
|
16
|
+
'CHANGE_SPECTRUM_DISPLAY_VIEW_MODE',
|
|
17
|
+
'FULL_ZOOM_OUT',
|
|
18
|
+
'SET_ACTIVE_TAB',
|
|
19
|
+
'CHANGE_SPECTRUM_VISIBILITY',
|
|
20
|
+
'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS',
|
|
21
|
+
'CHANGE_ACTIVE_SPECTRUM',
|
|
22
|
+
'SET_MOUSE_OVER_DISPLAYER',
|
|
23
|
+
'CHANGE_FLOAT_MOLECULE_POSITION',
|
|
24
|
+
'ALIGN_SPECTRA',
|
|
25
|
+
'TOGGLE_REAL_IMAGINARY_VISIBILITY',
|
|
26
|
+
'FLOAT_MOLECULE_OVER_SPECTRUM',
|
|
27
|
+
'TOGGLE_SPECTRA_LEGEND',
|
|
28
|
+
'TOGGLE_PEAKS_VIEW_PROPERTY',
|
|
29
|
+
'TOGGLE_MOLECULE_ATOM_NUMBER',
|
|
30
|
+
'SHOW_J_GRAPH',
|
|
31
|
+
'SHOW_MULTIPLICITY_TREES',
|
|
32
|
+
'SHOW_RANGES_INTEGRALS',
|
|
33
|
+
'SHOW_ZONES',
|
|
34
|
+
'SHOW_ZONES_PEAKS',
|
|
35
|
+
'SHOW_ZONES_SIGNALS',
|
|
33
36
|
]);
|
|
34
37
|
function checkActionType(type) {
|
|
35
|
-
if (!ignoreActions
|
|
38
|
+
if (!ignoreActions?.has(type))
|
|
36
39
|
return true;
|
|
37
40
|
return false;
|
|
38
41
|
}
|
|
@@ -2,11 +2,14 @@ import { CorrelationData } from 'nmr-correlation';
|
|
|
2
2
|
import { Source, Spectrum } from 'nmr-load-save';
|
|
3
3
|
import { Reducer } from 'react';
|
|
4
4
|
import { ApodizationOptions } from '../../data/data1d/filter1d/apodization';
|
|
5
|
+
import { BaselineCorrectionZone } from '../../data/data1d/filter1d/baselineCorrection';
|
|
5
6
|
import { ContoursLevels } from '../../data/data2d/Spectrum2D/contours';
|
|
6
7
|
import { MoleculesView, StateMoleculeExtended } from '../../data/molecules/Molecule';
|
|
7
8
|
import { Nuclei } from '../../data/types/common/Nucleus';
|
|
8
9
|
import { PeaksViewState } from '../../data/types/view-state/PeaksViewState';
|
|
9
10
|
import { UsedColors } from '../../types/UsedColors';
|
|
11
|
+
import { Action, Dispatch } from '../context/DispatchContext';
|
|
12
|
+
import { Tool } from '../toolbar/ToolTypes';
|
|
10
13
|
import { DISPLAYER_MODE } from './core/Constants';
|
|
11
14
|
import { ZoomHistory } from './helper/ZoomHistoryManager';
|
|
12
15
|
export interface ActiveSpectrum {
|
|
@@ -115,7 +118,7 @@ export interface State {
|
|
|
115
118
|
* Last action type
|
|
116
119
|
* base on the action type we can decide to trigger or not the callback function (onDataChange)
|
|
117
120
|
*/
|
|
118
|
-
actionType:
|
|
121
|
+
actionType: Action['type'];
|
|
119
122
|
/**
|
|
120
123
|
* web source of data
|
|
121
124
|
*/
|
|
@@ -253,7 +256,7 @@ export interface State {
|
|
|
253
256
|
* The current selected tool
|
|
254
257
|
* @default `options.zoom.id`
|
|
255
258
|
*/
|
|
256
|
-
selectedTool:
|
|
259
|
+
selectedTool: Tool;
|
|
257
260
|
/**
|
|
258
261
|
* The current active options panel
|
|
259
262
|
* Part of tools has an options panel for more control over the tool, once the user select the tool then the options panel will be shown in the header
|
|
@@ -268,7 +271,7 @@ export interface State {
|
|
|
268
271
|
* list of zones for Baseline correction filter
|
|
269
272
|
*/
|
|
270
273
|
baselineCorrection: {
|
|
271
|
-
zones:
|
|
274
|
+
zones: BaselineCorrectionZone[];
|
|
272
275
|
options: any;
|
|
273
276
|
};
|
|
274
277
|
apodizationOptions: ApodizationOptions;
|
|
@@ -300,6 +303,6 @@ export interface State {
|
|
|
300
303
|
usedColors: UsedColors;
|
|
301
304
|
}
|
|
302
305
|
export declare function initState(state: State): State;
|
|
303
|
-
export declare function dispatchMiddleware(dispatch:
|
|
304
|
-
export declare const spectrumReducer: Reducer<State,
|
|
306
|
+
export declare function dispatchMiddleware(dispatch: Dispatch): (action: Action) => void;
|
|
307
|
+
export declare const spectrumReducer: Reducer<State, Action>;
|
|
305
308
|
export {};
|