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
|
@@ -4,7 +4,6 @@ import { useRef, useState } from 'react';
|
|
|
4
4
|
import { useChartData } from '../../context/ChartContext';
|
|
5
5
|
import { useDispatch } from '../../context/DispatchContext';
|
|
6
6
|
import { useAlert } from '../../elements/popup/Alert';
|
|
7
|
-
import { SET_AUTOMATIC_ASSIGNMENTS } from '../../reducer/types/Types';
|
|
8
7
|
import { assert } from '../../utility/assert';
|
|
9
8
|
function mapSpectra(data) {
|
|
10
9
|
return data.map((spectrum) => {
|
|
@@ -28,10 +27,12 @@ export function useAutoAssignments() {
|
|
|
28
27
|
const alert = useAlert();
|
|
29
28
|
const [assignments, setAssignments] = useState([]);
|
|
30
29
|
function restAssignments() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
if (originData.current) {
|
|
31
|
+
dispatch({
|
|
32
|
+
type: 'SET_AUTOMATIC_ASSIGNMENTS',
|
|
33
|
+
payload: { assignments: originData.current },
|
|
34
|
+
});
|
|
35
|
+
}
|
|
35
36
|
}
|
|
36
37
|
function getAssignments() {
|
|
37
38
|
void (async () => {
|
|
@@ -47,7 +48,7 @@ export function useAutoAssignments() {
|
|
|
47
48
|
}, { minScore: 0 });
|
|
48
49
|
if (result[0]?.assignment) {
|
|
49
50
|
dispatch({
|
|
50
|
-
type: SET_AUTOMATIC_ASSIGNMENTS,
|
|
51
|
+
type: 'SET_AUTOMATIC_ASSIGNMENTS',
|
|
51
52
|
payload: { assignments: result[0].assignment },
|
|
52
53
|
});
|
|
53
54
|
}
|
|
@@ -72,12 +72,12 @@ const columns = [
|
|
|
72
72
|
}, children: `${row.original.value}` })),
|
|
73
73
|
},
|
|
74
74
|
];
|
|
75
|
-
function InformationPanelInner({ info, meta,
|
|
75
|
+
function InformationPanelInner({ info, meta, customInfo, }) {
|
|
76
76
|
const [searchKey, setSearchKey] = useState();
|
|
77
77
|
const [panelsStatus, openPanel] = useState({
|
|
78
78
|
info: true,
|
|
79
79
|
meta: true,
|
|
80
|
-
|
|
80
|
+
customInfo: true,
|
|
81
81
|
});
|
|
82
82
|
function handleSearch(e) {
|
|
83
83
|
const searchKey = e.target.value.toLowerCase();
|
|
@@ -85,7 +85,7 @@ function InformationPanelInner({ info, meta, metaInfo, }) {
|
|
|
85
85
|
}
|
|
86
86
|
const matchesInfo = filter(searchKey, info);
|
|
87
87
|
const matchesMeta = filter(searchKey, meta);
|
|
88
|
-
const matchesMetaInfo = filter(searchKey,
|
|
88
|
+
const matchesMetaInfo = filter(searchKey, customInfo);
|
|
89
89
|
function handleOpen(key) {
|
|
90
90
|
openPanel((prevPanelsStatus) => ({
|
|
91
91
|
...prevPanelsStatus,
|
|
@@ -95,11 +95,11 @@ function InformationPanelInner({ info, meta, metaInfo, }) {
|
|
|
95
95
|
return (_jsxs("div", { style: styles.container, children: [_jsx("div", { children: _jsx(Input, { placeholder: "Search for parameter...", onChange: handleSearch, debounceTime: 250, style: {
|
|
96
96
|
inputWrapper: { width: '100%' },
|
|
97
97
|
input: { textAlign: 'left', padding: '5px' },
|
|
98
|
-
} }) }), _jsxs("div", { style: styles.tableContainer, children: [_jsx(InformationTable, { data:
|
|
98
|
+
} }) }), _jsxs("div", { style: styles.tableContainer, children: [_jsx(InformationTable, { data: matchesMetaInfo, columns: columns, title: "Custom information", onClick: () => handleOpen('customInfo'), isOpen: panelsStatus.customInfo }), _jsx(InformationTable, { data: matchesInfo, columns: columns, title: "Spectrum information", onClick: () => handleOpen('info'), isOpen: panelsStatus.info }), _jsx(InformationTable, { data: matchesMeta, columns: columns, title: "Other spectrum parameters", onClick: () => handleOpen('meta'), isOpen: panelsStatus.meta })] })] }));
|
|
99
99
|
}
|
|
100
100
|
const MemoizedInformationPanel = memo(InformationPanelInner);
|
|
101
101
|
const emptyData = { info: {}, meta: {} };
|
|
102
102
|
export default function InformationPanel() {
|
|
103
|
-
const { info, meta,
|
|
104
|
-
return _jsx(MemoizedInformationPanel, {
|
|
103
|
+
const { info, meta, customInfo } = useSpectrum(emptyData);
|
|
104
|
+
return _jsx(MemoizedInformationPanel, { info, meta, customInfo });
|
|
105
105
|
}
|
|
@@ -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(() => [
|
|
@@ -37,42 +38,31 @@ function IntegralTable({ activeTab, data }) {
|
|
|
37
38
|
index: 1,
|
|
38
39
|
Header: '#',
|
|
39
40
|
accessor: (_, index) => index + 1,
|
|
40
|
-
width:
|
|
41
|
+
style: { width: '30px', maxWidth: '30px' },
|
|
41
42
|
},
|
|
42
43
|
{
|
|
43
44
|
index: 2,
|
|
44
45
|
Header: 'From',
|
|
45
46
|
sortType: 'basic',
|
|
46
|
-
resizable: true,
|
|
47
47
|
accessor: (row) => row.from.toFixed(2),
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
index: 3,
|
|
51
51
|
Header: 'To',
|
|
52
52
|
sortType: 'basic',
|
|
53
|
-
resizable: true,
|
|
54
53
|
accessor: (row) => row.to.toFixed(2),
|
|
55
54
|
},
|
|
56
|
-
{
|
|
57
|
-
index: 6,
|
|
58
|
-
Header: 'Kind',
|
|
59
|
-
sortType: 'basic',
|
|
60
|
-
resizable: true,
|
|
61
|
-
accessor: 'kind',
|
|
62
|
-
Cell: ({ row }) => (_jsx(Select, { onChange: (value) => changeIntegralDataHandler(value, row), items: SignalKinds, style: selectStyle, defaultValue: row.original.kind })),
|
|
63
|
-
},
|
|
64
55
|
{
|
|
65
56
|
index: 7,
|
|
66
57
|
style: { width: '1%', maxWidth: '24px', minWidth: '24px' },
|
|
67
58
|
id: 'delete-button',
|
|
68
59
|
Cell: ({ row }) => (_jsx("button", { type: "button", className: "delete-button", onClick: (e) => deleteIntegralHandler(e, row), children: _jsx(FaRegTrashAlt, {}) })),
|
|
69
60
|
},
|
|
70
|
-
], [
|
|
61
|
+
], [deleteIntegralHandler]);
|
|
71
62
|
const saveRelativeHandler = useCallback((event, row) => {
|
|
72
|
-
const data = { value: event.target.value, id: row.id };
|
|
73
63
|
dispatch({
|
|
74
|
-
type: CHANGE_INTEGRAL_RELATIVE,
|
|
75
|
-
payload: {
|
|
64
|
+
type: 'CHANGE_INTEGRAL_RELATIVE',
|
|
65
|
+
payload: { value: event.target.value, id: row.id },
|
|
76
66
|
});
|
|
77
67
|
}, [dispatch]);
|
|
78
68
|
const integralsPreferences = usePanelPreferences('integrals', activeTab);
|
|
@@ -103,7 +93,21 @@ function IntegralTable({ activeTab, data }) {
|
|
|
103
93
|
return (_jsx(EditableColumn, { value: integral, onSave: (event) => saveRelativeHandler(event, row.original), type: "number" }));
|
|
104
94
|
},
|
|
105
95
|
},
|
|
106
|
-
|
|
96
|
+
{
|
|
97
|
+
index: 6,
|
|
98
|
+
Header: 'Kind',
|
|
99
|
+
sortType: 'basic',
|
|
100
|
+
resizable: true,
|
|
101
|
+
accessor: 'kind',
|
|
102
|
+
showWhen: 'showKind',
|
|
103
|
+
Cell: ({ row }) => (_jsx(Select, { onChange: (value) => changeIntegralDataHandler(value, row), items: SignalKinds, style: selectStyle, defaultValue: row.original.kind })),
|
|
104
|
+
},
|
|
105
|
+
], [
|
|
106
|
+
activeTab,
|
|
107
|
+
changeIntegralDataHandler,
|
|
108
|
+
integralsPreferences,
|
|
109
|
+
saveRelativeHandler,
|
|
110
|
+
]);
|
|
107
111
|
const tableColumns = useMemo(() => {
|
|
108
112
|
let columns = [...initialColumns];
|
|
109
113
|
for (const col of COLUMNS) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Formik } from 'formik';
|
|
3
|
-
import {
|
|
3
|
+
import { useCallback, useImperativeHandle, useRef, memo, forwardRef, useMemo, } from 'react';
|
|
4
4
|
import { usePreferences } from '../../context/PreferencesContext';
|
|
5
5
|
import Label from '../../elements/Label';
|
|
6
6
|
import FormikColorInput from '../../elements/formik/FormikColorInput';
|
|
@@ -23,6 +23,12 @@ const formatFields = [
|
|
|
23
23
|
checkControllerName: 'relative.show',
|
|
24
24
|
formatControllerName: 'relative.format',
|
|
25
25
|
},
|
|
26
|
+
{
|
|
27
|
+
id: 3,
|
|
28
|
+
label: 'Kind :',
|
|
29
|
+
checkControllerName: 'showKind',
|
|
30
|
+
hideFormatField: true,
|
|
31
|
+
},
|
|
26
32
|
];
|
|
27
33
|
function IntegralsPreferences(props, ref) {
|
|
28
34
|
const preferences = usePreferences();
|
|
@@ -30,9 +36,6 @@ function IntegralsPreferences(props, ref) {
|
|
|
30
36
|
const nuclei = useMemo(() => getUniqueNuclei(nucleus), [nucleus]);
|
|
31
37
|
const preferencesByNuclei = usePanelPreferencesByNuclei('integrals', nuclei);
|
|
32
38
|
const formRef = useRef();
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
formRef.current.setValues(preferencesByNuclei);
|
|
35
|
-
}, [preferencesByNuclei]);
|
|
36
39
|
const saveHandler = useCallback((values) => {
|
|
37
40
|
preferences.dispatch({
|
|
38
41
|
type: 'SET_PANELS_PREFERENCES',
|
|
@@ -44,7 +47,7 @@ function IntegralsPreferences(props, ref) {
|
|
|
44
47
|
formRef.current.submitForm();
|
|
45
48
|
},
|
|
46
49
|
}));
|
|
47
|
-
return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues:
|
|
50
|
+
return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: preferencesByNuclei, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => (_jsxs(_Fragment, { children: [_jsx(FormikColorInput, { name: `nuclei.${n}.color` }), _jsx(Label, { title: "stroke width :", style: {
|
|
48
51
|
label: {
|
|
49
52
|
fontSize: '11px',
|
|
50
53
|
fontWeight: 'bold',
|
|
@@ -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
|
}
|
|
@@ -15,14 +15,14 @@ import MenuButton from '../../elements/MenuButton';
|
|
|
15
15
|
import ToolTip from '../../elements/ToolTip/ToolTip';
|
|
16
16
|
import { useAlert } from '../../elements/popup/Alert';
|
|
17
17
|
import { positions, useModal } from '../../elements/popup/Modal';
|
|
18
|
+
import AboutPredictionModal from '../../modal/AboutPredictionModal';
|
|
18
19
|
import PredictSpectraModal from '../../modal/PredictSpectraModal';
|
|
19
|
-
import { ADD_MOLECULE, DELETE_MOLECULE, FLOAT_MOLECULE_OVER_SPECTRUM, TOGGLE_MOLECULE_ATOM_NUMBER, } from '../../reducer/types/Types';
|
|
20
20
|
import { copyPNGToClipboard, copyTextToClipboard, exportAsSVG, } from '../../utility/export';
|
|
21
21
|
const toolbarStyle = css `
|
|
22
22
|
display: flex;
|
|
23
23
|
flex-direction: row;
|
|
24
24
|
border-bottom: 0.55px solid rgb(240 240 240);
|
|
25
|
-
padding:
|
|
25
|
+
padding: 2px 5px;
|
|
26
26
|
|
|
27
27
|
button svg {
|
|
28
28
|
fill: #4e4e4e;
|
|
@@ -130,14 +130,14 @@ export default function MoleculePanelHeader({ currentIndex, molecules, molecules
|
|
|
130
130
|
]);
|
|
131
131
|
const handlePaste = useCallback(() => {
|
|
132
132
|
void navigator.clipboard.readText().then((molfile) => {
|
|
133
|
-
dispatch({ type: ADD_MOLECULE, molfile });
|
|
133
|
+
dispatch({ type: 'ADD_MOLECULE', payload: { molfile } });
|
|
134
134
|
});
|
|
135
135
|
}, [dispatch]);
|
|
136
136
|
const handleDelete = useCallback(() => {
|
|
137
137
|
if (molecules[currentIndex]?.id) {
|
|
138
138
|
onMoleculeIndexChange(0);
|
|
139
139
|
dispatch({
|
|
140
|
-
type: DELETE_MOLECULE,
|
|
140
|
+
type: 'DELETE_MOLECULE',
|
|
141
141
|
payload: { id: molecules[currentIndex].id, assignmentData },
|
|
142
142
|
});
|
|
143
143
|
}
|
|
@@ -157,18 +157,18 @@ export default function MoleculePanelHeader({ currentIndex, molecules, molecules
|
|
|
157
157
|
}, [modal, molecules, currentIndex]);
|
|
158
158
|
function floatMoleculeHandler() {
|
|
159
159
|
dispatch({
|
|
160
|
-
type: FLOAT_MOLECULE_OVER_SPECTRUM,
|
|
160
|
+
type: 'FLOAT_MOLECULE_OVER_SPECTRUM',
|
|
161
161
|
payload: { id: moleculeKey },
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
function showAtomNumbersHandler() {
|
|
165
165
|
dispatch({
|
|
166
|
-
type: TOGGLE_MOLECULE_ATOM_NUMBER,
|
|
166
|
+
type: 'TOGGLE_MOLECULE_ATOM_NUMBER',
|
|
167
167
|
payload: { id: moleculeKey },
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
const hasMolecules = molecules && molecules.length > 0;
|
|
171
|
-
return (_jsxs("div", { css: toolbarStyle, children: [!actionsOptions.hideExport && (_jsx(MenuButton, { component: _jsx(FaFileExport, {}), toolTip: "Export As", items: MOL_EXPORT_MENU, onClick: exportHandler })), !actionsOptions.hidePast && (_jsx(ToolTip, { title: "Paste molfile", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handlePaste, children: _jsx(FaPaste, {}) }) })), !actionsOptions.hideAdd && (_jsx(ToolTip, { title: "Add molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: onOpenMoleculeEditor, children: _jsx(FaPlus, {}) }) })), !actionsOptions.hideDelete && (_jsx(ToolTip, { title: "Delete molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handleDelete, children: _jsx(FaRegTrashAlt, {}) }) })), !actionsOptions.hidePredict && hasMolecules && (_jsx(ButtonToolTip, { popupTitle: "Predict spectra", popupPlacement: "left", onClick: openPredictSpectraModal, children: _jsx(SvgNmrFt, {}) })), _jsx(ActiveButton, { value: moleculesView?.[moleculeKey]?.floating.visible || false, popupTitle: "Float molecule", popupPlacement: "left", onClick: floatMoleculeHandler, disabled: !hasMolecules, children: _jsx(IoOpenOutline, {}) }), _jsx(ActiveButton, { style: { marginLeft: '2px' }, value: moleculesView?.[moleculeKey]?.showAtomNumber || false, popupTitle: "Show atom number", popupPlacement: "left", onClick: showAtomNumbersHandler, disabled: !hasMolecules, children: _jsx("p", { style: atomLabelStyle, children: "#" }) }), _jsxs("p", { children: [molecules &&
|
|
171
|
+
return (_jsxs("div", { css: toolbarStyle, children: [actionsOptions?.showAboutPredict && _jsx(AboutPredictionModal, {}), !actionsOptions.hideExport && (_jsx(MenuButton, { component: _jsx(FaFileExport, {}), toolTip: "Export As", items: MOL_EXPORT_MENU, onClick: exportHandler })), !actionsOptions.hidePast && (_jsx(ToolTip, { title: "Paste molfile", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handlePaste, children: _jsx(FaPaste, {}) }) })), !actionsOptions.hideAdd && (_jsx(ToolTip, { title: "Add molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: onOpenMoleculeEditor, children: _jsx(FaPlus, {}) }) })), !actionsOptions.hideDelete && (_jsx(ToolTip, { title: "Delete molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handleDelete, children: _jsx(FaRegTrashAlt, {}) }) })), !actionsOptions.hidePredict && hasMolecules && (_jsx(ButtonToolTip, { popupTitle: "Predict spectra", popupPlacement: "left", onClick: openPredictSpectraModal, children: _jsx(SvgNmrFt, {}) })), _jsx(ActiveButton, { value: moleculesView?.[moleculeKey]?.floating.visible || false, popupTitle: "Float molecule", popupPlacement: "left", onClick: floatMoleculeHandler, disabled: !hasMolecules, children: _jsx(IoOpenOutline, {}) }), _jsx(ActiveButton, { style: { marginLeft: '2px' }, value: moleculesView?.[moleculeKey]?.showAtomNumber || false, popupTitle: "Show atom number", popupPlacement: "left", onClick: showAtomNumbersHandler, disabled: !hasMolecules, children: _jsx("p", { style: atomLabelStyle, children: "#" }) }), _jsxs("p", { children: [molecules &&
|
|
172
172
|
molecules.length > 0 &&
|
|
173
173
|
`${+(currentIndex + 1)} / ${molecules.length}`, ' '] })] }));
|
|
174
174
|
}
|
|
@@ -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 [
|