nmrium 0.36.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 -7
- 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.d.ts +2 -0
- package/lib/component/NMRium.js +22 -15
- 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/RemoveAssignmentsButton.d.ts +4 -0
- package/lib/component/{panels/RangesPanel/TableColumns → elements}/RemoveAssignmentsButton.js +14 -1
- 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 +5 -7
- 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/AboutPredictionModal.d.ts +2 -0
- package/lib/component/modal/AboutPredictionModal.js +49 -0
- 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 +27 -23
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +8 -5
- 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.d.ts +1 -0
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -7
- 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/RangesTableRow.d.ts +0 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +0 -11
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -3
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +2 -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/SpectraPreferences.js +2 -2
- 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/SpectraColumnsManager.js +1 -1
- 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 -21
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +4 -5
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +12 -16
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +3 -7
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +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 +4 -5
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +27 -19
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +3 -7
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +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/ZonesTableRow.js +2 -22
- 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 +10 -6
- 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 +65 -57
- package/lib/component/reducer/actions/MoleculeActions.d.ts +38 -9
- package/lib/component/reducer/actions/MoleculeActions.js +53 -20
- 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 +22 -7
- 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/panelsPreferencesDefaultValues.js +1 -0
- 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/component/workspaces/Workspace.d.ts +2 -1
- package/lib/component/workspaces/exercise.js +31 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
- 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/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Spectrum2D/contours.d.ts +1 -4
- package/lib/data/data2d/Spectrum2D/contours.js +0 -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/ZoneUtilities.js +0 -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/types/NMRiumGeneralPreferences.d.ts +1 -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 -7
- 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 +19 -12
- 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/{panels/RangesPanel/TableColumns → elements}/RemoveAssignmentsButton.js +15 -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 +5 -7
- 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/AboutPredictionModal.js +54 -0
- 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 +27 -23
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -4
- 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 +7 -7
- 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/RangesTableRow.js +0 -12
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +2 -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/SpectraPreferences.js +2 -2
- 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/SpectraColumnsManager.js +1 -1
- 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 +12 -19
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +27 -22
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +2 -2
- 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/ZonesTableRow.js +1 -21
- 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 +10 -6
- 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 +68 -60
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +56 -23
- package/lib-cjs/component/reducer/actions/PeaksActions.js +23 -15
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +24 -9
- 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/preferences/panelsPreferencesDefaultValues.js +1 -0
- 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/component/workspaces/exercise.js +31 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -0
- 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/contours.js +0 -1
- 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/ZoneUtilities.js +0 -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 +35 -34
- package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.d.ts +0 -3
- 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
|
@@ -39,11 +39,11 @@ function LegendsPreferences() {
|
|
|
39
39
|
else {
|
|
40
40
|
columns.push(emptyField);
|
|
41
41
|
}
|
|
42
|
-
setFieldValue('legendsFields', columns);
|
|
42
|
+
void setFieldValue('legendsFields', columns);
|
|
43
43
|
}, [setFieldValue]);
|
|
44
44
|
const deleteHandler = useCallback((data, index) => {
|
|
45
45
|
const _fields = data.filter((_, columnIndex) => columnIndex !== index);
|
|
46
|
-
setFieldValue('legendsFields', _fields);
|
|
46
|
+
void setFieldValue('legendsFields', _fields);
|
|
47
47
|
}, [setFieldValue]);
|
|
48
48
|
const COLUMNS = useMemo(() => [
|
|
49
49
|
{
|
|
@@ -146,5 +146,5 @@ function PanelsInner({ displayerMode: displayedMode }) {
|
|
|
146
146
|
const MemoizedPanels = memo(PanelsInner);
|
|
147
147
|
export default function Panels() {
|
|
148
148
|
const { displayerMode, toolOptions: { selectedTool }, } = useChartData();
|
|
149
|
-
return _jsx(MemoizedPanels, {
|
|
149
|
+
return _jsx(MemoizedPanels, { displayerMode, selectedTool });
|
|
150
150
|
}
|
|
@@ -17,7 +17,6 @@ import { useActiveSpectrumPeaksViewState, } from '../../hooks/useActiveSpectrumP
|
|
|
17
17
|
import useCheckExperimentalFeature from '../../hooks/useCheckExperimentalFeature';
|
|
18
18
|
import { useFormatNumberByNucleus } from '../../hooks/useFormatNumberByNucleus';
|
|
19
19
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
20
|
-
import { DELETE_PEAK_NOTATION, OPTIMIZE_PEAKS, TOGGLE_PEAKS_VIEW_PROPERTY, } from '../../reducer/types/Types';
|
|
21
20
|
import { tablePanelStyle } from '../extra/BasicPanelStyle';
|
|
22
21
|
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
23
22
|
import PreferencesHeader from '../header/PreferencesHeader';
|
|
@@ -33,7 +32,7 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksViewState, }) {
|
|
|
33
32
|
const isExperimental = useCheckExperimentalFeature();
|
|
34
33
|
const settingRef = useRef();
|
|
35
34
|
const yesHandler = useCallback(() => {
|
|
36
|
-
dispatch({ type:
|
|
35
|
+
dispatch({ type: 'DELETE_PEAK', payload: {} });
|
|
37
36
|
}, [dispatch]);
|
|
38
37
|
const handleDeleteAll = useCallback(() => {
|
|
39
38
|
modal.showConfirmDialog({
|
|
@@ -78,14 +77,14 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksViewState, }) {
|
|
|
78
77
|
const [from, to] = xDomain;
|
|
79
78
|
const filterPeaks = peaks.values.filter((peak) => isInRange(peak.x, { from, to }));
|
|
80
79
|
if (filterPeaks.length <= 4) {
|
|
81
|
-
dispatch({ type: OPTIMIZE_PEAKS, payload: { peaks: filterPeaks } });
|
|
80
|
+
dispatch({ type: 'OPTIMIZE_PEAKS', payload: { peaks: filterPeaks } });
|
|
82
81
|
}
|
|
83
82
|
else {
|
|
84
83
|
alert.error('optimization can be done on no more than 4 peaks');
|
|
85
84
|
}
|
|
86
85
|
};
|
|
87
86
|
function toggleViewProperty(key) {
|
|
88
|
-
dispatch({ type: TOGGLE_PEAKS_VIEW_PROPERTY, payload: { key } });
|
|
87
|
+
dispatch({ type: 'TOGGLE_PEAKS_VIEW_PROPERTY', payload: { key } });
|
|
89
88
|
}
|
|
90
89
|
return (_jsxs("div", { css: [
|
|
91
90
|
tablePanelStyle,
|
|
@@ -111,5 +110,5 @@ export default function PeaksPanel() {
|
|
|
111
110
|
const { peaks, info } = useSpectrum(emptyData);
|
|
112
111
|
const preferences = usePreferences();
|
|
113
112
|
const peaksViewState = useActiveSpectrumPeaksViewState();
|
|
114
|
-
return (_jsx(MemoizedPeaksPanel, {
|
|
113
|
+
return (_jsx(MemoizedPeaksPanel, { peaks, info, xDomain, activeTab, preferences, peaksViewState }));
|
|
115
114
|
}
|
|
@@ -10,7 +10,6 @@ import { useModal } from '../../elements/popup/Modal';
|
|
|
10
10
|
import { positions, transitions } from '../../elements/popup/options';
|
|
11
11
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
12
12
|
import EditPeakShapeModal from '../../modal/EditPeakShapeModal';
|
|
13
|
-
import { DELETE_PEAK_NOTATION, SHIFT_SPECTRUM, } from '../../reducer/types/Types';
|
|
14
13
|
import { formatNumber } from '../../utility/formatNumber';
|
|
15
14
|
import NoTableData from '../extra/placeholder/NoTableData';
|
|
16
15
|
function handleActiveRow(row) {
|
|
@@ -25,8 +24,8 @@ function PeaksTable({ activeTab, data }) {
|
|
|
25
24
|
e.stopPropagation();
|
|
26
25
|
const params = row.original;
|
|
27
26
|
dispatch({
|
|
28
|
-
type:
|
|
29
|
-
|
|
27
|
+
type: 'DELETE_PEAK',
|
|
28
|
+
payload: { id: params.id },
|
|
30
29
|
});
|
|
31
30
|
}, [dispatch]);
|
|
32
31
|
const editPeakHandler = useCallback((e, row) => {
|
|
@@ -39,8 +38,8 @@ function PeaksTable({ activeTab, data }) {
|
|
|
39
38
|
});
|
|
40
39
|
}, [modal, peaksPreferences]);
|
|
41
40
|
const saveDeltaPPMRefsHandler = useCallback((event, row) => {
|
|
42
|
-
const
|
|
43
|
-
dispatch({ type: SHIFT_SPECTRUM,
|
|
41
|
+
const shift = Number.parseFloat(event.target.value) - Number.parseFloat(row.x);
|
|
42
|
+
dispatch({ type: 'SHIFT_SPECTRUM', payload: { shift } });
|
|
44
43
|
}, [dispatch]);
|
|
45
44
|
const COLUMNS = useMemo(() => [
|
|
46
45
|
{
|
|
@@ -11,13 +11,11 @@ import { useAssignmentData } from '../../assignment/AssignmentsContext';
|
|
|
11
11
|
import { useDispatch } from '../../context/DispatchContext';
|
|
12
12
|
import ActiveButton from '../../elements/ActiveButton';
|
|
13
13
|
import Button from '../../elements/ButtonToolTip';
|
|
14
|
-
import ToggleButton from '../../elements/ToggleButton';
|
|
15
14
|
import { useAlert } from '../../elements/popup/Alert';
|
|
16
15
|
import { useModal } from '../../elements/popup/Modal';
|
|
17
16
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
18
17
|
import CopyClipboardModal from '../../modal/CopyClipboardModal';
|
|
19
18
|
import ChangeSumModal from '../../modal/changeSum/ChangeSumModal';
|
|
20
|
-
import { ADD_RANGE, CHANGE_RANGES_SUM_FLAG, CHANGE_RANGE_SUM, DELETE_RANGE, SHOW_J_GRAPH, SHOW_MULTIPLICITY_TREES, SHOW_RANGES_INTEGRALS, } from '../../reducer/types/Types';
|
|
21
19
|
import { copyHTMLToClipboard } from '../../utility/export';
|
|
22
20
|
import { getNumberOfDecimals } from '../../utility/formatNumber';
|
|
23
21
|
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
@@ -47,8 +45,8 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
|
|
|
47
45
|
const assignmentData = useAssignmentData();
|
|
48
46
|
const currentSum = lodashGet(ranges, 'options.sum', null);
|
|
49
47
|
const rangesPreferences = usePanelPreferences('ranges', activeTab);
|
|
50
|
-
const changeRangesSumHandler = useCallback((
|
|
51
|
-
dispatch({ type: CHANGE_RANGE_SUM,
|
|
48
|
+
const changeRangesSumHandler = useCallback((options) => {
|
|
49
|
+
dispatch({ type: 'CHANGE_RANGE_SUM', payload: { options } });
|
|
52
50
|
modal.close();
|
|
53
51
|
}, [dispatch, modal]);
|
|
54
52
|
const showChangeRangesSumModal = useCallback(() => {
|
|
@@ -73,8 +71,8 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
|
|
|
73
71
|
text: 'Yes',
|
|
74
72
|
handler: () => {
|
|
75
73
|
dispatch({
|
|
76
|
-
type: DELETE_RANGE,
|
|
77
|
-
payload: {
|
|
74
|
+
type: 'DELETE_RANGE',
|
|
75
|
+
payload: { assignmentData },
|
|
78
76
|
});
|
|
79
77
|
},
|
|
80
78
|
},
|
|
@@ -83,13 +81,13 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
|
|
|
83
81
|
});
|
|
84
82
|
}, [assignmentData, dispatch, modal]);
|
|
85
83
|
const handleSetShowMultiplicityTrees = useCallback(() => {
|
|
86
|
-
dispatch({ type: SHOW_MULTIPLICITY_TREES, payload: { id } });
|
|
84
|
+
dispatch({ type: 'SHOW_MULTIPLICITY_TREES', payload: { id } });
|
|
87
85
|
}, [dispatch, id]);
|
|
88
86
|
const handleShowIntegrals = useCallback(() => {
|
|
89
|
-
dispatch({ type: SHOW_RANGES_INTEGRALS, payload: { id } });
|
|
87
|
+
dispatch({ type: 'SHOW_RANGES_INTEGRALS', payload: { id } });
|
|
90
88
|
}, [dispatch, id]);
|
|
91
89
|
const handleShowJGraph = useCallback(() => {
|
|
92
|
-
dispatch({ type: SHOW_J_GRAPH, payload: { id } });
|
|
90
|
+
dispatch({ type: 'SHOW_J_GRAPH', payload: { id } });
|
|
93
91
|
}, [dispatch, id]);
|
|
94
92
|
const saveToClipboardHandler = useCallback((value) => {
|
|
95
93
|
void (async () => {
|
|
@@ -121,17 +119,16 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
|
|
|
121
119
|
rangesPreferences?.deltaPPM?.format,
|
|
122
120
|
saveToClipboardHandler,
|
|
123
121
|
]);
|
|
124
|
-
const changeSumConstantFlagHandler = useCallback((
|
|
122
|
+
const changeSumConstantFlagHandler = useCallback(() => {
|
|
125
123
|
dispatch({
|
|
126
|
-
type: CHANGE_RANGES_SUM_FLAG,
|
|
127
|
-
payload: flag,
|
|
124
|
+
type: 'CHANGE_RANGES_SUM_FLAG',
|
|
128
125
|
});
|
|
129
126
|
}, [dispatch]);
|
|
130
127
|
const { editRange } = useEditRangeModal();
|
|
131
128
|
const addRangeHandler = useCallback(() => {
|
|
132
129
|
dispatch({
|
|
133
|
-
type: ADD_RANGE,
|
|
134
|
-
payload: {
|
|
130
|
+
type: 'ADD_RANGE',
|
|
131
|
+
payload: {},
|
|
135
132
|
});
|
|
136
133
|
editRange(true);
|
|
137
134
|
}, [dispatch, editRange]);
|
|
@@ -139,6 +136,6 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
|
|
|
139
136
|
? `Change ranges sum (${Number(currentSum).toFixed(2)})`
|
|
140
137
|
: 'Change ranges sum', popupPlacement: "right", onClick: showChangeRangesSumModal, className: "btn icon", children: _jsx(SvgNmrSum, {}) }), _jsx(Button, { popupTitle: "Remove all assignments", popupPlacement: "right", onClick: handleOnRemoveAssignments, disabled: !ranges?.values || ranges.values.length === 0, className: "btn icon", children: _jsx(FaUnlink, {}) }), _jsx(ActiveButton, { popupTitle: showMultiplicityTrees
|
|
141
138
|
? 'Hide multiplicity trees in spectrum'
|
|
142
|
-
: 'Show multiplicity trees in spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, value: showMultiplicityTrees, disabled: !ranges?.values || ranges.values.length === 0, children: _jsx(FaSitemap, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ActiveButton, { popupTitle: showJGraph ? 'Hide J Graph' : 'Show J Graph', popupPlacement: "right", onClick: handleShowJGraph, value: showJGraph, disabled: !ranges?.values || ranges.values.length === 0, children: _jsx(FaChartBar, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ActiveButton, { popupTitle: showRangesIntegrals ? 'Hide integrals' : 'Show integrals', popupPlacement: "right", onClick: handleShowIntegrals, value: showRangesIntegrals, disabled: !ranges?.values || ranges.values.length === 0, children: _jsx(SvgNmrIntegrate, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(
|
|
139
|
+
: 'Show multiplicity trees in spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, value: showMultiplicityTrees, disabled: !ranges?.values || ranges.values.length === 0, children: _jsx(FaSitemap, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ActiveButton, { popupTitle: showJGraph ? 'Hide J Graph' : 'Show J Graph', popupPlacement: "right", onClick: handleShowJGraph, value: showJGraph, disabled: !ranges?.values || ranges.values.length === 0, children: _jsx(FaChartBar, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ActiveButton, { popupTitle: showRangesIntegrals ? 'Hide integrals' : 'Show integrals', popupPlacement: "right", onClick: handleShowIntegrals, value: showRangesIntegrals, disabled: !ranges?.values || ranges.values.length === 0, children: _jsx(SvgNmrIntegrate, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ActiveButton, { className: "icon", popupTitle: "Fix integral values", popupPlacement: "right", onClick: changeSumConstantFlagHandler, value: ranges?.options?.isSumConstant, children: _jsx(ImLink, {}) }), _jsx(Button, { popupTitle: "Add range", popupPlacement: "right", onClick: addRangeHandler, className: "btn icon", disabled: !ranges?.values, children: _jsx(FaPlus, {}) })] }) }));
|
|
143
140
|
}
|
|
144
141
|
export default RangesHeader;
|
|
@@ -11,7 +11,6 @@ import { useAlert } from '../../elements/popup/Alert';
|
|
|
11
11
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
12
12
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
13
13
|
import { rangeStateInit } from '../../reducer/Reducer';
|
|
14
|
-
import { UNLINK_RANGE } from '../../reducer/types/Types';
|
|
15
14
|
import { copyTextToClipboard } from '../../utility/export';
|
|
16
15
|
import { tablePanelStyle } from '../extra/BasicPanelStyle';
|
|
17
16
|
import NoTableData from '../extra/placeholder/NoTableData';
|
|
@@ -61,9 +60,9 @@ function RangesTablePanelInner({ id, ranges, data, info, xDomain, preferences, a
|
|
|
61
60
|
}, [isFilterActive, ranges.values, xDomain]);
|
|
62
61
|
const unlinkRangeHandler = useCallback((rangeData, signalIndex = -1) => {
|
|
63
62
|
dispatch({
|
|
64
|
-
type: UNLINK_RANGE,
|
|
63
|
+
type: 'UNLINK_RANGE',
|
|
65
64
|
payload: {
|
|
66
|
-
rangeData,
|
|
65
|
+
range: rangeData,
|
|
67
66
|
assignmentData,
|
|
68
67
|
signalIndex,
|
|
69
68
|
},
|
|
@@ -112,17 +111,15 @@ function RangesTablePanelInner({ id, ranges, data, info, xDomain, preferences, a
|
|
|
112
111
|
position: relative;
|
|
113
112
|
}
|
|
114
113
|
`,
|
|
115
|
-
], children: [!isFlipped && (_jsx(RangesHeader, {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
isFilterActive,
|
|
125
|
-
}, onUnlink: unlinkRangeHandler, onFilterActivated: filterHandler, onSettingClick: settingsPanelHandler, filterCounter: rangesData.length })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx("div", { className: "table-container", children: rangesData && rangesData.length > 0 ? (_jsx(RangesTable, { activeTab: activeTab, tableData: rangesData, onUnlink: unlinkRangeHandler, contextMenu: rangesContextMenuOptions, onContextMenuSelect: contextMenuSelectHandler, preferences: preferences, info: info })) : (_jsx(NoTableData, {})) })) : (_jsx(RangesPreferences, { ref: settingRef })) })] }));
|
|
114
|
+
], children: [!isFlipped && (_jsx(RangesHeader, { id,
|
|
115
|
+
ranges,
|
|
116
|
+
info,
|
|
117
|
+
activeTab,
|
|
118
|
+
molecules,
|
|
119
|
+
showRangesIntegrals,
|
|
120
|
+
showMultiplicityTrees,
|
|
121
|
+
showJGraph,
|
|
122
|
+
isFilterActive, onUnlink: unlinkRangeHandler, onFilterActivated: filterHandler, onSettingClick: settingsPanelHandler, filterCounter: rangesData.length })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx("div", { className: "table-container", children: rangesData && rangesData.length > 0 ? (_jsx(RangesTable, { activeTab: activeTab, tableData: rangesData, onUnlink: unlinkRangeHandler, contextMenu: rangesContextMenuOptions, onContextMenuSelect: contextMenuSelectHandler, preferences: preferences, info: info })) : (_jsx(NoTableData, {})) })) : (_jsx(RangesPreferences, { ref: settingRef })) })] }));
|
|
126
123
|
}
|
|
127
124
|
const MemoizedRangesTablePanel = memo(RangesTablePanelInner);
|
|
128
125
|
const emptyData = { ranges: {}, data: {}, info: {} };
|
|
@@ -131,19 +128,17 @@ export default function RangesTablePanel() {
|
|
|
131
128
|
const { displayerKey, xDomain, view: { spectra: { activeTab }, }, molecules, toolOptions: { selectedTool }, view: { ranges: rangeState }, } = useChartData();
|
|
132
129
|
const { showMultiplicityTrees, showRangesIntegrals, showJGraph } = useMemo(() => rangeState.find((r) => r.spectrumID === id) || rangeStateInit, [id, rangeState]);
|
|
133
130
|
const rangesPreferences = usePanelPreferences('ranges', activeTab);
|
|
134
|
-
return (_jsx(MemoizedRangesTablePanel, {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
molecules,
|
|
148
|
-
} }));
|
|
131
|
+
return (_jsx(MemoizedRangesTablePanel, { id,
|
|
132
|
+
ranges,
|
|
133
|
+
data,
|
|
134
|
+
info,
|
|
135
|
+
showMultiplicityTrees,
|
|
136
|
+
showJGraph,
|
|
137
|
+
showRangesIntegrals,
|
|
138
|
+
selectedTool,
|
|
139
|
+
displayerKey,
|
|
140
|
+
preferences: rangesPreferences,
|
|
141
|
+
xDomain,
|
|
142
|
+
activeTab,
|
|
143
|
+
molecules }));
|
|
149
144
|
}
|
|
@@ -3,7 +3,6 @@ import { CSSProperties } from 'react';
|
|
|
3
3
|
import { ContextMenuProps } from '../../elements/ReactTable/ReactTable';
|
|
4
4
|
import { WorkSpacePanelPreferences } from '../../workspaces/Workspace';
|
|
5
5
|
import { RangeData } from './hooks/useMapRanges';
|
|
6
|
-
export declare const AssignmentColumnCssStyle: import("@emotion/react").SerializedStyles;
|
|
7
6
|
interface RangesTableRowProps extends ContextMenuProps {
|
|
8
7
|
rowData: any;
|
|
9
8
|
onUnlink: (a: any, b?: any) => void;
|
|
@@ -22,17 +22,6 @@ const HighlightedRowStyle = css `
|
|
|
22
22
|
const ConstantlyHighlightedRowStyle = css `
|
|
23
23
|
background-color: #f5f5dc;
|
|
24
24
|
`;
|
|
25
|
-
export const AssignmentColumnCssStyle = css `
|
|
26
|
-
.remove-assignment {
|
|
27
|
-
visibility: hidden;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&:hover {
|
|
31
|
-
.remove-assignment {
|
|
32
|
-
visibility: visible;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
25
|
function RangesTableRow({ rowData, onUnlink, onContextMenuSelect, contextMenu = [], preferences, info, }) {
|
|
37
26
|
const assignmentData = useAssignmentData();
|
|
38
27
|
const assignmentRange = useAssignment(rowData.id);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { memo } from 'react';
|
|
4
|
+
import { RemoveAssignmentsButton, removeAssignmentCssStyle, } from '../../../elements/RemoveAssignmentsButton';
|
|
4
5
|
import { HighlightEventSource } from '../../../highlight';
|
|
5
|
-
import { AssignmentColumnCssStyle } from '../RangesTableRow';
|
|
6
|
-
import { RemoveAssignmentsButton } from './RemoveAssignmentsButton';
|
|
7
6
|
const columnStyle = {
|
|
8
7
|
padding: 0,
|
|
9
8
|
textAlign: 'center',
|
|
@@ -37,6 +36,6 @@ function RangeAssignmentsColumn({ row, assignment, highlight, onLink, onUnlink,
|
|
|
37
36
|
return (_jsx("td", { ...rowSpanTags, style: {
|
|
38
37
|
...columnStyle,
|
|
39
38
|
...rowSpanTags.style,
|
|
40
|
-
}, ...onHover,
|
|
39
|
+
}, ...onHover, onClick: (e) => onLink?.(e, assignment), css: !assignment.isActive && removeAssignmentCssStyle, children: (totalNumberOfAtoms > 0 || assignment.isActive) && (_jsxs(_Fragment, { children: [totalNumberOfAtoms, " ", ' ( ', _jsx("span", { style: getStyle(flag, isCompletelyAssigned), children: diaIDs?.length || 0 }), ' ) ', _jsx(RemoveAssignmentsButton, { onClick: (e) => onUnlink?.(e, true) })] })) }));
|
|
41
40
|
}
|
|
42
41
|
export default memo(RangeAssignmentsColumn);
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { checkRangeKind } from '../../../../data/utilities/RangeUtilities';
|
|
3
3
|
import { useDispatch } from '../../../context/DispatchContext';
|
|
4
4
|
import EditableColumn from '../../../elements/EditableColumn';
|
|
5
|
-
import { CHANGE_RANGE_RELATIVE } from '../../../reducer/types/Types';
|
|
6
5
|
import { formatNumber } from '../../../utility/formatNumber';
|
|
7
6
|
function RelativeColumn({ row, rowSpanTags, onHover, format, }) {
|
|
8
7
|
const dispatch = useDispatch();
|
|
@@ -11,9 +10,10 @@ function RelativeColumn({ row, rowSpanTags, onHover, format, }) {
|
|
|
11
10
|
const integralVal = flag ? formattedValue : `[ ${formattedValue} ]`;
|
|
12
11
|
function saveHandler(event) {
|
|
13
12
|
dispatch({
|
|
14
|
-
type: CHANGE_RANGE_RELATIVE,
|
|
13
|
+
type: 'CHANGE_RANGE_RELATIVE',
|
|
15
14
|
payload: {
|
|
16
|
-
|
|
15
|
+
value: event.target.value,
|
|
16
|
+
id: row.id,
|
|
17
17
|
},
|
|
18
18
|
});
|
|
19
19
|
}
|
|
@@ -2,8 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/reac
|
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import lodashGet from 'lodash/get';
|
|
4
4
|
import { memo } from 'react';
|
|
5
|
-
import {
|
|
6
|
-
import { RemoveAssignmentsButton } from './RemoveAssignmentsButton';
|
|
5
|
+
import { RemoveAssignmentsButton, removeAssignmentCssStyle, } from '../../../elements/RemoveAssignmentsButton';
|
|
7
6
|
function SignalAssignmentsColumn({ row, onHover, assignment, highlight, onLink, onUnlink, }) {
|
|
8
7
|
const diaIDs = lodashGet(row, 'tableMetaInfo.signal.diaIDs', []);
|
|
9
8
|
const tdCss = assignment.isActive || highlight.isActive
|
|
@@ -15,6 +14,6 @@ function SignalAssignmentsColumn({ row, onHover, assignment, highlight, onLink,
|
|
|
15
14
|
function assignHandler(e) {
|
|
16
15
|
onLink?.(e, assignment);
|
|
17
16
|
}
|
|
18
|
-
return (_jsx("td", { ...onHover, onClick: assignHandler, style: { padding: '0', ...tdCss }, css: !assignment.isActive &&
|
|
17
|
+
return (_jsx("td", { ...onHover, onClick: assignHandler, style: { padding: '0', ...tdCss }, css: !assignment.isActive && removeAssignmentCssStyle, children: (diaIDs?.length > 0 || assignment.isActive) && (_jsxs(_Fragment, { children: [_jsx("span", { children: diaIDs?.length || 0 }), _jsx(RemoveAssignmentsButton, { onClick: (e) => onUnlink?.(e, false) })] })) }));
|
|
19
18
|
}
|
|
20
19
|
export default memo(SignalAssignmentsColumn);
|
|
@@ -2,14 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { checkMultiplicity } from 'nmr-processing';
|
|
3
3
|
import { useDispatch } from '../../../context/DispatchContext';
|
|
4
4
|
import EditableColumn from '../../../elements/EditableColumn';
|
|
5
|
-
import { CHANGE_RANGE_SIGNAL_VALUE } from '../../../reducer/types/Types';
|
|
6
5
|
import { formatNumber } from '../../../utility/formatNumber';
|
|
7
6
|
function SignalDeltaColumn({ row, onHover, format, rowSpanTags, }) {
|
|
8
7
|
const dispatch = useDispatch();
|
|
9
8
|
const signal = row.tableMetaInfo.signal;
|
|
10
9
|
function saveHandler(event) {
|
|
11
10
|
dispatch({
|
|
12
|
-
type: CHANGE_RANGE_SIGNAL_VALUE,
|
|
11
|
+
type: 'CHANGE_RANGE_SIGNAL_VALUE',
|
|
13
12
|
payload: {
|
|
14
13
|
value: event.target.value,
|
|
15
14
|
rangeID: row.id,
|
|
@@ -3,5 +3,5 @@ export default function useEditRangeModal(range?: RangeData): {
|
|
|
3
3
|
editRange: (isManual?: boolean) => void;
|
|
4
4
|
deleteRange: (id?: string, resetSelectTool?: boolean) => void;
|
|
5
5
|
zoomRange: (modalRange?: RangeData) => void;
|
|
6
|
-
changeRangeSignalKind: (
|
|
6
|
+
changeRangeSignalKind: (kind: any) => void;
|
|
7
7
|
};
|
|
@@ -5,8 +5,6 @@ import { useDispatch } from '../../../context/DispatchContext';
|
|
|
5
5
|
import { useModal } from '../../../elements/popup/Modal';
|
|
6
6
|
import { positions, transitions } from '../../../elements/popup/options';
|
|
7
7
|
import EditRangeModal from '../../../modal/editRange/EditRangeModal';
|
|
8
|
-
import { CHANGE_RANGE_SIGNAL_KIND, DELETE_RANGE, SAVE_EDITED_RANGE, SET_SELECTED_TOOL, SET_X_DOMAIN, } from '../../../reducer/types/Types';
|
|
9
|
-
import { options } from '../../../toolbar/ToolTypes';
|
|
10
8
|
export default function useEditRangeModal(range) {
|
|
11
9
|
const dispatch = useDispatch();
|
|
12
10
|
const modal = useModal();
|
|
@@ -17,37 +15,41 @@ export default function useEditRangeModal(range) {
|
|
|
17
15
|
const { from, to } = _range;
|
|
18
16
|
const margin = Math.abs(from - to);
|
|
19
17
|
dispatch({
|
|
20
|
-
type: SET_X_DOMAIN,
|
|
21
|
-
|
|
18
|
+
type: 'SET_X_DOMAIN',
|
|
19
|
+
payload: {
|
|
20
|
+
xDomain: [from - margin, to + margin],
|
|
21
|
+
},
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
}, [dispatch, range]);
|
|
25
25
|
const deleteRange = useCallback((id, resetSelectTool = false) => {
|
|
26
26
|
if (range || id) {
|
|
27
27
|
dispatch({
|
|
28
|
-
type: DELETE_RANGE,
|
|
28
|
+
type: 'DELETE_RANGE',
|
|
29
29
|
payload: {
|
|
30
|
-
|
|
30
|
+
id: id || range?.id,
|
|
31
|
+
assignmentData,
|
|
31
32
|
resetSelectTool,
|
|
32
33
|
},
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
36
|
}, [assignmentData, dispatch, range]);
|
|
36
|
-
const changeRangeSignalKind = useCallback((
|
|
37
|
+
const changeRangeSignalKind = useCallback((kind) => {
|
|
37
38
|
if (range) {
|
|
38
39
|
dispatch({
|
|
39
|
-
type: CHANGE_RANGE_SIGNAL_KIND,
|
|
40
|
+
type: 'CHANGE_RANGE_SIGNAL_KIND',
|
|
40
41
|
payload: {
|
|
41
|
-
|
|
42
|
+
range,
|
|
43
|
+
kind,
|
|
42
44
|
},
|
|
43
45
|
});
|
|
44
46
|
}
|
|
45
47
|
}, [dispatch, range]);
|
|
46
|
-
const saveEditRangeHandler = useCallback((
|
|
48
|
+
const saveEditRangeHandler = useCallback((editedRange, automaticCloseModal = true) => {
|
|
47
49
|
dispatch({
|
|
48
|
-
type: SAVE_EDITED_RANGE,
|
|
50
|
+
type: 'SAVE_EDITED_RANGE',
|
|
49
51
|
payload: {
|
|
50
|
-
|
|
52
|
+
range: editedRange,
|
|
51
53
|
assignmentData,
|
|
52
54
|
},
|
|
53
55
|
});
|
|
@@ -66,8 +68,8 @@ export default function useEditRangeModal(range) {
|
|
|
66
68
|
}, [deleteRange, modal, saveEditRangeHandler]);
|
|
67
69
|
const editRange = useCallback((isManual = false) => {
|
|
68
70
|
dispatch({
|
|
69
|
-
type: SET_SELECTED_TOOL,
|
|
70
|
-
payload: { selectedTool:
|
|
71
|
+
type: 'SET_SELECTED_TOOL',
|
|
72
|
+
payload: { selectedTool: 'editRange' },
|
|
71
73
|
});
|
|
72
74
|
modal.show(_jsx(EditRangeModal, { onCloseEditRangeModal: closeEditRangeHandler, onSaveEditRangeModal: saveEditRangeHandler, onZoomEditRangeModal: zoomRange, range: isManual ? {} : range, manualRange: isManual }), {
|
|
73
75
|
position: positions.MIDDLE_RIGHT,
|
|
@@ -11,7 +11,6 @@ import { useModal } from '../../elements/popup/Modal';
|
|
|
11
11
|
import { useActiveSpectra } from '../../hooks/useActiveSpectra';
|
|
12
12
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
13
13
|
import { DISPLAYER_MODE } from '../../reducer/core/Constants';
|
|
14
|
-
import { ADD_MISSING_PROJECTION, CHANGE_VISIBILITY, DELETE_SPECTRA, RECOLOR_SPECTRA_COLOR, RESET_SPECTRA_SCALE, SET_SPECTRA_SAME_TOP, } from '../../reducer/types/Types';
|
|
15
14
|
import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
|
|
16
15
|
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
17
16
|
import { SpectraAutomaticPickingButton } from '../header/SpectraAutomaticPickingButton';
|
|
@@ -39,7 +38,7 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
|
|
|
39
38
|
{
|
|
40
39
|
text: 'Yes',
|
|
41
40
|
handler: () => {
|
|
42
|
-
dispatch({ type: DELETE_SPECTRA });
|
|
41
|
+
dispatch({ type: 'DELETE_SPECTRA', payload: {} });
|
|
43
42
|
},
|
|
44
43
|
},
|
|
45
44
|
{ text: 'No' },
|
|
@@ -48,34 +47,37 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
|
|
|
48
47
|
}, [activeSpectra?.length, dispatch, modal]);
|
|
49
48
|
function showAllSpectrumsHandler() {
|
|
50
49
|
dispatch({
|
|
51
|
-
type:
|
|
50
|
+
type: 'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS',
|
|
52
51
|
payload: { nucleus: activeTab, flag: true },
|
|
53
52
|
});
|
|
54
53
|
}
|
|
55
54
|
function hideAllSpectrumsHandler() {
|
|
56
55
|
dispatch({
|
|
57
|
-
type:
|
|
56
|
+
type: 'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS',
|
|
58
57
|
payload: { nucleus: activeTab, flag: false },
|
|
59
58
|
});
|
|
60
59
|
}
|
|
61
60
|
function addMissingProjectionHandler() {
|
|
62
61
|
const missingNucleus = getMissingProjection(data, activeTab);
|
|
63
62
|
if (missingNucleus.length > 0) {
|
|
64
|
-
dispatch({
|
|
63
|
+
dispatch({
|
|
64
|
+
type: 'ADD_MISSING_PROJECTION',
|
|
65
|
+
payload: { nucleus: missingNucleus },
|
|
66
|
+
});
|
|
65
67
|
}
|
|
66
68
|
else {
|
|
67
69
|
alert.error('Nothing to calculate');
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
function setSameTopHandler() {
|
|
71
|
-
dispatch({ type: SET_SPECTRA_SAME_TOP });
|
|
73
|
+
dispatch({ type: 'SET_SPECTRA_SAME_TOP' });
|
|
72
74
|
}
|
|
73
75
|
function resetScaleHandler() {
|
|
74
|
-
dispatch({ type: RESET_SPECTRA_SCALE });
|
|
76
|
+
dispatch({ type: 'RESET_SPECTRA_SCALE' });
|
|
75
77
|
}
|
|
76
78
|
function recolorSpectraHandler() {
|
|
77
79
|
dispatch({
|
|
78
|
-
type: RECOLOR_SPECTRA_COLOR,
|
|
80
|
+
type: 'RECOLOR_SPECTRA_COLOR',
|
|
79
81
|
payload: {},
|
|
80
82
|
});
|
|
81
83
|
}
|
|
@@ -87,12 +89,10 @@ export default function SpectrumsTabs({ onSettingClick, }) {
|
|
|
87
89
|
const { data, view: { spectra: { activeTab }, }, displayerMode, } = useChartData();
|
|
88
90
|
const spectrum = useSpectrum();
|
|
89
91
|
const activeSpectra = useActiveSpectra();
|
|
90
|
-
return (_jsx(MemoizedSpectraPanelHeader, {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
onSettingClick,
|
|
97
|
-
} }));
|
|
92
|
+
return (_jsx(MemoizedSpectraPanelHeader, { data,
|
|
93
|
+
activeSpectrum: spectrum,
|
|
94
|
+
activeSpectra,
|
|
95
|
+
activeTab,
|
|
96
|
+
displayerMode,
|
|
97
|
+
onSettingClick }));
|
|
98
98
|
}
|
|
@@ -30,7 +30,7 @@ function SpectraPreferences(props, ref) {
|
|
|
30
30
|
}), []);
|
|
31
31
|
const handleAdd = useCallback((nucleus, index) => {
|
|
32
32
|
const data = formRef.current.values;
|
|
33
|
-
let columns = data.nuclei[nucleus]
|
|
33
|
+
let columns = data.nuclei[nucleus]?.columns || [];
|
|
34
34
|
columns = [
|
|
35
35
|
...columns.slice(0, index),
|
|
36
36
|
{
|
|
@@ -53,7 +53,7 @@ function SpectraPreferences(props, ref) {
|
|
|
53
53
|
}, []);
|
|
54
54
|
const handleDelete = useCallback((nucleus, index) => {
|
|
55
55
|
const data = formRef.current.values;
|
|
56
|
-
const columns = data.nuclei[nucleus]
|
|
56
|
+
const columns = data.nuclei[nucleus]?.columns.filter((_, columnIndex) => columnIndex !== index);
|
|
57
57
|
formRef.current.setValues({
|
|
58
58
|
...data,
|
|
59
59
|
nuclei: {
|
|
@@ -9,14 +9,13 @@ import ReactTable from '../../elements/ReactTable/ReactTable';
|
|
|
9
9
|
import { useAlert } from '../../elements/popup/Alert';
|
|
10
10
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
11
11
|
import ExportAsJcampModal from '../../modal/ExportAsJcampModal';
|
|
12
|
-
import { DELETE_SPECTRA, ORDER_SPECTRA, RECOLOR_SPECTRA_COLOR, } from '../../reducer/types/Types';
|
|
13
12
|
import { copyTextToClipboard } from '../../utility/export';
|
|
14
13
|
import ColorIndicator from './base/ColorIndicator';
|
|
15
14
|
import ShowHideSpectrumButton from './base/ShowHideSpectrumButton';
|
|
16
15
|
import { SpectrumName } from './base/SpectrumName';
|
|
17
16
|
function formatValueAsHTML(value) {
|
|
18
17
|
if (value) {
|
|
19
|
-
value = value.
|
|
18
|
+
value = value.replaceAll(/(?<value>\d+)/g, '<sub>$<value></sub>');
|
|
20
19
|
}
|
|
21
20
|
return value;
|
|
22
21
|
}
|
|
@@ -145,7 +144,7 @@ export function SpectraTable(props) {
|
|
|
145
144
|
}
|
|
146
145
|
case SpectraContextMenuOptionsKeys.Delete: {
|
|
147
146
|
setTimeout(() => {
|
|
148
|
-
dispatch({ type: DELETE_SPECTRA, id: spectrum.id });
|
|
147
|
+
dispatch({ type: 'DELETE_SPECTRA', payload: { id: spectrum.id } });
|
|
149
148
|
}, 0);
|
|
150
149
|
break;
|
|
151
150
|
}
|
|
@@ -195,7 +194,7 @@ export function SpectraTable(props) {
|
|
|
195
194
|
}, [COLUMNS, spectraPreferences.columns]);
|
|
196
195
|
function handleSortEnd(data) {
|
|
197
196
|
dispatch({
|
|
198
|
-
type: ORDER_SPECTRA,
|
|
197
|
+
type: 'ORDER_SPECTRA',
|
|
199
198
|
payload: {
|
|
200
199
|
data,
|
|
201
200
|
},
|
|
@@ -217,7 +216,10 @@ const ColumnHeader = ({ label, col, }) => {
|
|
|
217
216
|
const dispatch = useDispatch();
|
|
218
217
|
function selectHandler() {
|
|
219
218
|
if (col?.jpath) {
|
|
220
|
-
dispatch({
|
|
219
|
+
dispatch({
|
|
220
|
+
type: 'RECOLOR_SPECTRA_COLOR',
|
|
221
|
+
payload: { jpath: col?.jpath },
|
|
222
|
+
});
|
|
221
223
|
}
|
|
222
224
|
}
|
|
223
225
|
return (_jsx(DropdownMenu, { trigger: "contextMenu", options: options, onSelect: selectHandler, children: _jsx("div", { style: {
|