nmrium 1.9.0 → 1.10.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/ApodizationLine.js +1 -1
- package/lib/component/1d/ApodizationLine.js.map +1 -1
- package/lib/component/1d/BrushTracker1D.d.ts.map +1 -1
- package/lib/component/1d/BrushTracker1D.js.map +1 -1
- package/lib/component/1d/FooterBanner.js.map +1 -1
- package/lib/component/1d/LinesSeries.js +2 -2
- package/lib/component/1d/LinesSeries.js.map +1 -1
- package/lib/component/1d/SVGContent1D.d.ts.map +1 -1
- package/lib/component/1d/SVGContent1D.js +2 -1
- package/lib/component/1d/SVGContent1D.js.map +1 -1
- package/lib/component/1d/SimilarityTree.d.ts.map +1 -1
- package/lib/component/1d/SimilarityTree.js.map +1 -1
- package/lib/component/1d/inset/InsetProvider.d.ts.map +1 -1
- package/lib/component/1d/inset/InsetProvider.js.map +1 -1
- package/lib/component/1d/integral/IntegralResizable.d.ts.map +1 -1
- package/lib/component/1d/integral/IntegralResizable.js.map +1 -1
- package/lib/component/1d/matrix/Boxplot.js.map +1 -1
- package/lib/component/1d/multiAnalysis/AnalysisRange.d.ts.map +1 -1
- package/lib/component/1d/multiAnalysis/AnalysisRange.js.map +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts.map +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +13 -20
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js.map +1 -1
- package/lib/component/1d/multiplicityTree/generateTreeNodes.d.ts +1 -0
- package/lib/component/1d/multiplicityTree/generateTreeNodes.d.ts.map +1 -1
- package/lib/component/1d/multiplicityTree/generateTreeNodes.js +2 -1
- package/lib/component/1d/multiplicityTree/generateTreeNodes.js.map +1 -1
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts.map +1 -1
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js.map +1 -1
- package/lib/component/1d/peaks/PeakEditionManager.d.ts.map +1 -1
- package/lib/component/1d/peaks/PeakEditionManager.js +2 -2
- package/lib/component/1d/peaks/PeakEditionManager.js.map +1 -1
- package/lib/component/1d/peaks/Peaks.d.ts +4 -1
- package/lib/component/1d/peaks/Peaks.d.ts.map +1 -1
- package/lib/component/1d/peaks/Peaks.js.map +1 -1
- package/lib/component/1d/ranges/AssignmentLabel.d.ts +2 -1
- package/lib/component/1d/ranges/AssignmentLabel.d.ts.map +1 -1
- package/lib/component/1d/ranges/AssignmentLabel.js +6 -4
- package/lib/component/1d/ranges/AssignmentLabel.js.map +1 -1
- package/lib/component/1d/ranges/Atoms.js +2 -2
- package/lib/component/1d/ranges/Atoms.js.map +1 -1
- package/lib/component/1d/ranges/Range.d.ts +2 -1
- package/lib/component/1d/ranges/Range.d.ts.map +1 -1
- package/lib/component/1d/ranges/Range.js +28 -56
- package/lib/component/1d/ranges/Range.js.map +1 -1
- package/lib/component/1d/ranges/Ranges.d.ts.map +1 -1
- package/lib/component/1d/ranges/Ranges.js +19 -13
- package/lib/component/1d/ranges/Ranges.js.map +1 -1
- package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.d.ts +14 -0
- package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.d.ts.map +1 -0
- package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.js +67 -0
- package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.js.map +1 -0
- package/lib/component/1d/tool/BaseLineZones.d.ts.map +1 -1
- package/lib/component/1d/tool/BaseLineZones.js.map +1 -1
- package/lib/component/1d/utilities/intersectionResolver.d.ts.map +1 -1
- package/lib/component/1d/utilities/intersectionResolver.js.map +1 -1
- package/lib/component/1d-2d/FieldEdition.d.ts.map +1 -1
- package/lib/component/1d-2d/FieldEdition.js.map +1 -1
- package/lib/component/2d/1d-tracer/VerticalSliceChart.js.map +1 -1
- package/lib/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.js +1 -1
- package/lib/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.js.map +1 -1
- package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.js +1 -1
- package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.js.map +1 -1
- package/lib/component/2d/BrushTracker2D.d.ts.map +1 -1
- package/lib/component/2d/BrushTracker2D.js +41 -46
- package/lib/component/2d/BrushTracker2D.js.map +1 -1
- package/lib/component/2d/FooterBanner.d.ts +2 -2
- package/lib/component/2d/FooterBanner.d.ts.map +1 -1
- package/lib/component/2d/FooterBanner.js +63 -97
- package/lib/component/2d/FooterBanner.js.map +1 -1
- package/lib/component/2d/SVGContent2D.d.ts +2 -2
- package/lib/component/2d/SVGContent2D.d.ts.map +1 -1
- package/lib/component/2d/SVGContent2D.js.map +1 -1
- package/lib/component/2d/SlicingView.js +1 -1
- package/lib/component/2d/SlicingView.js.map +1 -1
- package/lib/component/2d/Viewer2D.js +1 -1
- package/lib/component/2d/Viewer2D.js.map +1 -1
- package/lib/component/2d/ft/FTContainer.d.ts +2 -2
- package/lib/component/2d/ft/FTContainer.d.ts.map +1 -1
- package/lib/component/2d/ft/FTContainer.js +1 -1
- package/lib/component/2d/ft/FTContainer.js.map +1 -1
- package/lib/component/2d/tools/XYLabelPointer.d.ts +2 -2
- package/lib/component/2d/tools/XYLabelPointer.d.ts.map +1 -1
- package/lib/component/2d/tools/XYLabelPointer.js +10 -9
- package/lib/component/2d/tools/XYLabelPointer.js.map +1 -1
- package/lib/component/2d/useTracesSpectra.d.ts +3 -2
- package/lib/component/2d/useTracesSpectra.d.ts.map +1 -1
- package/lib/component/2d/useTracesSpectra.js +19 -12
- package/lib/component/2d/useTracesSpectra.js.map +1 -1
- package/lib/component/2d/utilities/extractSpectrumSignals.js +2 -2
- package/lib/component/2d/utilities/extractSpectrumSignals.js.map +1 -1
- package/lib/component/2d/zones/Signal.js.map +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.d.ts.map +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.js +15 -13
- package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.js +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.js.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts +5 -6
- package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.js +2 -0
- package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
- package/lib/component/assignment/utilities/getAssignments.js +1 -2
- package/lib/component/assignment/utilities/getAssignments.js.map +1 -1
- package/lib/component/context/KeyModifierContext.d.ts +3 -2
- package/lib/component/context/KeyModifierContext.d.ts.map +1 -1
- package/lib/component/context/KeyModifierContext.js +7 -4
- package/lib/component/context/KeyModifierContext.js.map +1 -1
- package/lib/component/elements/ActionsButtonsPopover.d.ts.map +1 -1
- package/lib/component/elements/ActionsButtonsPopover.js +17 -3
- package/lib/component/elements/ActionsButtonsPopover.js.map +1 -1
- package/lib/component/elements/AssignmentsCell.d.ts.map +1 -1
- package/lib/component/elements/AssignmentsCell.js.map +1 -1
- package/lib/component/elements/Button.d.ts.map +1 -1
- package/lib/component/elements/Button.js.map +1 -1
- package/lib/component/elements/CheckController.d.ts.map +1 -1
- package/lib/component/elements/CheckController.js.map +1 -1
- package/lib/component/elements/ContextMenuBluePrint.d.ts.map +1 -1
- package/lib/component/elements/ContextMenuBluePrint.js.map +1 -1
- package/lib/component/elements/D3Axis.d.ts.map +1 -1
- package/lib/component/elements/DraggableDialog.d.ts.map +1 -1
- package/lib/component/elements/DraggableDialog.js.map +1 -1
- package/lib/component/elements/Input.d.ts.map +1 -1
- package/lib/component/elements/Input.js.map +1 -1
- package/lib/component/elements/Input2.d.ts.map +1 -1
- package/lib/component/elements/Input2.js.map +1 -1
- package/lib/component/elements/Input2Controller.d.ts.map +1 -1
- package/lib/component/elements/Input2Controller.js.map +1 -1
- package/lib/component/elements/Label.d.ts.map +1 -1
- package/lib/component/elements/Label.js.map +1 -1
- package/lib/component/elements/NumberInput2.d.ts.map +1 -1
- package/lib/component/elements/NumberInput2.js.map +1 -1
- package/lib/component/elements/NumberInput2Controller.d.ts.map +1 -1
- package/lib/component/elements/NumberInput2Controller.js.map +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts.map +1 -1
- package/lib/component/elements/ReactTable/ReactTable.js.map +1 -1
- package/lib/component/elements/ReadOnly.d.ts.map +1 -1
- package/lib/component/elements/ReadOnly.js.map +1 -1
- package/lib/component/elements/Sections.js.map +1 -1
- package/lib/component/elements/Select.d.ts.map +1 -1
- package/lib/component/elements/Select.js.map +1 -1
- package/lib/component/elements/ToolbarPopoverItem.d.ts.map +1 -1
- package/lib/component/elements/export/ExportContent.d.ts.map +1 -1
- package/lib/component/elements/export/ExportContent.js.map +1 -1
- package/lib/component/elements/print/PrintContent.d.ts.map +1 -1
- package/lib/component/elements/print/PrintContent.js.map +1 -1
- package/lib/component/hooks/useActiveSpectrumIntegralsViewState.d.ts.map +1 -1
- package/lib/component/hooks/useActiveSpectrumIntegralsViewState.js +2 -4
- package/lib/component/hooks/useActiveSpectrumIntegralsViewState.js.map +1 -1
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts.map +1 -1
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.js +2 -4
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.js.map +1 -1
- package/lib/component/hooks/useActiveSpectrumRangesViewState.d.ts.map +1 -1
- package/lib/component/hooks/useActiveSpectrumRangesViewState.js +2 -4
- package/lib/component/hooks/useActiveSpectrumRangesViewState.js.map +1 -1
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js.map +1 -1
- package/lib/component/hooks/useActiveSpectrumZonesViewState.d.ts.map +1 -1
- package/lib/component/hooks/useActiveSpectrumZonesViewState.js +2 -4
- package/lib/component/hooks/useActiveSpectrumZonesViewState.js.map +1 -1
- package/lib/component/hooks/useExport.js +1 -1
- package/lib/component/hooks/useExport.js.map +1 -1
- package/lib/component/hooks/useSaveSettings.d.ts.map +1 -1
- package/lib/component/hooks/useSaveSettings.js +28 -47
- package/lib/component/hooks/useSaveSettings.js.map +1 -1
- package/lib/component/hooks/useSetActiveSpectrumAction.d.ts +2 -1
- package/lib/component/hooks/useSetActiveSpectrumAction.d.ts.map +1 -1
- package/lib/component/hooks/useSetActiveSpectrumAction.js +2 -2
- package/lib/component/hooks/useSetActiveSpectrumAction.js.map +1 -1
- package/lib/component/hooks/useSpectrumWithDataSource.js +1 -1
- package/lib/component/hooks/useSpectrumWithDataSource.js.map +1 -1
- package/lib/component/hooks/useWorkspaceAction.d.ts +1 -1
- package/lib/component/hooks/useWorkspaceAction.d.ts.map +1 -1
- package/lib/component/hooks/useWorkspaceAction.js +3 -0
- package/lib/component/hooks/useWorkspaceAction.js.map +1 -1
- package/lib/component/modal/ImportPublicationStringModal.d.ts.map +1 -1
- package/lib/component/modal/ImportPublicationStringModal.js.map +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts.map +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.js.map +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.d.ts.map +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js.map +1 -1
- package/lib/component/modal/setting/GeneralSettings.d.ts.map +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +5 -1
- package/lib/component/modal/setting/GeneralSettings.js.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +14 -10
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js +17 -17
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js +0 -3
- package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +5 -20
- package/lib/component/panels/RangesPanel/RangesTableRow.js.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.d.ts +9 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.d.ts.map +1 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.js +19 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.js.map +1 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -6
- package/lib/component/panels/SummaryPanel/SummaryPanel.js.map +1 -1
- package/lib/component/panels/accordionItems.d.ts.map +1 -1
- package/lib/component/panels/accordionItems.js.map +1 -1
- package/lib/component/panels/extra/preferences/NucleusPreferences.d.ts.map +1 -1
- package/lib/component/panels/informationPanel/InformationEditionModal.d.ts.map +1 -1
- package/lib/component/panels/informationPanel/InformationEditionModal.js.map +1 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.d.ts.map +1 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +13 -9
- package/lib/component/panels/predictionPanel/PredictionPanel.js.map +1 -1
- package/lib/component/reducer/Reducer.js +7 -7
- package/lib/component/reducer/Reducer.js.map +1 -1
- package/lib/component/reducer/actions/AssignmentsActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/AssignmentsActions.js +9 -9
- package/lib/component/reducer/actions/AssignmentsActions.js.map +1 -1
- package/lib/component/reducer/actions/CorrelationsActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/CorrelationsActions.js +21 -21
- package/lib/component/reducer/actions/CorrelationsActions.js.map +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
- package/lib/component/reducer/actions/DomainActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/DomainActions.js +10 -18
- package/lib/component/reducer/actions/DomainActions.js.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.js +28 -44
- package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
- package/lib/component/reducer/actions/InsetActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/InsetActions.js +9 -18
- package/lib/component/reducer/actions/InsetActions.js.map +1 -1
- package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
- package/lib/component/reducer/actions/IntegralsActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/IntegralsActions.js +43 -48
- package/lib/component/reducer/actions/IntegralsActions.js.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +2 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.js +64 -10
- package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
- package/lib/component/reducer/actions/PeaksActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/PeaksActions.js +110 -121
- package/lib/component/reducer/actions/PeaksActions.js.map +1 -1
- package/lib/component/reducer/actions/PreferencesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/PreferencesActions.js +2 -1
- package/lib/component/reducer/actions/PreferencesActions.js.map +1 -1
- package/lib/component/reducer/actions/RangesActions.d.ts +18 -18
- package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/RangesActions.js +148 -171
- package/lib/component/reducer/actions/RangesActions.js.map +1 -1
- package/lib/component/reducer/actions/SpectraActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/SpectraActions.js +29 -31
- package/lib/component/reducer/actions/SpectraActions.js.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +10 -11
- package/lib/component/reducer/actions/ToolsActions.js.map +1 -1
- package/lib/component/reducer/actions/ZonesActions.d.ts +8 -9
- package/lib/component/reducer/actions/ZonesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/ZonesActions.js +123 -151
- package/lib/component/reducer/actions/ZonesActions.js.map +1 -1
- package/lib/component/reducer/helper/get2DRange.d.ts +3 -1
- package/lib/component/reducer/helper/get2DRange.d.ts.map +1 -1
- package/lib/component/reducer/helper/get2DRange.js.map +1 -1
- package/lib/component/reducer/helper/getSpectrum.js +1 -1
- package/lib/component/reducer/helper/getSpectrum.js.map +1 -1
- package/lib/component/reducer/helper/setIntegralsViewProperty.js +1 -1
- package/lib/component/reducer/helper/setIntegralsViewProperty.js.map +1 -1
- package/lib/component/reducer/helper/setRangesViewProperty.js +1 -1
- package/lib/component/reducer/helper/setRangesViewProperty.js.map +1 -1
- package/lib/component/useWatchForm.d.ts.map +1 -1
- package/lib/component/useWatchForm.js.map +1 -1
- package/lib/component/utility/stackOverlappingLabels.d.ts +1 -1
- package/lib/component/utility/stackOverlappingLabels.d.ts.map +1 -1
- package/lib/component/utility/stackOverlappingLabels.js.map +1 -1
- package/lib/data/SpectraManager.d.ts.map +1 -1
- package/lib/data/SpectraManager.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.js +0 -3
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +8 -1
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts +4 -14
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +3 -5
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +3 -5
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +2 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +7 -63
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +9 -14
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +2 -10
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +23 -43
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +1 -54
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.js.map +1 -1
- package/lib/data/molecules/Molecule.d.ts.map +1 -1
- package/lib/data/molecules/Molecule.js.map +1 -1
- package/lib/data/types/data1d/RangeDetectionResult.d.ts.map +1 -1
- package/lib/data/utilities/FindUtilities.d.ts.map +1 -1
- package/lib/data/utilities/FindUtilities.js +11 -11
- package/lib/data/utilities/FindUtilities.js.map +1 -1
- package/lib/utils/clipboard/clipboardComponents.d.ts.map +1 -1
- package/lib/utils/clipboard/clipboardComponents.js.map +1 -1
- package/lib/utils/clipboard/clipboardHooks.d.ts +2 -2
- package/lib/utils/clipboard/clipboardHooks.d.ts.map +1 -1
- package/lib/utils/clipboard/clipboardHooks.js +10 -4
- package/lib/utils/clipboard/clipboardHooks.js.map +1 -1
- package/lib/versionInfo.d.ts.map +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib/versionInfo.js.map +1 -1
- package/package.json +33 -31
- package/src/component/1d/ApodizationLine.tsx +1 -1
- package/src/component/1d/BrushTracker1D.tsx +10 -10
- package/src/component/1d/FooterBanner.tsx +2 -2
- package/src/component/1d/LinesSeries.tsx +2 -2
- package/src/component/1d/SVGContent1D.tsx +6 -2
- package/src/component/1d/SimilarityTree.tsx +3 -2
- package/src/component/1d/inset/InsetProvider.tsx +4 -2
- package/src/component/1d/integral/IntegralResizable.tsx +2 -1
- package/src/component/1d/matrix/Boxplot.tsx +3 -3
- package/src/component/1d/multiAnalysis/AnalysisRange.tsx +2 -1
- package/src/component/1d/multiplicityTree/MultiplicityTree.tsx +24 -23
- package/src/component/1d/multiplicityTree/generateTreeNodes.ts +10 -1
- package/src/component/1d/peaks/PeakAnnotationsSpreadMode.tsx +4 -2
- package/src/component/1d/peaks/PeakEditionManager.tsx +8 -3
- package/src/component/1d/peaks/Peaks.tsx +5 -1
- package/src/component/1d/ranges/AssignmentLabel.tsx +8 -5
- package/src/component/1d/ranges/Atoms.tsx +2 -2
- package/src/component/1d/ranges/Range.tsx +42 -74
- package/src/component/1d/ranges/Ranges.tsx +33 -28
- package/src/component/1d/ranges/useAssignmentsPopoverActionsButtons.tsx +93 -0
- package/src/component/1d/tool/BaseLineZones.tsx +2 -1
- package/src/component/1d/utilities/intersectionResolver.ts +3 -4
- package/src/component/1d-2d/FieldEdition.tsx +2 -2
- package/src/component/2d/1d-tracer/VerticalSliceChart.tsx +2 -2
- package/src/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.tsx +1 -1
- package/src/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.tsx +1 -1
- package/src/component/2d/BrushTracker2D.tsx +50 -55
- package/src/component/2d/FooterBanner.tsx +80 -105
- package/src/component/2d/SVGContent2D.tsx +2 -3
- package/src/component/2d/SlicingView.tsx +1 -1
- package/src/component/2d/Viewer2D.tsx +2 -2
- package/src/component/2d/ft/FTContainer.tsx +4 -5
- package/src/component/2d/tools/XYLabelPointer.tsx +12 -11
- package/src/component/2d/useTracesSpectra.ts +28 -16
- package/src/component/2d/utilities/extractSpectrumSignals.ts +2 -2
- package/src/component/2d/zones/Signal.tsx +1 -1
- package/src/component/2d/zones/SignalsGuideLines.tsx +21 -19
- package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +4 -4
- package/src/component/EventsTrackers/BrushTracker.tsx +24 -17
- package/src/component/assignment/utilities/getAssignments.ts +1 -2
- package/src/component/context/KeyModifierContext.tsx +13 -5
- package/src/component/elements/ActionsButtonsPopover.tsx +25 -8
- package/src/component/elements/AssignmentsCell.tsx +1 -2
- package/src/component/elements/Button.tsx +3 -2
- package/src/component/elements/CheckController.tsx +2 -1
- package/src/component/elements/ContextMenuBluePrint.tsx +2 -1
- package/src/component/elements/D3Axis.tsx +3 -3
- package/src/component/elements/DraggableDialog.tsx +2 -1
- package/src/component/elements/Input.tsx +4 -2
- package/src/component/elements/Input2.tsx +1 -2
- package/src/component/elements/Input2Controller.tsx +2 -1
- package/src/component/elements/Label.tsx +2 -1
- package/src/component/elements/NumberInput2.tsx +4 -2
- package/src/component/elements/NumberInput2Controller.tsx +3 -1
- package/src/component/elements/ReactTable/ReactTable.tsx +1 -3
- package/src/component/elements/ReadOnly.tsx +4 -2
- package/src/component/elements/Sections.tsx +5 -4
- package/src/component/elements/Select.tsx +4 -2
- package/src/component/elements/ToolbarPopoverItem.tsx +3 -3
- package/src/component/elements/export/ExportContent.tsx +1 -2
- package/src/component/elements/print/PrintContent.tsx +1 -2
- package/src/component/hooks/useActiveSpectrumIntegralsViewState.ts +2 -6
- package/src/component/hooks/useActiveSpectrumPeaksViewState.ts +2 -6
- package/src/component/hooks/useActiveSpectrumRangesViewState.ts +2 -6
- package/src/component/hooks/useActiveSpectrumStyleOptions.ts +2 -2
- package/src/component/hooks/useActiveSpectrumZonesViewState.ts +2 -6
- package/src/component/hooks/useExport.tsx +1 -1
- package/src/component/hooks/useSaveSettings.tsx +68 -81
- package/src/component/hooks/useSetActiveSpectrumAction.ts +3 -2
- package/src/component/hooks/useSpectrumWithDataSource.ts +1 -1
- package/src/component/hooks/useWorkspaceAction.ts +5 -0
- package/src/component/modal/ImportPublicationStringModal.tsx +1 -2
- package/src/component/modal/changeSum/ChangeSumModal.tsx +4 -2
- package/src/component/modal/metaImportation/MetaImportationModal.tsx +1 -2
- package/src/component/modal/setting/GeneralSettings.tsx +7 -2
- package/src/component/panels/IntegralsPanel/IntegralTable.tsx +4 -2
- package/src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx +17 -13
- package/src/component/panels/MoleculesPanel/hooks/useAtomAssignment.tsx +17 -15
- package/src/component/panels/MoleculesPanel/utilities/getAssignIds.ts +0 -4
- package/src/component/panels/RangesPanel/RangesPanel.tsx +1 -1
- package/src/component/panels/RangesPanel/RangesTable.tsx +3 -8
- package/src/component/panels/RangesPanel/RangesTableRow.tsx +14 -47
- package/src/component/panels/RangesPanel/TableColumns/ActionsColumn.tsx +1 -2
- package/src/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.tsx +40 -0
- package/src/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.tsx +1 -2
- package/src/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.tsx +2 -2
- package/src/component/panels/SummaryPanel/SummaryPanel.tsx +6 -6
- package/src/component/panels/accordionItems.tsx +4 -2
- package/src/component/panels/extra/preferences/NucleusPreferences.tsx +2 -2
- package/src/component/panels/informationPanel/InformationEditionModal.tsx +4 -2
- package/src/component/panels/predictionPanel/PredictionPanel.tsx +17 -9
- package/src/component/reducer/Reducer.ts +8 -8
- package/src/component/reducer/actions/AssignmentsActions.ts +8 -13
- package/src/component/reducer/actions/CorrelationsActions.ts +21 -22
- package/src/component/reducer/actions/DatabaseActions.ts +1 -1
- package/src/component/reducer/actions/DomainActions.ts +16 -22
- package/src/component/reducer/actions/FiltersActions.ts +34 -58
- package/src/component/reducer/actions/InsetActions.ts +9 -19
- package/src/component/reducer/actions/IntegralsActions.ts +48 -59
- package/src/component/reducer/actions/MoleculeActions.ts +94 -14
- package/src/component/reducer/actions/PeaksActions.ts +112 -136
- package/src/component/reducer/actions/PreferencesActions.ts +4 -3
- package/src/component/reducer/actions/RangesActions.ts +196 -244
- package/src/component/reducer/actions/SpectraActions.ts +40 -45
- package/src/component/reducer/actions/ToolsActions.ts +9 -13
- package/src/component/reducer/actions/ZonesActions.ts +158 -218
- package/src/component/reducer/helper/get2DRange.ts +4 -1
- package/src/component/reducer/helper/getSpectrum.ts +1 -1
- package/src/component/reducer/helper/setIntegralsViewProperty.ts +1 -1
- package/src/component/reducer/helper/setRangesViewProperty.ts +1 -1
- package/src/component/useWatchForm.tsx +2 -1
- package/src/component/utility/stackOverlappingLabels.ts +4 -1
- package/src/data/SpectraManager.ts +0 -2
- package/src/data/data1d/Spectrum1D/isRangeAssigned.ts +0 -4
- package/src/data/data1d/Spectrum1D/ranges/autoRangesDetection.ts +15 -5
- package/src/data/data1d/Spectrum1D/ranges/changeRangeSignal.ts +5 -5
- package/src/data/data1d/Spectrum1D/ranges/detectRanges.ts +5 -14
- package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +2 -2
- package/src/data/data2d/Spectrum2D/zones/changeZoneSignal.ts +3 -5
- package/src/data/data2d/Spectrum2D/zones/detectZones.ts +3 -2
- package/src/data/data2d/Spectrum2D/zones/detectZonesManual.ts +19 -16
- package/src/data/data2d/Spectrum2D/zones/getDetectionZones.ts +35 -56
- package/src/data/data2d/Spectrum2D/zones/initiateZones.ts +1 -1
- package/src/data/molecules/Molecule.ts +2 -1
- package/src/data/types/data1d/RangeDetectionResult.ts +4 -2
- package/src/data/utilities/FindUtilities.ts +9 -8
- package/src/utils/clipboard/clipboardComponents.tsx +2 -1
- package/src/utils/clipboard/clipboardHooks.ts +14 -8
- package/src/versionInfo.ts +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.d.ts +0 -8
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.d.ts.map +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.js +0 -17
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.js.map +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +0 -17
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts.map +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +0 -40
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js.map +0 -1
- package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.tsx +0 -36
- package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.tsx +0 -89
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
import type { Spectrum1D, Spectrum2D, Spectrum } from '@zakodium/nmrium-core';
|
|
13
13
|
import type { NmrData1D, NmrData2DFt } from 'cheminfo-types';
|
|
14
14
|
import type { Draft } from 'immer';
|
|
15
|
-
import { current } from 'immer';
|
|
15
|
+
import { current, isDraft } from 'immer';
|
|
16
16
|
import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
17
17
|
import type { Filter1D, FilterDomainUpdateRules } from 'nmr-processing';
|
|
18
18
|
import {
|
|
@@ -321,38 +321,36 @@ function findSpectrum(
|
|
|
321
321
|
options: SpectrumOptions,
|
|
322
322
|
): { index: number; spectrum: Spectrum } | null {
|
|
323
323
|
const { target } = options;
|
|
324
|
-
const spectra =
|
|
324
|
+
const spectra = draft.data;
|
|
325
325
|
if (target === 'active') {
|
|
326
326
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
327
|
-
|
|
328
327
|
if (!activeSpectrum) return null;
|
|
328
|
+
|
|
329
329
|
const { index } = activeSpectrum;
|
|
330
|
-
return { index, spectrum:
|
|
330
|
+
return { index, spectrum: spectra[index] };
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
if (target === 'current') {
|
|
334
334
|
const { spectrum } = options;
|
|
335
|
-
|
|
336
335
|
if (!spectrum) return null;
|
|
337
336
|
|
|
338
337
|
const index = spectra.findIndex((datum) => datum.id === spectrum.id);
|
|
339
|
-
return { index, spectrum
|
|
338
|
+
return { index, spectrum };
|
|
340
339
|
}
|
|
341
340
|
|
|
342
341
|
if (target === 'id') {
|
|
343
342
|
const { id } = options;
|
|
344
343
|
const index = spectra.findIndex((spectrum) => spectrum.id === id);
|
|
345
|
-
|
|
346
344
|
if (index === -1) return null;
|
|
347
345
|
|
|
348
|
-
return { index, spectrum:
|
|
346
|
+
return { index, spectrum: spectra[index] };
|
|
349
347
|
}
|
|
350
348
|
if (target === 'index') {
|
|
351
349
|
const { index } = options;
|
|
352
350
|
const spectrum = spectra?.[index];
|
|
353
351
|
if (spectrum) return null;
|
|
354
352
|
|
|
355
|
-
return { index, spectrum
|
|
353
|
+
return { index, spectrum };
|
|
356
354
|
}
|
|
357
355
|
|
|
358
356
|
return null;
|
|
@@ -441,8 +439,7 @@ function rollbackSpectrumByFilter(
|
|
|
441
439
|
let currentIsFid = false;
|
|
442
440
|
const toolData = draft.toolOptions.data;
|
|
443
441
|
if (currentSpectrum) {
|
|
444
|
-
const { index } = currentSpectrum;
|
|
445
|
-
let { spectrum } = currentSpectrum;
|
|
442
|
+
const { index, spectrum } = currentSpectrum;
|
|
446
443
|
previousIsFid = isFid1DSpectrum(spectrum) || isFid2DSpectrum(spectrum);
|
|
447
444
|
const filterIndex = spectrum.filters.findIndex((f) => f[searchBy] === key);
|
|
448
445
|
if (filterIndex === -1 || reset) {
|
|
@@ -458,16 +455,15 @@ function rollbackSpectrumByFilter(
|
|
|
458
455
|
reapplyFilters(spectrum, filters);
|
|
459
456
|
}
|
|
460
457
|
|
|
461
|
-
//
|
|
462
|
-
draft.tempData =
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
458
|
+
// If the filter doesn't exist, create a clone of the current data.
|
|
459
|
+
draft.tempData = current(draft).data.slice();
|
|
460
|
+
draft.tempData[index] = structuredClone(
|
|
461
|
+
isDraft(spectrum) ? current(spectrum) : spectrum,
|
|
462
|
+
);
|
|
466
463
|
|
|
467
464
|
if (tempRollback) {
|
|
468
465
|
reapplyFilters(spectrum);
|
|
469
466
|
}
|
|
470
|
-
draft.data[index] = spectrum;
|
|
471
467
|
}
|
|
472
468
|
|
|
473
469
|
if (filterIndex !== -1 && !reset) {
|
|
@@ -477,7 +473,7 @@ function rollbackSpectrumByFilter(
|
|
|
477
473
|
//set active filter
|
|
478
474
|
toolData.activeFilterID = spectrum.filters?.[filterIndex]?.id || null;
|
|
479
475
|
|
|
480
|
-
const filters
|
|
476
|
+
const filters = spectrum.filters.slice(0, filterIndex);
|
|
481
477
|
|
|
482
478
|
updateDomainOptions = getFilterDomain(spectrum, {
|
|
483
479
|
startIndex: Math.min(activeFilterIndex, filterIndex),
|
|
@@ -487,7 +483,9 @@ function rollbackSpectrumByFilter(
|
|
|
487
483
|
reapplyFilters(spectrum, filters);
|
|
488
484
|
|
|
489
485
|
draft.tempData = current(draft).data.slice();
|
|
490
|
-
draft.tempData[index] = structuredClone(
|
|
486
|
+
draft.tempData[index] = structuredClone(
|
|
487
|
+
isDraft(spectrum) ? current(spectrum) : spectrum,
|
|
488
|
+
);
|
|
491
489
|
|
|
492
490
|
// apply the current Filters
|
|
493
491
|
if (applyFilter) {
|
|
@@ -502,8 +500,6 @@ function rollbackSpectrumByFilter(
|
|
|
502
500
|
});
|
|
503
501
|
}
|
|
504
502
|
|
|
505
|
-
draft.data[index] = spectrum;
|
|
506
|
-
|
|
507
503
|
currentIsFid = isFid1DSpectrum(spectrum) || isFid2DSpectrum(spectrum);
|
|
508
504
|
|
|
509
505
|
// Update the X and Y domains when switching from FT to FID spectrum,
|
|
@@ -750,12 +746,10 @@ function afterRollback(draft: Draft<State>, filterKey: any) {
|
|
|
750
746
|
* getActiveFilterIndex return active filter index. Otherwise, its returns -1
|
|
751
747
|
*/
|
|
752
748
|
function getActiveFilterIndex(draft: Draft<State>) {
|
|
753
|
-
const
|
|
749
|
+
const spectrum = getSpectrum(draft);
|
|
754
750
|
const id = draft.toolOptions.data.activeFilterID;
|
|
755
|
-
if (id &&
|
|
756
|
-
|
|
757
|
-
const index = spectrum.filters.findIndex((filter) => filter.id === id);
|
|
758
|
-
return index;
|
|
751
|
+
if (id && spectrum) {
|
|
752
|
+
return spectrum.filters.findIndex((filter) => filter.id === id);
|
|
759
753
|
}
|
|
760
754
|
return -1;
|
|
761
755
|
}
|
|
@@ -799,17 +793,14 @@ function handleShiftSpectrumAlongXAxis(
|
|
|
799
793
|
action: ShiftSpectrumAction,
|
|
800
794
|
) {
|
|
801
795
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
802
|
-
|
|
803
|
-
if (!activeSpectrum) {
|
|
804
|
-
return;
|
|
805
|
-
}
|
|
796
|
+
if (!activeSpectrum) return;
|
|
806
797
|
|
|
807
798
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
808
799
|
|
|
809
800
|
//apply filter into the spectrum
|
|
810
801
|
const options = action.payload;
|
|
811
802
|
|
|
812
|
-
const index = activeSpectrum
|
|
803
|
+
const index = activeSpectrum.index;
|
|
813
804
|
const isOneDimensionSpectrum = isSpectrum1D(draft.data[index]);
|
|
814
805
|
const isOneDimensionShiftFilter = isOneDimensionShift(options);
|
|
815
806
|
|
|
@@ -1841,20 +1832,13 @@ function handleApplyExclusionZone(
|
|
|
1841
1832
|
) {
|
|
1842
1833
|
const { zones } = action.payload;
|
|
1843
1834
|
|
|
1844
|
-
const
|
|
1845
|
-
|
|
1846
|
-
if (!activeSpectrum) {
|
|
1847
|
-
return;
|
|
1848
|
-
}
|
|
1849
|
-
const datum = draft.data[activeSpectrum.index];
|
|
1835
|
+
const spectrum = getSpectrum(draft);
|
|
1836
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
1850
1837
|
|
|
1851
|
-
if (!isSpectrum1D(datum)) {
|
|
1852
|
-
return;
|
|
1853
|
-
}
|
|
1854
1838
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
1855
1839
|
|
|
1856
1840
|
Filters1DManager.applyFilters(
|
|
1857
|
-
|
|
1841
|
+
spectrum,
|
|
1858
1842
|
[
|
|
1859
1843
|
{
|
|
1860
1844
|
name: 'exclusionZones',
|
|
@@ -1879,8 +1863,8 @@ function handleAddExclusionZone(
|
|
|
1879
1863
|
let spectra: Spectrum1D[];
|
|
1880
1864
|
|
|
1881
1865
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
1882
|
-
if (activeSpectrum
|
|
1883
|
-
const index = activeSpectrum
|
|
1866
|
+
if (activeSpectrum) {
|
|
1867
|
+
const index = activeSpectrum.index;
|
|
1884
1868
|
spectra = [draft.data[index]] as Spectrum1D[];
|
|
1885
1869
|
} else {
|
|
1886
1870
|
spectra = getSpectraByNucleus(
|
|
@@ -1916,12 +1900,11 @@ function handleDeleteExclusionZone(
|
|
|
1916
1900
|
) {
|
|
1917
1901
|
const { zone, spectrumId } = action.payload;
|
|
1918
1902
|
|
|
1919
|
-
//
|
|
1903
|
+
// If spectrum id exists, remove the selected exclusion zone in the spectrum.
|
|
1920
1904
|
if (spectrumId) {
|
|
1921
|
-
const
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
const spectrum = draft.data[spectrumIndex];
|
|
1905
|
+
const spectrum = getSpectrum(draft, spectrumId);
|
|
1906
|
+
if (!spectrum) return;
|
|
1907
|
+
|
|
1925
1908
|
const filter = spectrum.filters.find(
|
|
1926
1909
|
(_filter) => _filter.name === 'exclusionZones',
|
|
1927
1910
|
);
|
|
@@ -1954,20 +1937,13 @@ function handleSetOneDimensionPhaseCorrectionPivotPoint(
|
|
|
1954
1937
|
action: SetOneDimensionPhaseCorrectionPivotPoint,
|
|
1955
1938
|
) {
|
|
1956
1939
|
const { value: xValue } = action.payload;
|
|
1957
|
-
const activeSpectrum = getActiveSpectrum(draft);
|
|
1958
1940
|
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
}
|
|
1962
|
-
const datum = draft.data[activeSpectrum.index];
|
|
1963
|
-
|
|
1964
|
-
if (!isSpectrum1D(datum)) {
|
|
1965
|
-
return;
|
|
1966
|
-
}
|
|
1941
|
+
const spectrum = getSpectrum(draft);
|
|
1942
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
1967
1943
|
|
|
1968
1944
|
const scaleX = getXScale(draft);
|
|
1969
1945
|
const value = scaleX.invert(xValue);
|
|
1970
|
-
const index = xFindClosestIndex(
|
|
1946
|
+
const index = xFindClosestIndex(spectrum.data.x, value);
|
|
1971
1947
|
draft.toolOptions.data.pivot = { value, index };
|
|
1972
1948
|
}
|
|
1973
1949
|
function handleSetTwoDimensionPhaseCorrectionPivotPoint(
|
|
@@ -7,7 +7,7 @@ import { scaleLinear } from 'd3-scale';
|
|
|
7
7
|
import { zoomIdentity } from 'd3-zoom';
|
|
8
8
|
import type { Draft } from 'immer';
|
|
9
9
|
|
|
10
|
-
import { isSpectrum1D } from '../../../data/data1d/Spectrum1D/
|
|
10
|
+
import { isSpectrum1D } from '../../../data/data1d/Spectrum1D/index.ts';
|
|
11
11
|
import { insetMargin } from '../../1d/inset/InsetProvider.js';
|
|
12
12
|
import type {
|
|
13
13
|
Inset,
|
|
@@ -28,8 +28,8 @@ import type { SpectraDirection, State } from '../Reducer.js';
|
|
|
28
28
|
import type { ZoomType } from '../helper/Zoom1DManager.js';
|
|
29
29
|
import { toScaleRatio, wheelZoom } from '../helper/Zoom1DManager.js';
|
|
30
30
|
import { preparePop } from '../helper/ZoomHistoryManager.js';
|
|
31
|
-
import { getActiveSpectrum } from '../helper/getActiveSpectrum.js';
|
|
32
31
|
import getRange from '../helper/getRange.js';
|
|
32
|
+
import { getSpectrum } from '../helper/getSpectrum.ts';
|
|
33
33
|
import type { ActionType } from '../types/ActionType.js';
|
|
34
34
|
|
|
35
35
|
import type { MoveOptions } from './DomainActions.js';
|
|
@@ -104,14 +104,10 @@ export type InsetsActions =
|
|
|
104
104
|
| ToggleInsetDisplayingPeaksModeAction;
|
|
105
105
|
|
|
106
106
|
function handleAddInset(draft: Draft<State>, action: AddInsetAction) {
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
if (!activeSpectrum) return;
|
|
110
|
-
|
|
111
|
-
const { index } = activeSpectrum;
|
|
112
|
-
const datum = draft.data[index];
|
|
107
|
+
const { startX, endX } = action.payload;
|
|
113
108
|
|
|
114
|
-
|
|
109
|
+
const spectrum = getSpectrum(draft);
|
|
110
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
115
111
|
|
|
116
112
|
const {
|
|
117
113
|
yDomain,
|
|
@@ -121,9 +117,8 @@ function handleAddInset(draft: Draft<State>, action: AddInsetAction) {
|
|
|
121
117
|
width: baseWidth,
|
|
122
118
|
height: baseHeight,
|
|
123
119
|
} = draft;
|
|
124
|
-
const { id: spectrumKey } =
|
|
120
|
+
const { id: spectrumKey } = spectrum;
|
|
125
121
|
|
|
126
|
-
const { startX, endX } = action.payload;
|
|
127
122
|
const xDomain = getRange(draft, { startX, endX });
|
|
128
123
|
|
|
129
124
|
const width = Math.max(100, Math.abs(startX - endX));
|
|
@@ -154,22 +149,17 @@ function handleAddInset(draft: Draft<State>, action: AddInsetAction) {
|
|
|
154
149
|
draft.insets[nucleus] = [inset];
|
|
155
150
|
}
|
|
156
151
|
}
|
|
157
|
-
function handleDeleteInset(draft: Draft<State>, action: DeleteInsetAction) {
|
|
158
|
-
const activeSpectrum = getActiveSpectrum(draft);
|
|
159
152
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const { index } = activeSpectrum;
|
|
163
|
-
const datum = draft.data[index];
|
|
153
|
+
function handleDeleteInset(draft: Draft<State>, action: DeleteInsetAction) {
|
|
154
|
+
const { insetKey } = action.payload;
|
|
164
155
|
|
|
165
|
-
if (!isSpectrum1D(datum)) return;
|
|
166
156
|
const {
|
|
167
157
|
view: {
|
|
168
158
|
spectra: { activeTab },
|
|
169
159
|
},
|
|
170
160
|
} = draft;
|
|
171
161
|
|
|
172
|
-
|
|
162
|
+
if (!activeTab) return;
|
|
173
163
|
|
|
174
164
|
draft.insets[activeTab] = draft.insets[activeTab].filter(
|
|
175
165
|
(inset) => inset.id !== insetKey,
|
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
} from '../../../data/data1d/Spectrum1D/index.js';
|
|
21
21
|
import type { FilterType } from '../../utility/filterType.js';
|
|
22
22
|
import type { State } from '../Reducer.js';
|
|
23
|
-
import { getActiveSpectrum } from '../helper/getActiveSpectrum.js';
|
|
24
23
|
import getRange from '../helper/getRange.js';
|
|
25
24
|
import { getSpectrum } from '../helper/getSpectrum.js';
|
|
26
25
|
import { setIntegralsViewProperty } from '../helper/setIntegralsViewProperty.js';
|
|
@@ -70,21 +69,15 @@ function handleChangeIntegralSum(
|
|
|
70
69
|
action: ChangeIntegralSumAction,
|
|
71
70
|
) {
|
|
72
71
|
const { options } = action.payload;
|
|
73
|
-
const {
|
|
74
|
-
data,
|
|
75
|
-
view: {
|
|
76
|
-
spectra: { activeTab: nucleus },
|
|
77
|
-
},
|
|
78
|
-
} = draft;
|
|
79
72
|
|
|
80
|
-
const
|
|
73
|
+
const spectrum = getSpectrum(draft);
|
|
74
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
81
75
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
76
|
+
setSumOptions(spectrum.integrals, {
|
|
77
|
+
options,
|
|
78
|
+
nucleus: spectrum.info.nucleus,
|
|
79
|
+
});
|
|
80
|
+
updateIntegralsRelativeValues(spectrum, true);
|
|
88
81
|
}
|
|
89
82
|
|
|
90
83
|
interface AddIntegralOptions {
|
|
@@ -92,19 +85,19 @@ interface AddIntegralOptions {
|
|
|
92
85
|
to: number;
|
|
93
86
|
}
|
|
94
87
|
|
|
95
|
-
function initiateIntegralSumOptions(
|
|
88
|
+
function initiateIntegralSumOptions(spectrum: Spectrum1D, options: SumParams) {
|
|
96
89
|
const { molecules, nucleus } = options;
|
|
97
|
-
|
|
90
|
+
spectrum.integrals.options = initSumOptions(spectrum.integrals.options, {
|
|
98
91
|
molecules,
|
|
99
92
|
nucleus,
|
|
100
93
|
});
|
|
101
94
|
}
|
|
102
95
|
|
|
103
|
-
function addIntegral(
|
|
96
|
+
function addIntegral(spectrum: Spectrum1D, options: AddIntegralOptions) {
|
|
104
97
|
const { from, to } = options;
|
|
105
|
-
const { x, re } =
|
|
98
|
+
const { x, re } = spectrum.data;
|
|
106
99
|
|
|
107
|
-
const shiftX = getShiftX(
|
|
100
|
+
const shiftX = getShiftX(spectrum);
|
|
108
101
|
const integration = xyIntegration({ x, y: re }, { from, to });
|
|
109
102
|
const integral: Integral = {
|
|
110
103
|
id: crypto.randomUUID(),
|
|
@@ -116,26 +109,24 @@ function addIntegral(datum: Spectrum1D, options: AddIntegralOptions) {
|
|
|
116
109
|
absolute: integration,
|
|
117
110
|
kind: 'signal',
|
|
118
111
|
};
|
|
119
|
-
|
|
112
|
+
spectrum.integrals.values.push(integral);
|
|
120
113
|
}
|
|
121
114
|
|
|
122
115
|
function handleAddIntegral(draft: Draft<State>, action: AddIntegralAction) {
|
|
123
116
|
const { startX, endX } = action.payload;
|
|
124
117
|
const {
|
|
125
|
-
data,
|
|
126
118
|
molecules,
|
|
127
119
|
view: {
|
|
128
120
|
spectra: { activeTab: nucleus },
|
|
129
121
|
},
|
|
130
122
|
} = draft;
|
|
131
123
|
|
|
132
|
-
const
|
|
133
|
-
if (
|
|
124
|
+
const spectrum = getSpectrum(draft);
|
|
125
|
+
if (isSpectrum1D(spectrum)) {
|
|
134
126
|
const [from, to] = getRange(draft, { startX, endX });
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
updateIntegralsRelativeValues(datum);
|
|
127
|
+
addIntegral(spectrum, { from, to });
|
|
128
|
+
initiateIntegralSumOptions(spectrum, { molecules, nucleus });
|
|
129
|
+
updateIntegralsRelativeValues(spectrum);
|
|
139
130
|
}
|
|
140
131
|
}
|
|
141
132
|
|
|
@@ -144,18 +135,18 @@ function handleDeleteIntegral(
|
|
|
144
135
|
action: DeleteIntegralAction,
|
|
145
136
|
) {
|
|
146
137
|
const { id: integralID, spectrumKey } = action?.payload || {};
|
|
147
|
-
const
|
|
138
|
+
const spectrum = getSpectrum(draft, spectrumKey);
|
|
148
139
|
|
|
149
|
-
if (!isSpectrum1D(
|
|
140
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
150
141
|
|
|
151
142
|
if (!integralID) {
|
|
152
|
-
|
|
143
|
+
spectrum.integrals.values = [];
|
|
153
144
|
} else {
|
|
154
|
-
const peakIndex =
|
|
145
|
+
const peakIndex = spectrum.integrals.values.findIndex(
|
|
155
146
|
(p: any) => p.id === integralID,
|
|
156
147
|
);
|
|
157
|
-
|
|
158
|
-
updateIntegralsRelativeValues(
|
|
148
|
+
spectrum.integrals.values.splice(peakIndex, 1);
|
|
149
|
+
updateIntegralsRelativeValues(spectrum);
|
|
159
150
|
}
|
|
160
151
|
}
|
|
161
152
|
|
|
@@ -163,23 +154,20 @@ function handleChangeIntegral(
|
|
|
163
154
|
draft: Draft<State>,
|
|
164
155
|
action: ChangeIntegralAction,
|
|
165
156
|
) {
|
|
166
|
-
const state = original(draft) as State;
|
|
167
157
|
const { integral, spectrumKey } = action.payload;
|
|
168
158
|
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (!isSpectrum1D(datum) || !isSpectrum1D(originalDatum)) {
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
159
|
+
const spectrum = getSpectrum(draft, spectrumKey);
|
|
160
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
175
161
|
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
(i: any) => i.id === integral.id,
|
|
162
|
+
const integralIndex = spectrum.integrals.values.findIndex(
|
|
163
|
+
(i) => i.id === integral.id,
|
|
179
164
|
);
|
|
180
165
|
|
|
181
166
|
if (integralIndex !== -1) {
|
|
182
|
-
|
|
167
|
+
const {
|
|
168
|
+
data: { x, re },
|
|
169
|
+
} = original(spectrum) as Spectrum1D;
|
|
170
|
+
spectrum.integrals.values[integralIndex] = {
|
|
183
171
|
...integral,
|
|
184
172
|
originalFrom: integral.from,
|
|
185
173
|
originalTo: integral.to,
|
|
@@ -188,7 +176,7 @@ function handleChangeIntegral(
|
|
|
188
176
|
{ from: integral.from, to: integral.to },
|
|
189
177
|
),
|
|
190
178
|
};
|
|
191
|
-
updateIntegralsRelativeValues(
|
|
179
|
+
updateIntegralsRelativeValues(spectrum);
|
|
192
180
|
}
|
|
193
181
|
}
|
|
194
182
|
|
|
@@ -196,28 +184,29 @@ function handleChangeIntegralsRelativeValue(
|
|
|
196
184
|
draft: Draft<State>,
|
|
197
185
|
action: ChangeIntegralRelativeValueAction,
|
|
198
186
|
) {
|
|
199
|
-
const activeSpectrum = getActiveSpectrum(draft);
|
|
200
187
|
const { id, value } = action.payload;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
188
|
+
|
|
189
|
+
const spectrum = getSpectrum(draft);
|
|
190
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
191
|
+
|
|
192
|
+
changeIntegralsRelative(spectrum, { id, value });
|
|
205
193
|
}
|
|
206
194
|
|
|
207
|
-
function handleChangeIntegralsSumFlag(draft:
|
|
208
|
-
const
|
|
209
|
-
if (
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
195
|
+
function handleChangeIntegralsSumFlag(draft: Draft<State>) {
|
|
196
|
+
const spectrum = getSpectrum(draft);
|
|
197
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
198
|
+
|
|
199
|
+
const integralOptions = spectrum.integrals.options;
|
|
200
|
+
integralOptions.isSumConstant = !integralOptions.isSumConstant;
|
|
214
201
|
}
|
|
215
202
|
|
|
216
203
|
function handleCutIntegral(draft: Draft<State>, action: CutIntegralAction) {
|
|
217
204
|
const { cutValue } = action.payload;
|
|
218
|
-
const spectrum = getSpectrum(draft) as Spectrum1D;
|
|
219
|
-
const integrals = spectrum.integrals.values;
|
|
220
205
|
|
|
206
|
+
const spectrum = getSpectrum(draft);
|
|
207
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
208
|
+
|
|
209
|
+
const integrals = spectrum.integrals.values;
|
|
221
210
|
for (let i = 0; i < integrals.length; i++) {
|
|
222
211
|
const { to, from } = integrals[i];
|
|
223
212
|
if (cutValue > from && cutValue < to) {
|
|
@@ -3,7 +3,7 @@ import type { Logger } from 'cheminfo-types';
|
|
|
3
3
|
import type { FifoLogger } from 'fifo-logger';
|
|
4
4
|
import type { Draft } from 'immer';
|
|
5
5
|
import { Molecule } from 'openchemlib';
|
|
6
|
-
import type { TopicMolecule } from 'openchemlib-utils';
|
|
6
|
+
import type { DiaIDAndInfo, TopicMolecule } from 'openchemlib-utils';
|
|
7
7
|
import { getAtoms, nbLabileH } from 'openchemlib-utils';
|
|
8
8
|
|
|
9
9
|
import type {
|
|
@@ -13,18 +13,19 @@ import type {
|
|
|
13
13
|
} from '../../../data/PredictionManager.js';
|
|
14
14
|
import { generateSpectra } from '../../../data/PredictionManager.js';
|
|
15
15
|
import { changeSpectraRelativeSum } from '../../../data/data1d/Spectrum1D/SumManager.js';
|
|
16
|
+
import { isSpectrum1D } from '../../../data/data1d/Spectrum1D/isSpectrum1D.ts';
|
|
16
17
|
import type { MoleculeBoundingRect } from '../../../data/molecules/Molecule.js';
|
|
17
18
|
import { DRAGGABLE_STRUCTURE_INITIAL_BOUNDING_REACT } from '../../../data/molecules/Molecule.js';
|
|
18
19
|
import * as MoleculeManager from '../../../data/molecules/MoleculeManager.js';
|
|
19
20
|
import { generateColor } from '../../../data/utilities/generateColor.js';
|
|
20
21
|
import { convertPixelToPercent } from '../../hooks/useSVGUnitConverter.js';
|
|
22
|
+
import { extractFromAtom } from '../../panels/MoleculesPanel/utilities/extractFromAtom.ts';
|
|
23
|
+
import nucleusToString from '../../utility/nucleusToString.ts';
|
|
21
24
|
import type { State } from '../Reducer.js';
|
|
22
25
|
import { MARGIN } from '../core/Constants.js';
|
|
23
26
|
import type { ActionType } from '../types/ActionType.js';
|
|
24
27
|
|
|
25
|
-
import { unlinkRange } from './RangesActions.js';
|
|
26
28
|
import { setActiveTab } from './ToolsActions.js';
|
|
27
|
-
import { unlinkZone } from './ZonesActions.js';
|
|
28
29
|
import { deepReplaceDiaIDs } from './utilities/deepReplaceDiaIDs.js';
|
|
29
30
|
|
|
30
31
|
interface AddMoleculeProps {
|
|
@@ -48,7 +49,10 @@ type SetMoleculeAction = ActionType<
|
|
|
48
49
|
mappings?: ReturnType<TopicMolecule['getDiaIDsMapping']>;
|
|
49
50
|
}
|
|
50
51
|
>;
|
|
51
|
-
type DeleteMoleculeAction = ActionType<
|
|
52
|
+
type DeleteMoleculeAction = ActionType<
|
|
53
|
+
'DELETE_MOLECULE',
|
|
54
|
+
{ id: string; diaIDs?: DiaIDAndInfo[] }
|
|
55
|
+
>;
|
|
52
56
|
type PredictSpectraFromMoleculeAction = ActionType<
|
|
53
57
|
'PREDICT_SPECTRA',
|
|
54
58
|
{
|
|
@@ -68,8 +72,10 @@ type ToggleMoleculeLabelAction = ActionType<
|
|
|
68
72
|
{ id: string }
|
|
69
73
|
>;
|
|
70
74
|
|
|
71
|
-
interface ChangeMoleculeAnnotationOptions
|
|
72
|
-
|
|
75
|
+
interface ChangeMoleculeAnnotationOptions extends Pick<
|
|
76
|
+
MoleculeView,
|
|
77
|
+
'atomAnnotation'
|
|
78
|
+
> {
|
|
73
79
|
id: string;
|
|
74
80
|
}
|
|
75
81
|
|
|
@@ -165,12 +171,83 @@ function handleSetMolecule(draft: Draft<State>, action: SetMoleculeAction) {
|
|
|
165
171
|
setMolecule(draft, action.payload);
|
|
166
172
|
}
|
|
167
173
|
|
|
168
|
-
function
|
|
169
|
-
|
|
170
|
-
|
|
174
|
+
function clearDiaIDs(
|
|
175
|
+
obj: Partial<{ diaIDs?: string[]; nbAtoms?: number }>,
|
|
176
|
+
options: {
|
|
177
|
+
diaIDsObj: Record<string, DiaIDAndInfo>;
|
|
178
|
+
nucleus: string[] | string;
|
|
179
|
+
},
|
|
180
|
+
) {
|
|
181
|
+
const { diaIDsObj, nucleus } = options;
|
|
182
|
+
if (!obj.diaIDs?.some((id) => id in diaIDsObj)) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const nucleusValue = nucleusToString(nucleus);
|
|
187
|
+
let updatedDiaIDs = [...obj.diaIDs];
|
|
188
|
+
let updatedNbAtoms = obj.nbAtoms || 0;
|
|
189
|
+
|
|
190
|
+
for (const id of obj.diaIDs) {
|
|
191
|
+
const atomInfo = diaIDsObj[id];
|
|
192
|
+
if (!atomInfo) continue;
|
|
193
|
+
|
|
194
|
+
const { nbAtoms: removedCount, oclIDs } = extractFromAtom(
|
|
195
|
+
atomInfo,
|
|
196
|
+
nucleusValue,
|
|
197
|
+
);
|
|
198
|
+
const removalSet = new Set(oclIDs);
|
|
199
|
+
|
|
200
|
+
updatedDiaIDs = updatedDiaIDs.filter(
|
|
201
|
+
(candidate) => !removalSet.has(candidate),
|
|
202
|
+
);
|
|
203
|
+
updatedNbAtoms -= removedCount;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (updatedDiaIDs.length > 0) {
|
|
207
|
+
obj.diaIDs = updatedDiaIDs;
|
|
208
|
+
} else {
|
|
209
|
+
delete obj.diaIDs;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (updatedNbAtoms > 0) {
|
|
213
|
+
obj.nbAtoms = updatedNbAtoms;
|
|
214
|
+
} else {
|
|
215
|
+
delete obj.nbAtoms;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function clearAssignments(draft: Draft<State>, diaIDs: DiaIDAndInfo[]) {
|
|
220
|
+
const diaIDsObj: Record<string, DiaIDAndInfo> = {};
|
|
221
|
+
for (const diaItem of diaIDs) {
|
|
222
|
+
diaIDsObj[diaItem.idCode] = diaItem;
|
|
171
223
|
}
|
|
172
|
-
|
|
173
|
-
|
|
224
|
+
|
|
225
|
+
for (const spectrum of draft.data) {
|
|
226
|
+
const {
|
|
227
|
+
info: { nucleus },
|
|
228
|
+
} = spectrum;
|
|
229
|
+
|
|
230
|
+
if (isSpectrum1D(spectrum)) {
|
|
231
|
+
const ranges = spectrum.ranges.values;
|
|
232
|
+
for (const range of ranges) {
|
|
233
|
+
const { signals = [] } = range;
|
|
234
|
+
for (const signal of signals) {
|
|
235
|
+
clearDiaIDs(signal, { diaIDsObj, nucleus });
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
} else {
|
|
239
|
+
const zones = spectrum.zones.values;
|
|
240
|
+
for (const zone of zones) {
|
|
241
|
+
const { signals = [] } = zone;
|
|
242
|
+
clearDiaIDs(zone.x, { diaIDsObj, nucleus });
|
|
243
|
+
clearDiaIDs(zone.y, { diaIDsObj, nucleus });
|
|
244
|
+
|
|
245
|
+
for (const signal of signals) {
|
|
246
|
+
clearDiaIDs(signal.x, { diaIDsObj, nucleus });
|
|
247
|
+
clearDiaIDs(signal.y, { diaIDsObj, nucleus });
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
174
251
|
}
|
|
175
252
|
}
|
|
176
253
|
|
|
@@ -179,13 +256,16 @@ function handleDeleteMolecule(
|
|
|
179
256
|
draft: Draft<State>,
|
|
180
257
|
action: DeleteMoleculeAction,
|
|
181
258
|
) {
|
|
182
|
-
const { id } = action.payload;
|
|
183
|
-
// remove Assignments links of the active spectrum
|
|
184
|
-
removeAssignments(draft);
|
|
259
|
+
const { id, diaIDs } = action.payload;
|
|
185
260
|
|
|
186
261
|
const moleculeIndex = draft.molecules.findIndex(
|
|
187
262
|
(molecule) => molecule.id === id,
|
|
188
263
|
);
|
|
264
|
+
|
|
265
|
+
if (diaIDs) {
|
|
266
|
+
clearAssignments(draft, diaIDs);
|
|
267
|
+
}
|
|
268
|
+
|
|
189
269
|
draft.molecules.splice(moleculeIndex, 1);
|
|
190
270
|
|
|
191
271
|
// delete the molecule view object for this id
|