nmrium 0.37.0 → 0.38.1
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/database/DatabaseSpectrum.js +2 -1
- 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.d.ts +1 -1
- 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 +5 -6
- 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 +15 -11
- 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 +202 -220
- 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 +7 -9
- 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/database/DatabaseSpectrum.js +2 -1
- 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 +5 -6
- 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 +14 -10
- 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 +202 -220
- 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
|
@@ -7,12 +7,11 @@ import { useCallback, useMemo, useState, useRef, memo } from 'react';
|
|
|
7
7
|
import { ImLink } from 'react-icons/im';
|
|
8
8
|
import { useChartData } from '../../context/ChartContext';
|
|
9
9
|
import { useDispatch } from '../../context/DispatchContext';
|
|
10
|
-
import
|
|
10
|
+
import ActiveButton from '../../elements/ActiveButton';
|
|
11
11
|
import ToolTip from '../../elements/ToolTip/ToolTip';
|
|
12
12
|
import { useModal } from '../../elements/popup/Modal';
|
|
13
13
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
14
14
|
import ChangeSumModal from '../../modal/changeSum/ChangeSumModal';
|
|
15
|
-
import { DELETE_INTEGRAL, CHANGE_INTEGRAL_SUM, CHANGE_INTEGRALS_SUM_FLAG, } from '../../reducer/types/Types';
|
|
16
15
|
import { tablePanelStyle } from '../extra/BasicPanelStyle';
|
|
17
16
|
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
18
17
|
import PreferencesHeader from '../header/PreferencesHeader';
|
|
@@ -26,12 +25,6 @@ const style = css `
|
|
|
26
25
|
align-items: center;
|
|
27
26
|
justify-content: center;
|
|
28
27
|
}
|
|
29
|
-
|
|
30
|
-
.fix-integral-toggle-btn {
|
|
31
|
-
svg {
|
|
32
|
-
font-size: 12px !important;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
28
|
`;
|
|
36
29
|
function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
37
30
|
const [filterIsActive, setFilterIsActive] = useState(false);
|
|
@@ -40,7 +33,7 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
|
40
33
|
const [isFlipped, setFlipStatus] = useState(false);
|
|
41
34
|
const settingRef = useRef();
|
|
42
35
|
const yesHandler = useCallback(() => {
|
|
43
|
-
dispatch({ type: DELETE_INTEGRAL,
|
|
36
|
+
dispatch({ type: 'DELETE_INTEGRAL', payload: {} });
|
|
44
37
|
}, [dispatch]);
|
|
45
38
|
const handleDeleteAll = useCallback(() => {
|
|
46
39
|
modal.showConfirmDialog({
|
|
@@ -48,8 +41,8 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
|
48
41
|
buttons: [{ text: 'Yes', handler: yesHandler }, { text: 'No' }],
|
|
49
42
|
});
|
|
50
43
|
}, [modal, yesHandler]);
|
|
51
|
-
const changeIntegralSumHandler = useCallback((
|
|
52
|
-
dispatch({ type: CHANGE_INTEGRAL_SUM,
|
|
44
|
+
const changeIntegralSumHandler = useCallback((options) => {
|
|
45
|
+
dispatch({ type: 'CHANGE_INTEGRAL_SUM', payload: { options } });
|
|
53
46
|
modal.close();
|
|
54
47
|
}, [dispatch, modal]);
|
|
55
48
|
const currentSum = useMemo(() => {
|
|
@@ -70,8 +63,8 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
|
70
63
|
const handleOnFilter = useCallback(() => {
|
|
71
64
|
setFilterIsActive(!filterIsActive);
|
|
72
65
|
}, [filterIsActive]);
|
|
73
|
-
const toggleConstantSumHandler = useCallback((
|
|
74
|
-
dispatch({ type: CHANGE_INTEGRALS_SUM_FLAG
|
|
66
|
+
const toggleConstantSumHandler = useCallback(() => {
|
|
67
|
+
dispatch({ type: 'CHANGE_INTEGRALS_SUM_FLAG' });
|
|
75
68
|
}, [dispatch]);
|
|
76
69
|
const filteredData = useMemo(() => {
|
|
77
70
|
function isInRange(from, to) {
|
|
@@ -105,17 +98,15 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
|
105
98
|
`,
|
|
106
99
|
], children: [!isFlipped && (_jsxs(DefaultPanelHeader, { counter: integrals?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Integrals", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all integrals' : 'Hide integrals out of view', filterIsActive: filterIsActive, counterFiltered: filteredData.length, showSettingButton: true, onSettingClick: settingsPanelHandler, children: [_jsx(ToolTip, { title: currentSum
|
|
107
100
|
? `Change Integrals Sum (${Number(currentSum).toFixed(2)})`
|
|
108
|
-
: 'Change Integrals Sum', popupPlacement: "right", children: _jsx("button", { className: "sum-button", type: "button", onClick: showChangeIntegralSumModal, children: _jsx(SvgNmrSum, {}) }) }), _jsx(
|
|
101
|
+
: 'Change Integrals Sum', popupPlacement: "right", children: _jsx("button", { className: "sum-button", type: "button", onClick: showChangeIntegralSumModal, children: _jsx(SvgNmrSum, {}) }) }), _jsx(ActiveButton, { className: "icon", popupTitle: "Fix integral values", popupPlacement: "right", onClick: toggleConstantSumHandler, value: integrals?.options?.isSumConstant || false, children: _jsx(ImLink, {}) })] })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(IntegralTable, { data: filteredData, activeTab: activeTab })) : (_jsx(IntegralsPreferences, { ref: settingRef })) })] }));
|
|
109
102
|
}
|
|
110
103
|
const MemoizedIntegralPanel = memo(IntegralPanelInner);
|
|
111
104
|
const emptyData = { integrals: {}, info: {} };
|
|
112
105
|
export default function IntegralPanel() {
|
|
113
106
|
const { xDomain, view: { spectra: { activeTab }, }, } = useChartData();
|
|
114
107
|
const { integrals, info } = useSpectrum(emptyData);
|
|
115
|
-
return (_jsx(MemoizedIntegralPanel, {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
activeTab,
|
|
120
|
-
} }));
|
|
108
|
+
return (_jsx(MemoizedIntegralPanel, { integrals,
|
|
109
|
+
info,
|
|
110
|
+
xDomain,
|
|
111
|
+
activeTab }));
|
|
121
112
|
}
|
|
@@ -10,7 +10,6 @@ import ReactTable from '../../elements/ReactTable/ReactTable';
|
|
|
10
10
|
import addCustomColumn from '../../elements/ReactTable/utility/addCustomColumn';
|
|
11
11
|
import Select from '../../elements/Select';
|
|
12
12
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
13
|
-
import { DELETE_INTEGRAL, CHANGE_INTEGRAL_DATA, CHANGE_INTEGRAL_RELATIVE, } from '../../reducer/types/Types';
|
|
14
13
|
import { formatNumber } from '../../utility/formatNumber';
|
|
15
14
|
import NoTableData from '../extra/placeholder/NoTableData';
|
|
16
15
|
const selectStyle = { width: '100%', border: 'none' };
|
|
@@ -19,17 +18,19 @@ function IntegralTable({ activeTab, data }) {
|
|
|
19
18
|
const deleteIntegralHandler = useCallback((e, row) => {
|
|
20
19
|
e.preventDefault();
|
|
21
20
|
e.stopPropagation();
|
|
22
|
-
const
|
|
21
|
+
const { id } = row.original;
|
|
23
22
|
dispatch({
|
|
24
|
-
type: DELETE_INTEGRAL,
|
|
25
|
-
|
|
23
|
+
type: 'DELETE_INTEGRAL',
|
|
24
|
+
payload: {
|
|
25
|
+
id,
|
|
26
|
+
},
|
|
26
27
|
});
|
|
27
28
|
}, [dispatch]);
|
|
28
29
|
const changeIntegralDataHandler = useCallback((value, row) => {
|
|
29
|
-
const
|
|
30
|
+
const integral = { ...row.original, kind: value };
|
|
30
31
|
dispatch({
|
|
31
|
-
type:
|
|
32
|
-
payload: {
|
|
32
|
+
type: 'CHANGE_INTEGRAL',
|
|
33
|
+
payload: { integral },
|
|
33
34
|
});
|
|
34
35
|
}, [dispatch]);
|
|
35
36
|
const initialColumns = useMemo(() => [
|
|
@@ -59,10 +60,9 @@ function IntegralTable({ activeTab, data }) {
|
|
|
59
60
|
},
|
|
60
61
|
], [deleteIntegralHandler]);
|
|
61
62
|
const saveRelativeHandler = useCallback((event, row) => {
|
|
62
|
-
const data = { value: event.target.value, id: row.id };
|
|
63
63
|
dispatch({
|
|
64
|
-
type: CHANGE_INTEGRAL_RELATIVE,
|
|
65
|
-
payload: {
|
|
64
|
+
type: 'CHANGE_INTEGRAL_RELATIVE',
|
|
65
|
+
payload: { value: event.target.value, id: row.id },
|
|
66
66
|
});
|
|
67
67
|
}, [dispatch]);
|
|
68
68
|
const integralsPreferences = usePanelPreferences('integrals', activeTab);
|
|
@@ -18,7 +18,7 @@ export function ExclusionsZonesTable() {
|
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
20
|
function handleDelete(index) {
|
|
21
|
-
setFieldValue('exclusionsZones', values.exclusionsZones.filter((_, i) => i !== index));
|
|
21
|
+
void setFieldValue('exclusionsZones', values.exclusionsZones.filter((_, i) => i !== index));
|
|
22
22
|
}
|
|
23
23
|
const exclusionsZonesColumns = [
|
|
24
24
|
{
|
|
@@ -22,7 +22,7 @@ export function FiltersOptions() {
|
|
|
22
22
|
return values.filters.map((filter, index) => {
|
|
23
23
|
return (_jsx(GroupPane
|
|
24
24
|
// eslint-disable-next-line react/no-array-index-key
|
|
25
|
-
, { text: `${index + 1} - ${normalCase(filter.name)} options`, style: { ...GroupPanelStyle, container: { padding: 0 } }, renderHeader: (text) => (_jsx(FiltersPanelGroupHeader, {
|
|
25
|
+
, { text: `${index + 1} - ${normalCase(filter.name)} options`, style: { ...GroupPanelStyle, container: { padding: 0 } }, renderHeader: (text) => (_jsx(FiltersPanelGroupHeader, { index, text, name: filter.name })), children: _jsx(Fields, { filter: filter, basePath: `filters.${index}` }) }, `${index}`));
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
function Fields(props) {
|
|
@@ -82,11 +82,11 @@ function FiltersPanelGroupHeader({ index, name }) {
|
|
|
82
82
|
function handelSelectFilter(value, index) {
|
|
83
83
|
const filters = values.filters.slice(0);
|
|
84
84
|
filters.splice(index, 1, value);
|
|
85
|
-
setFieldValue('filters', filters);
|
|
85
|
+
void setFieldValue('filters', filters);
|
|
86
86
|
}
|
|
87
87
|
function handleAdd(index) {
|
|
88
88
|
if (values.filters) {
|
|
89
|
-
setFieldValue('filters', [
|
|
89
|
+
void setFieldValue('filters', [
|
|
90
90
|
...values.filters.slice(0, index),
|
|
91
91
|
DEFAULT_MATRIX_FILTERS[0],
|
|
92
92
|
...values.filters.slice(index),
|
|
@@ -94,7 +94,7 @@ function FiltersPanelGroupHeader({ index, name }) {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
function handleDelete(index) {
|
|
97
|
-
setFieldValue('filters', values.filters.filter((_, i) => i !== index));
|
|
97
|
+
void setFieldValue('filters', values.filters.filter((_, i) => i !== index));
|
|
98
98
|
}
|
|
99
99
|
return (_jsxs("div", { className: "section-header", style: { display: 'flex', padding: '5px 0px' }, children: [_jsxs("p", { style: { flex: 1, ...GroupPanelStyle.header }, children: [index + 1, "-"] }), _jsx(Select, { value: name, items: DEFAULT_MATRIX_FILTERS, onChange: (value) => handelSelectFilter(value, index), style: { width: '100%' }, returnValue: false, itemTextField: "name", itemValueField: "name", textRender: (text) => normalCase(text) }), _jsxs("div", { style: { display: 'flex' }, children: [_jsx(Button.Danger, { fill: "outline", onClick: () => handleDelete(index), children: _jsx(FaTimes, {}) }), _jsx(Button.Done, { fill: "outline", onClick: () => handleAdd(index + 1), style: { marginLeft: '5px' }, children: _jsx(FaPlus, {}) })] })] }));
|
|
100
100
|
}
|
|
@@ -18,7 +18,6 @@ import FormikInput from '../../elements/formik/FormikInput';
|
|
|
18
18
|
import FormikOnChange from '../../elements/formik/FormikOnChange';
|
|
19
19
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
20
20
|
import useToolsFunctions from '../../hooks/useToolsFunctions';
|
|
21
|
-
import { APPLY_SIGNAL_PROCESSING_FILTER } from '../../reducer/types/Types';
|
|
22
21
|
import { options } from '../../toolbar/ToolTypes';
|
|
23
22
|
import { exportAsMatrix } from '../../utility/export';
|
|
24
23
|
import { tablePanelStyle } from '../extra/BasicPanelStyle';
|
|
@@ -67,7 +66,7 @@ function MatrixGenerationPanel() {
|
|
|
67
66
|
exportAsMatrix(data, 'Spectra Matrix');
|
|
68
67
|
}
|
|
69
68
|
function handleSave(options) {
|
|
70
|
-
dispatch({ type: APPLY_SIGNAL_PROCESSING_FILTER, payload: { options } });
|
|
69
|
+
dispatch({ type: 'APPLY_SIGNAL_PROCESSING_FILTER', payload: { options } });
|
|
71
70
|
}
|
|
72
71
|
function handleOnChange(options) {
|
|
73
72
|
preferences.dispatch({
|
|
@@ -4,7 +4,6 @@ import { MF } from 'react-mf';
|
|
|
4
4
|
import { extractLabelsNumbers, extractNumber, } from '../../../data/molecules/MoleculeManager';
|
|
5
5
|
import { useDispatch } from '../../context/DispatchContext';
|
|
6
6
|
import EditableColumn from '../../elements/EditableColumn';
|
|
7
|
-
import { CHANGE_MOLECULE_LABEL } from '../../reducer/types/Types';
|
|
8
7
|
const styles = {
|
|
9
8
|
toolbar: {
|
|
10
9
|
display: 'flex',
|
|
@@ -32,7 +31,7 @@ export default function MoleculeHeader(props) {
|
|
|
32
31
|
}, [molecules]);
|
|
33
32
|
const saveLabelHandler = useCallback((id, event) => {
|
|
34
33
|
const label = event.target.value;
|
|
35
|
-
dispatch({ type: CHANGE_MOLECULE_LABEL, payload: { label, id } });
|
|
34
|
+
dispatch({ type: 'CHANGE_MOLECULE_LABEL', payload: { label, id } });
|
|
36
35
|
}, [dispatch]);
|
|
37
36
|
return (_jsxs("div", { style: styles.toolbar, children: [_jsxs("div", { style: { display: 'flex' }, children: [_jsx("span", { children: "Label" }), _jsx(EditableColumn, { value: currentMolecule.label, style: styles.labelInput, validate: validateLabel, onSave: (event) => saveLabelHandler(currentMolecule.id, event), textOverFlowEllipses: true })] }), _jsxs("span", { children: [_jsx(MF, { mf: currentMolecule.mf }), " - ", currentMolecule.mw?.toFixed(2)] })] }));
|
|
38
37
|
}
|
|
@@ -10,7 +10,6 @@ import { useDispatch } from '../../context/DispatchContext';
|
|
|
10
10
|
import NextPrev from '../../elements/NextPrev';
|
|
11
11
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
12
12
|
import { useMoleculeEditor } from '../../modal/MoleculeStructureEditorModal';
|
|
13
|
-
import { SET_MOLECULE } from '../../reducer/types/Types';
|
|
14
13
|
import MoleculeHeader from './MoleculeHeader';
|
|
15
14
|
import MoleculePanelHeader from './MoleculePanelHeader';
|
|
16
15
|
import useAtomAssignment from './useAtomAssignment';
|
|
@@ -65,7 +64,7 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, molecules
|
|
|
65
64
|
const handleReplaceMolecule = useCallback((molecule, molfile) => {
|
|
66
65
|
const { id, label } = molecule;
|
|
67
66
|
dispatch({
|
|
68
|
-
type: SET_MOLECULE,
|
|
67
|
+
type: 'SET_MOLECULE',
|
|
69
68
|
payload: { molfile, id, label },
|
|
70
69
|
});
|
|
71
70
|
}, [dispatch]);
|
|
@@ -91,15 +90,13 @@ export default function MoleculePanel({ onMoleculeChange, children, actionsOptio
|
|
|
91
90
|
const data = useSpectrum(emptyData);
|
|
92
91
|
const ranges = data?.ranges || {};
|
|
93
92
|
const zones = data?.zones || {};
|
|
94
|
-
return (_jsx(MemoizedMoleculePanel, {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
emptyTextStyle,
|
|
104
|
-
}, children: children }));
|
|
93
|
+
return (_jsx(MemoizedMoleculePanel, { molecules,
|
|
94
|
+
moleculesView,
|
|
95
|
+
displayerMode,
|
|
96
|
+
activeTab,
|
|
97
|
+
ranges,
|
|
98
|
+
zones,
|
|
99
|
+
onMoleculeChange,
|
|
100
|
+
actionsOptions,
|
|
101
|
+
emptyTextStyle, children: children }));
|
|
105
102
|
}
|
|
@@ -17,7 +17,6 @@ import { useAlert } from '../../elements/popup/Alert';
|
|
|
17
17
|
import { positions, useModal } from '../../elements/popup/Modal';
|
|
18
18
|
import AboutPredictionModal from '../../modal/AboutPredictionModal';
|
|
19
19
|
import PredictSpectraModal from '../../modal/PredictSpectraModal';
|
|
20
|
-
import { ADD_MOLECULE, DELETE_MOLECULE, FLOAT_MOLECULE_OVER_SPECTRUM, TOGGLE_MOLECULE_ATOM_NUMBER, } from '../../reducer/types/Types';
|
|
21
20
|
import { copyPNGToClipboard, copyTextToClipboard, exportAsSVG, } from '../../utility/export';
|
|
22
21
|
const toolbarStyle = css `
|
|
23
22
|
display: flex;
|
|
@@ -131,14 +130,14 @@ export default function MoleculePanelHeader({ currentIndex, molecules, molecules
|
|
|
131
130
|
]);
|
|
132
131
|
const handlePaste = useCallback(() => {
|
|
133
132
|
void navigator.clipboard.readText().then((molfile) => {
|
|
134
|
-
dispatch({ type: ADD_MOLECULE, molfile });
|
|
133
|
+
dispatch({ type: 'ADD_MOLECULE', payload: { molfile } });
|
|
135
134
|
});
|
|
136
135
|
}, [dispatch]);
|
|
137
136
|
const handleDelete = useCallback(() => {
|
|
138
137
|
if (molecules[currentIndex]?.id) {
|
|
139
138
|
onMoleculeIndexChange(0);
|
|
140
139
|
dispatch({
|
|
141
|
-
type: DELETE_MOLECULE,
|
|
140
|
+
type: 'DELETE_MOLECULE',
|
|
142
141
|
payload: { id: molecules[currentIndex].id, assignmentData },
|
|
143
142
|
});
|
|
144
143
|
}
|
|
@@ -150,7 +149,7 @@ export default function MoleculePanelHeader({ currentIndex, molecules, molecules
|
|
|
150
149
|
assignmentData,
|
|
151
150
|
]);
|
|
152
151
|
const openPredictSpectraModal = useCallback(() => {
|
|
153
|
-
modal.show(_jsx(PredictSpectraModal, { molfile: molecules[currentIndex] }), {
|
|
152
|
+
modal.show(_jsx(PredictSpectraModal, { molfile: molecules[currentIndex].molfile }), {
|
|
154
153
|
position: positions.TOP_CENTER,
|
|
155
154
|
enableResizing: true,
|
|
156
155
|
width: 600,
|
|
@@ -158,13 +157,13 @@ export default function MoleculePanelHeader({ currentIndex, molecules, molecules
|
|
|
158
157
|
}, [modal, molecules, currentIndex]);
|
|
159
158
|
function floatMoleculeHandler() {
|
|
160
159
|
dispatch({
|
|
161
|
-
type: FLOAT_MOLECULE_OVER_SPECTRUM,
|
|
160
|
+
type: 'FLOAT_MOLECULE_OVER_SPECTRUM',
|
|
162
161
|
payload: { id: moleculeKey },
|
|
163
162
|
});
|
|
164
163
|
}
|
|
165
164
|
function showAtomNumbersHandler() {
|
|
166
165
|
dispatch({
|
|
167
|
-
type: TOGGLE_MOLECULE_ATOM_NUMBER,
|
|
166
|
+
type: 'TOGGLE_MOLECULE_ATOM_NUMBER',
|
|
168
167
|
payload: { id: moleculeKey },
|
|
169
168
|
});
|
|
170
169
|
}
|
|
@@ -29,4 +29,7 @@ export declare function findDatumAndSignalIndex(data: (Range | Zone)[], id: stri
|
|
|
29
29
|
};
|
|
30
30
|
export declare function getHighlightsOnHover(assignments: AssignmentContext, oclIDs: any, data: any): string[];
|
|
31
31
|
export declare function getCurrentDiaIDsToHighlight(assignmentData: AssignmentContext): string[];
|
|
32
|
-
export declare function toggleDiaIDs(diaIDs: string[], atomInformation: AtomData):
|
|
32
|
+
export declare function toggleDiaIDs(diaIDs: string[], atomInformation: AtomData): {
|
|
33
|
+
diaIDs: string[];
|
|
34
|
+
nbAtoms: number;
|
|
35
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function getElements(activeTab) {
|
|
2
2
|
const nuclei = activeTab.split(',');
|
|
3
|
-
return nuclei.map((nucleus) => nucleus.
|
|
3
|
+
return nuclei.map((nucleus) => nucleus.replaceAll(/\d/g, ''));
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Returns the OCL id(s) and number of atoms of an atom when hovering over
|
|
@@ -99,5 +99,5 @@ export function toggleDiaIDs(diaIDs, atomInformation) {
|
|
|
99
99
|
_diaIDs.push(oclID);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
return
|
|
102
|
+
return { diaIDs: _diaIDs, nbAtoms: tempNbAtoms };
|
|
103
103
|
}
|
|
@@ -7,7 +7,6 @@ import { useDispatch } from '../../context/DispatchContext';
|
|
|
7
7
|
import { useAlert } from '../../elements/popup/Alert';
|
|
8
8
|
import { HighlightEventSource, useHighlightData } from '../../highlight';
|
|
9
9
|
import { DISPLAYER_MODE } from '../../reducer/core/Constants';
|
|
10
|
-
import { SET_DIAID_RANGE, SET_DIAID_ZONE } from '../../reducer/types/Types';
|
|
11
10
|
import { extractFromAtom, findDatumAndSignalIndex, getCurrentDiaIDsToHighlight, getHighlightsOnHover, toggleDiaIDs, } from './Utilities';
|
|
12
11
|
export default function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }) {
|
|
13
12
|
const alert = useAlert();
|
|
@@ -127,13 +126,13 @@ export default function useAtomAssignment({ displayerMode, activeTab: nucleus, z
|
|
|
127
126
|
else {
|
|
128
127
|
_diaIDs = range?.signals[signalIndex]?.diaIDs || [];
|
|
129
128
|
}
|
|
130
|
-
const
|
|
129
|
+
const { diaIDs, nbAtoms } = toggleAssignment(_diaIDs, atomInformation);
|
|
131
130
|
dispatch({
|
|
132
|
-
type: SET_DIAID_RANGE,
|
|
131
|
+
type: 'SET_DIAID_RANGE',
|
|
133
132
|
payload: {
|
|
134
133
|
nbAtoms,
|
|
135
|
-
|
|
136
|
-
diaIDs
|
|
134
|
+
range,
|
|
135
|
+
diaIDs,
|
|
137
136
|
signalIndex,
|
|
138
137
|
},
|
|
139
138
|
});
|
|
@@ -147,13 +146,13 @@ export default function useAtomAssignment({ displayerMode, activeTab: nucleus, z
|
|
|
147
146
|
else {
|
|
148
147
|
_diaIDs = zone?.signals[signalIndex][axis]?.diaIDs || [];
|
|
149
148
|
}
|
|
150
|
-
const
|
|
149
|
+
const { diaIDs, nbAtoms } = toggleAssignment(_diaIDs, atomInformation);
|
|
151
150
|
dispatch({
|
|
152
|
-
type:
|
|
151
|
+
type: 'SET_ZONE_DIAID',
|
|
153
152
|
payload: {
|
|
154
153
|
nbAtoms,
|
|
155
|
-
|
|
156
|
-
diaIDs
|
|
154
|
+
zone,
|
|
155
|
+
diaIDs,
|
|
157
156
|
axis,
|
|
158
157
|
signalIndex,
|
|
159
158
|
},
|
|
@@ -14,7 +14,6 @@ import { positions, useAlert } from '../../elements/popup/Alert';
|
|
|
14
14
|
import { useModal } from '../../elements/popup/Modal';
|
|
15
15
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
16
16
|
import AlignSpectraModal from '../../modal/AlignSpectraModal';
|
|
17
|
-
import { RESET_SELECTED_TOOL, TOGGLE_SPECTRA_LEGEND, } from '../../reducer/types/Types';
|
|
18
17
|
import { copyTextToClipboard } from '../../utility/export';
|
|
19
18
|
import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
|
|
20
19
|
import { tablePanelStyle } from '../extra/BasicPanelStyle';
|
|
@@ -41,10 +40,10 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectra, showLegend, })
|
|
|
41
40
|
setFlipStatus(false);
|
|
42
41
|
}, []);
|
|
43
42
|
const showTrackerHandler = useCallback(() => {
|
|
44
|
-
dispatch({ type: TOGGLE_SPECTRA_LEGEND });
|
|
43
|
+
dispatch({ type: 'TOGGLE_SPECTRA_LEGEND' });
|
|
45
44
|
}, [dispatch]);
|
|
46
45
|
const openAlignSpectra = useCallback(() => {
|
|
47
|
-
dispatch({ type: RESET_SELECTED_TOOL });
|
|
46
|
+
dispatch({ type: 'RESET_SELECTED_TOOL' });
|
|
48
47
|
modal.show(_jsx(AlignSpectraModal, { nucleus: activeTab }), {
|
|
49
48
|
isBackgroundBlur: false,
|
|
50
49
|
position: positions.TOP_CENTER,
|
|
@@ -80,5 +79,5 @@ export default function MultipleSpectraAnalysisPanel() {
|
|
|
80
79
|
if (!activeTab) {
|
|
81
80
|
return _jsx("div", {});
|
|
82
81
|
}
|
|
83
|
-
return (_jsx(MemoizedMultipleSpectraAnalysisPanel, {
|
|
82
|
+
return (_jsx(MemoizedMultipleSpectraAnalysisPanel, { activeTab, displayerKey, spectra, showLegend }));
|
|
84
83
|
}
|
|
@@ -6,7 +6,6 @@ import ReactTable from '../../elements/ReactTable/ReactTable';
|
|
|
6
6
|
import addCustomColumn from '../../elements/ReactTable/utility/addCustomColumn';
|
|
7
7
|
import { useFormatNumberByNucleus } from '../../hooks/useFormatNumberByNucleus';
|
|
8
8
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
9
|
-
import { ORDER_MULTIPLE_SPECTRA_ANALYSIS } from '../../reducer/types/Types';
|
|
10
9
|
import evaluate from '../../utility/Evaluate';
|
|
11
10
|
import NoTableData from '../extra/placeholder/NoTableData';
|
|
12
11
|
import AnalysisCell from './base/AnalysisCell';
|
|
@@ -80,7 +79,7 @@ function MultipleSpectraAnalysisTable({ data, activeTab, resortSpectra, }) {
|
|
|
80
79
|
function handleSortEnd(data) {
|
|
81
80
|
if (resortSpectra) {
|
|
82
81
|
dispatch({
|
|
83
|
-
type: ORDER_MULTIPLE_SPECTRA_ANALYSIS,
|
|
82
|
+
type: 'ORDER_MULTIPLE_SPECTRA_ANALYSIS',
|
|
84
83
|
payload: {
|
|
85
84
|
data,
|
|
86
85
|
},
|
package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js
CHANGED
|
@@ -10,7 +10,7 @@ const inputStyle = { input: { width: '100%', fontSize: '1.15em' } };
|
|
|
10
10
|
export function AnalysisTablePreferences() {
|
|
11
11
|
const { values: { analysisOptions: { columns }, }, setFieldValue, } = useFormikContext();
|
|
12
12
|
const addNewColumn = useCallback((index, columns) => {
|
|
13
|
-
setFieldValue('analysisOptions.columns', [
|
|
13
|
+
void setFieldValue('analysisOptions.columns', [
|
|
14
14
|
...columns,
|
|
15
15
|
{
|
|
16
16
|
tempKey: '',
|
|
@@ -22,7 +22,7 @@ export function AnalysisTablePreferences() {
|
|
|
22
22
|
]);
|
|
23
23
|
}, [setFieldValue]);
|
|
24
24
|
const handleDelete = useCallback((index, columns) => {
|
|
25
|
-
setFieldValue('analysisOptions.columns', columns.filter((_, colIndex) => colIndex !== index));
|
|
25
|
+
void setFieldValue('analysisOptions.columns', columns.filter((_, colIndex) => colIndex !== index));
|
|
26
26
|
}, [setFieldValue]);
|
|
27
27
|
const COLUMNS = useMemo(() => {
|
|
28
28
|
return [
|
|
@@ -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;
|