nmrium 1.6.1 → 1.8.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/FloatingRanges.js +4 -4
- package/lib/component/1d/FloatingRanges.js.map +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js.map +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js.map +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts.map +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -2
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js.map +1 -1
- package/lib/component/1d/peaks/PeakAnnotations.d.ts.map +1 -1
- package/lib/component/1d/peaks/PeakAnnotations.js +2 -2
- package/lib/component/1d/peaks/PeakAnnotations.js.map +1 -1
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts.map +1 -1
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js +4 -4
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.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 +5 -2
- package/lib/component/1d/peaks/Peaks.js.map +1 -1
- package/lib/component/1d/ranges/Atoms.d.ts.map +1 -1
- package/lib/component/1d/ranges/Atoms.js +24 -9
- package/lib/component/1d/ranges/Atoms.js.map +1 -1
- package/lib/component/1d/ranges/Range.d.ts.map +1 -1
- package/lib/component/1d/ranges/Range.js +3 -3
- package/lib/component/1d/ranges/Range.js.map +1 -1
- package/lib/component/1d/ranges/RangesIntegrals.d.ts.map +1 -1
- package/lib/component/1d/ranges/RangesIntegrals.js +5 -3
- package/lib/component/1d/ranges/RangesIntegrals.js.map +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +2 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts.map +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +32 -41
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js.map +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/FloatMolecules.d.ts.map +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/FloatMolecules.js.map +1 -1
- package/lib/component/2d/FooterBanner.js +2 -2
- package/lib/component/2d/FooterBanner.js.map +1 -1
- package/lib/component/2d/YAxis.d.ts +0 -1
- package/lib/component/2d/YAxis.d.ts.map +1 -1
- package/lib/component/2d/YAxis.js +11 -4
- package/lib/component/2d/YAxis.js.map +1 -1
- package/lib/component/2d/useTracesSpectra.d.ts.map +1 -1
- package/lib/component/2d/useTracesSpectra.js +2 -0
- package/lib/component/2d/useTracesSpectra.js.map +1 -1
- package/lib/component/2d/utilities/extractSpectrumSignals.d.ts +2 -9
- package/lib/component/2d/utilities/extractSpectrumSignals.d.ts.map +1 -1
- package/lib/component/2d/utilities/extractSpectrumSignals.js +4 -5
- package/lib/component/2d/utilities/extractSpectrumSignals.js.map +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.d.ts.map +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.js +7 -10
- package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.d.ts.map +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.js.map +1 -1
- package/lib/component/context/DispatchContext.d.ts +2 -2
- package/lib/component/context/DispatchContext.d.ts.map +1 -1
- package/lib/component/context/LoggerContext.d.ts.map +1 -1
- package/lib/component/context/LoggerContext.js +8 -9
- package/lib/component/context/LoggerContext.js.map +1 -1
- package/lib/component/context/PreferencesContext.d.ts +7 -3
- package/lib/component/context/PreferencesContext.d.ts.map +1 -1
- package/lib/component/context/PreferencesContext.js +1 -2
- package/lib/component/context/PreferencesContext.js.map +1 -1
- package/lib/component/elements/D3Axis.d.ts.map +1 -1
- package/lib/component/elements/D3Axis.js +1 -1
- package/lib/component/elements/D3Axis.js.map +1 -1
- package/lib/component/elements/Sections.js +1 -1
- package/lib/component/elements/Sections.js.map +1 -1
- package/lib/component/hooks/useActiveSpectrumRangesViewState.d.ts.map +1 -1
- package/lib/component/hooks/useActiveSpectrumRangesViewState.js +2 -2
- package/lib/component/hooks/useActiveSpectrumRangesViewState.js.map +1 -1
- package/lib/component/hooks/useExport.d.ts.map +1 -1
- package/lib/component/hooks/useExport.js +24 -6
- package/lib/component/hooks/useExport.js.map +1 -1
- package/lib/component/loader/Spinner.js +1 -1
- package/lib/component/loader/Spinner.js.map +1 -1
- package/lib/component/loader/useLoadFiles.d.ts.map +1 -1
- package/lib/component/loader/useLoadFiles.js +60 -25
- package/lib/component/loader/useLoadFiles.js.map +1 -1
- package/lib/component/main/InnerNMRium.d.ts.map +1 -1
- package/lib/component/main/InnerNMRium.js +4 -2
- package/lib/component/main/InnerNMRium.js.map +1 -1
- package/lib/component/main/NMRiumStateProvider.d.ts.map +1 -1
- package/lib/component/main/NMRiumStateProvider.js +17 -6
- package/lib/component/main/NMRiumStateProvider.js.map +1 -1
- package/lib/component/modal/LoadJCAMPModal.d.ts.map +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +7 -3
- package/lib/component/modal/LoadJCAMPModal.js.map +1 -1
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts.map +1 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +7 -3
- package/lib/component/modal/MoleculeStructureEditorModal.js.map +1 -1
- package/lib/component/modal/MultipletAnalysisModal.js +0 -2
- package/lib/component/modal/MultipletAnalysisModal.js.map +1 -1
- package/lib/component/modal/SaveAsModal.d.ts.map +1 -1
- package/lib/component/modal/SaveAsModal.js +10 -3
- package/lib/component/modal/SaveAsModal.js.map +1 -1
- package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts.map +1 -1
- package/lib/component/modal/changeSum/ChangeSumModalContents.js +0 -2
- package/lib/component/modal/changeSum/ChangeSumModalContents.js.map +1 -1
- package/lib/component/modal/changeSum/SelectMolecule.d.ts.map +1 -1
- package/lib/component/modal/changeSum/SelectMolecule.js +0 -2
- package/lib/component/modal/changeSum/SelectMolecule.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +2 -2
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts.map +1 -1
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +1 -2
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.d.ts.map +1 -1
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +16 -0
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js.map +1 -1
- package/lib/component/modal/setting/settingsValidation.js +2 -2
- package/lib/component/modal/setting/settingsValidation.js.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +2 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +4 -3
- package/lib/component/panels/IntegralsPanel/IntegralTable.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.d.ts +6 -0
- package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.js +87 -0
- package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +18 -28
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +32 -25
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.d.ts +13 -0
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.js +66 -0
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/{useAtomAssignment.d.ts → hooks/useAtomAssignment.d.ts} +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/{useAtomAssignment.js → hooks/useAtomAssignment.js} +50 -19
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.d.ts +12 -0
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.js +58 -0
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/AtomData.d.ts +5 -0
- package/lib/component/panels/MoleculesPanel/utilities/AtomData.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/AtomData.js +2 -0
- package/lib/component/panels/MoleculesPanel/utilities/AtomData.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.d.ts +16 -0
- package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.js +47 -0
- package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.d.ts +18 -0
- package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js +31 -0
- package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.d.ts +3 -0
- package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.js +12 -0
- package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.d.ts +4 -0
- package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.js +25 -0
- package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.d.ts +6 -0
- package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.js +18 -0
- package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.js.map +1 -0
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +24 -26
- package/lib/component/panels/PeaksPanel/PeaksPanel.js.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +3 -2
- package/lib/component/panels/PeaksPanel/PeaksTable.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +3 -2
- package/lib/component/panels/RangesPanel/RangesHeader.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +2 -1
- package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js.map +1 -1
- package/lib/component/panels/SpectraPanel/SpectraTable.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/SpectraTable.js +3 -2
- package/lib/component/panels/SpectraPanel/SpectraTable.js.map +1 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +2 -2
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js.map +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js.map +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +0 -4
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js.map +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +8 -8
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +6 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +8 -9
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.js +3 -2
- package/lib/component/panels/ZonesPanel/ZonesTable.js.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +0 -2
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js.map +1 -1
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +7 -7
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +3 -3
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.js.map +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts.map +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +13 -10
- package/lib/component/panels/databasePanel/DatabasePanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.js +0 -2
- package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.js.map +1 -1
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.d.ts +9 -0
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.d.ts.map +1 -0
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.js +27 -0
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.js.map +1 -0
- package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.d.ts.map +1 -1
- package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +0 -2
- package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js.map +1 -1
- package/lib/component/reducer/IgnoreActions.d.ts.map +1 -1
- package/lib/component/reducer/IgnoreActions.js +2 -1
- package/lib/component/reducer/IgnoreActions.js.map +1 -1
- package/lib/component/reducer/Reducer.d.ts +13 -1
- package/lib/component/reducer/Reducer.d.ts.map +1 -1
- package/lib/component/reducer/Reducer.js +10 -3
- package/lib/component/reducer/Reducer.js.map +1 -1
- package/lib/component/reducer/actions/DatabaseActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js +2 -1
- package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
- package/lib/component/reducer/actions/IntegralsActions.js.map +1 -1
- package/lib/component/reducer/actions/{LoadActions.d.ts → LoadAction.d.ts} +16 -5
- package/lib/component/reducer/actions/LoadAction.d.ts.map +1 -0
- package/lib/component/reducer/actions/{LoadActions.js → LoadAction.js} +60 -16
- package/lib/component/reducer/actions/LoadAction.js.map +1 -0
- package/lib/component/reducer/actions/MoleculeActions.d.ts +22 -6
- package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.js +43 -29
- package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
- package/lib/component/reducer/actions/RangesActions.d.ts +12 -6
- package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/RangesActions.js +37 -16
- package/lib/component/reducer/actions/RangesActions.js.map +1 -1
- package/lib/component/reducer/actions/ZonesActions.d.ts +3 -3
- package/lib/component/reducer/actions/ZonesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/ZonesActions.js +9 -4
- package/lib/component/reducer/actions/ZonesActions.js.map +1 -1
- package/lib/component/reducer/preferences/actions/changeDefaultMoleculeSettings.d.ts +4 -0
- package/lib/component/reducer/preferences/actions/changeDefaultMoleculeSettings.d.ts.map +1 -0
- package/lib/component/reducer/preferences/actions/changeDefaultMoleculeSettings.js +7 -0
- package/lib/component/reducer/preferences/actions/changeDefaultMoleculeSettings.js.map +1 -0
- package/lib/component/reducer/preferences/actions/initPreferences.d.ts.map +1 -1
- package/lib/component/reducer/preferences/actions/initPreferences.js +1 -2
- package/lib/component/reducer/preferences/actions/initPreferences.js.map +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts.map +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +2 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js.map +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +9 -8
- package/lib/component/reducer/preferences/preferencesReducer.d.ts.map +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.js +3 -1
- package/lib/component/reducer/preferences/preferencesReducer.js.map +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts.map +1 -1
- package/lib/component/toolbar/ToolTypes.js +1 -0
- package/lib/component/toolbar/ToolTypes.js.map +1 -1
- package/lib/component/utility/export.d.ts +3 -3
- package/lib/component/utility/export.d.ts.map +1 -1
- package/lib/component/utility/export.js +13 -21
- package/lib/component/utility/export.js.map +1 -1
- package/lib/component/utility/getClosePeak.js +1 -1
- package/lib/component/utility/getClosePeak.js.map +1 -1
- package/lib/component/utility/save_as.d.ts +9 -0
- package/lib/component/utility/save_as.d.ts.map +1 -0
- package/lib/component/utility/save_as.js +7 -0
- package/lib/component/utility/save_as.js.map +1 -0
- package/lib/component/workspaces/assignment.d.ts.map +1 -1
- package/lib/component/workspaces/assignment.js +7 -0
- package/lib/component/workspaces/assignment.js.map +1 -1
- package/lib/component/workspaces/basic.d.ts.map +1 -1
- package/lib/component/workspaces/basic.js +5 -0
- package/lib/component/workspaces/basic.js.map +1 -1
- package/lib/component/workspaces/embedded.d.ts.map +1 -1
- package/lib/component/workspaces/embedded.js +5 -0
- package/lib/component/workspaces/embedded.js.map +1 -1
- package/lib/component/workspaces/exercise.d.ts.map +1 -1
- package/lib/component/workspaces/exercise.js +5 -0
- package/lib/component/workspaces/exercise.js.map +1 -1
- package/lib/component/workspaces/prediction.d.ts.map +1 -1
- package/lib/component/workspaces/prediction.js +5 -0
- package/lib/component/workspaces/prediction.js.map +1 -1
- package/lib/component/workspaces/process1D.d.ts.map +1 -1
- package/lib/component/workspaces/process1D.js +6 -0
- package/lib/component/workspaces/process1D.js.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +18 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
- package/lib/data/PredictionManager.d.ts.map +1 -1
- package/lib/data/PredictionManager.js +13 -9
- package/lib/data/PredictionManager.js.map +1 -1
- package/lib/data/SpectraManager.d.ts +45 -4
- package/lib/data/SpectraManager.d.ts.map +1 -1
- package/lib/data/SpectraManager.js +69 -12
- package/lib/data/SpectraManager.js.map +1 -1
- package/lib/data/constants/signalsKinds.d.ts +1 -6
- package/lib/data/constants/signalsKinds.d.ts.map +1 -1
- package/lib/data/constants/signalsKinds.js +2 -17
- package/lib/data/constants/signalsKinds.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +16 -14
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +1 -10
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -4
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +5 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +1 -1
- package/lib/data/data2d/Spectrum2D/contours.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/contours.js +1 -1
- package/lib/data/data2d/Spectrum2D/contours.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +6 -4
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts.map +1 -1
- package/lib/data/molecules/Molecule.d.ts +2 -22
- package/lib/data/molecules/Molecule.d.ts.map +1 -1
- package/lib/data/molecules/Molecule.js +3 -1
- package/lib/data/molecules/Molecule.js.map +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +3 -2
- package/lib/data/molecules/MoleculeManager.d.ts.map +1 -1
- package/lib/data/molecules/MoleculeManager.js +4 -2
- package/lib/data/molecules/MoleculeManager.js.map +1 -1
- package/lib/data/utilities/RangeUtilities.d.ts +3 -2
- package/lib/data/utilities/RangeUtilities.d.ts.map +1 -1
- package/lib/data/utilities/RangeUtilities.js +9 -3
- package/lib/data/utilities/RangeUtilities.js.map +1 -1
- package/lib/data/utilities/ZoneUtilities.d.ts.map +1 -1
- package/lib/data/utilities/ZoneUtilities.js +1 -2
- package/lib/data/utilities/ZoneUtilities.js.map +1 -1
- package/lib/data/utilities/isProton.d.ts +2 -0
- package/lib/data/utilities/isProton.d.ts.map +1 -0
- package/lib/data/utilities/isProton.js +4 -0
- package/lib/data/utilities/isProton.js.map +1 -0
- package/lib/versionInfo.js +1 -1
- package/package.json +32 -32
- package/src/component/1d/FloatingRanges.tsx +5 -5
- package/src/component/1d/database/DatabaseSpectrum.tsx +1 -1
- package/src/component/1d/multiAnalysis/MultiAnalysisRanges.tsx +1 -1
- package/src/component/1d/multiplicityTree/MultiplicityTree.tsx +4 -2
- package/src/component/1d/peaks/PeakAnnotations.tsx +2 -1
- package/src/component/1d/peaks/PeakAnnotationsSpreadMode.tsx +11 -1
- package/src/component/1d/peaks/Peaks.tsx +9 -3
- package/src/component/1d/ranges/Atoms.tsx +36 -13
- package/src/component/1d/ranges/Range.tsx +4 -3
- package/src/component/1d/ranges/RangesIntegrals.tsx +6 -2
- package/src/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.tsx +38 -78
- package/src/component/1d-2d/components/FloatMoleculeStructures/FloatMolecules.tsx +5 -2
- package/src/component/2d/FooterBanner.tsx +2 -2
- package/src/component/2d/YAxis.tsx +31 -13
- package/src/component/2d/useTracesSpectra.ts +3 -0
- package/src/component/2d/utilities/extractSpectrumSignals.ts +6 -16
- package/src/component/2d/zones/SignalsGuideLines.tsx +11 -9
- package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +2 -3
- package/src/component/context/DispatchContext.tsx +2 -2
- package/src/component/context/LoggerContext.tsx +8 -11
- package/src/component/context/PreferencesContext.tsx +8 -5
- package/src/component/elements/D3Axis.tsx +1 -2
- package/src/component/elements/Sections.tsx +1 -1
- package/src/component/hooks/useActiveSpectrumRangesViewState.ts +2 -2
- package/src/component/hooks/useExport.tsx +38 -6
- package/src/component/loader/Spinner.tsx +1 -1
- package/src/component/loader/useLoadFiles.ts +79 -30
- package/src/component/main/InnerNMRium.tsx +6 -2
- package/src/component/main/NMRiumStateProvider.tsx +18 -7
- package/src/component/modal/LoadJCAMPModal.tsx +10 -5
- package/src/component/modal/MoleculeStructureEditorModal.tsx +11 -3
- package/src/component/modal/MultipletAnalysisModal.tsx +0 -2
- package/src/component/modal/SaveAsModal.tsx +35 -6
- package/src/component/modal/changeSum/ChangeSumModalContents.tsx +0 -2
- package/src/component/modal/changeSum/SelectMolecule.tsx +0 -2
- package/src/component/modal/setting/settings-tabs/DatabasesTabContent.tsx +1 -3
- package/src/component/modal/setting/settings-tabs/ToolsTabContent.tsx +16 -0
- package/src/component/modal/setting/settingsValidation.ts +2 -2
- package/src/component/panels/IntegralsPanel/IntegralPanel.tsx +2 -6
- package/src/component/panels/IntegralsPanel/IntegralTable.tsx +4 -3
- package/src/component/panels/MoleculesPanel/MoleculeOptionsPanel.tsx +160 -0
- package/src/component/panels/MoleculesPanel/MoleculePanel.tsx +77 -102
- package/src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx +54 -35
- package/src/component/panels/MoleculesPanel/MoleculeStructure.tsx +117 -0
- package/src/component/panels/MoleculesPanel/{useAtomAssignment.tsx → hooks/useAtomAssignment.tsx} +71 -30
- package/src/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.ts +74 -0
- package/src/component/panels/MoleculesPanel/utilities/AtomData.ts +4 -0
- package/src/component/panels/MoleculesPanel/utilities/extractFromAtom.ts +63 -0
- package/src/component/panels/MoleculesPanel/utilities/getAssignIds.ts +59 -0
- package/src/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.ts +12 -0
- package/src/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.ts +36 -0
- package/src/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.ts +20 -0
- package/src/component/panels/PeaksPanel/PeaksPanel.tsx +25 -35
- package/src/component/panels/PeaksPanel/PeaksTable.tsx +3 -2
- package/src/component/panels/RangesPanel/RangesHeader.tsx +3 -2
- package/src/component/panels/RangesPanel/RangesTable.tsx +10 -8
- package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.tsx +3 -3
- package/src/component/panels/RangesPanel/TableColumns/RelativeColumn.tsx +2 -2
- package/src/component/panels/SpectraPanel/SpectraTable.tsx +3 -2
- package/src/component/panels/SummaryPanel/utilities/Utilities.ts +2 -2
- package/src/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.tsx +1 -1
- package/src/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.tsx +0 -4
- package/src/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.tsx +9 -9
- package/src/component/panels/ZonesPanel/ZonesPanel.tsx +15 -5
- package/src/component/panels/ZonesPanel/ZonesTable.tsx +9 -10
- package/src/component/panels/ZonesPanel/ZonesTableRow.tsx +0 -2
- package/src/component/panels/ZonesPanel/hooks/useMapZones.ts +11 -11
- package/src/component/panels/databasePanel/DatabasePanel.tsx +18 -14
- package/src/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.tsx +0 -2
- package/src/component/panels/hooks/useMoleculeAnnotationCore.ts +36 -0
- package/src/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.tsx +0 -2
- package/src/component/reducer/IgnoreActions.ts +2 -1
- package/src/component/reducer/Reducer.ts +28 -4
- package/src/component/reducer/actions/DatabaseActions.ts +3 -0
- package/src/component/reducer/actions/IntegralsActions.ts +1 -1
- package/src/component/reducer/actions/{LoadActions.ts → LoadAction.ts} +87 -25
- package/src/component/reducer/actions/MoleculeActions.ts +91 -44
- package/src/component/reducer/actions/RangesActions.ts +66 -30
- package/src/component/reducer/actions/ZonesActions.ts +18 -10
- package/src/component/reducer/preferences/actions/changeDefaultMoleculeSettings.ts +16 -0
- package/src/component/reducer/preferences/actions/initPreferences.ts +0 -3
- package/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts +2 -1
- package/src/component/reducer/preferences/preferencesReducer.ts +20 -11
- package/src/component/toolbar/ToolTypes.ts +1 -0
- package/src/component/utility/export.ts +15 -20
- package/src/component/utility/getClosePeak.ts +1 -1
- package/src/component/utility/save_as.ts +16 -0
- package/src/component/workspaces/assignment.ts +7 -0
- package/src/component/workspaces/basic.ts +5 -0
- package/src/component/workspaces/embedded.ts +5 -0
- package/src/component/workspaces/exercise.ts +5 -0
- package/src/component/workspaces/prediction.ts +5 -0
- package/src/component/workspaces/process1D.ts +6 -0
- package/src/component/workspaces/workspaceDefaultProperties.ts +18 -0
- package/src/data/PredictionManager.ts +21 -14
- package/src/data/SpectraManager.ts +90 -19
- package/src/data/constants/signalsKinds.ts +5 -20
- package/src/data/data1d/Spectrum1D/generateJGraphData.ts +1 -1
- package/src/data/data1d/Spectrum1D/initiateDatum1D.ts +16 -16
- package/src/data/data1d/Spectrum1D/isRangeAssigned.ts +1 -0
- package/src/data/data1d/Spectrum1D/ranges/autoRangesDetection.ts +7 -4
- package/src/data/data1d/Spectrum1D/ranges/detectRanges.ts +8 -1
- package/src/data/data1d/Spectrum1D/ranges/detectSignals.ts +1 -1
- package/src/data/data2d/Spectrum2D/contours.ts +2 -3
- package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +6 -7
- package/src/data/molecules/Molecule.ts +9 -23
- package/src/data/molecules/MoleculeManager.ts +10 -8
- package/src/data/utilities/RangeUtilities.ts +12 -4
- package/src/data/utilities/ZoneUtilities.ts +1 -3
- package/src/data/utilities/isProton.ts +3 -0
- package/src/index.tsx +0 -3
- package/src/versionInfo.ts +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +0 -43
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts.map +0 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +0 -126
- package/lib/component/panels/MoleculesPanel/Utilities.js.map +0 -1
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts.map +0 -1
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js.map +0 -1
- package/lib/component/reducer/actions/LoadActions.d.ts.map +0 -1
- package/lib/component/reducer/actions/LoadActions.js.map +0 -1
- package/lib/component/utility/isHomoNuclear.d.ts +0 -2
- package/lib/component/utility/isHomoNuclear.d.ts.map +0 -1
- package/lib/component/utility/isHomoNuclear.js +0 -11
- package/lib/component/utility/isHomoNuclear.js.map +0 -1
- package/lib/data/types/common/SignalKind.d.ts +0 -2
- package/lib/data/types/common/SignalKind.d.ts.map +0 -1
- package/lib/data/types/common/SignalKind.js +0 -2
- package/lib/data/types/common/SignalKind.js.map +0 -1
- package/lib/utils/stringCapitalize.d.ts +0 -2
- package/lib/utils/stringCapitalize.d.ts.map +0 -1
- package/lib/utils/stringCapitalize.js +0 -4
- package/lib/utils/stringCapitalize.js.map +0 -1
- package/src/component/panels/MoleculesPanel/Utilities.ts +0 -186
- package/src/component/utility/isHomoNuclear.ts +0 -11
- package/src/data/types/common/SignalKind.ts +0 -10
- package/src/utils/stringCapitalize.ts +0 -3
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { MolfileSvgRenderer } from 'react-ocl';
|
|
4
|
+
import OCLnmr from 'react-ocl-nmr';
|
|
5
|
+
import { useDispatch } from "../../context/DispatchContext.js";
|
|
6
|
+
import { useHighlightColor } from "../../hooks/useHighlightColor.js";
|
|
7
|
+
import useAtomAssignment from "./hooks/useAtomAssignment.js";
|
|
8
|
+
import { useExtractAtomAssignmentLabel } from "./hooks/useExtractAtomAssignmentLabel.js";
|
|
9
|
+
export function MoleculeStructure(props) {
|
|
10
|
+
const { molecule, moleculeView, width, height, renderAsSVG = false, showMoleculeLabel, index = 0, } = props;
|
|
11
|
+
const { currentDiaIDsToHighlight, handleOnAtomHover, handleOnClickAtom, assignedDiaIDsMerged, } = useAtomAssignment();
|
|
12
|
+
const highlightColor = useHighlightColor();
|
|
13
|
+
const dispatch = useDispatch();
|
|
14
|
+
const { onAtomHover, getAssignmentLabelByHover, getLastHoverAtom } = useExtractAtomAssignmentLabel();
|
|
15
|
+
//TODO Temporary workaround to prevent other focused elements from being triggered by the space key
|
|
16
|
+
const containerRef = useRef(null);
|
|
17
|
+
const atomHighlightColor = currentDiaIDsToHighlight?.length > 0 ? '#ff000080' : highlightColor;
|
|
18
|
+
const baseProps = {
|
|
19
|
+
height,
|
|
20
|
+
width,
|
|
21
|
+
label: (showMoleculeLabel ?? moleculeView.showLabel) ? molecule.label : '',
|
|
22
|
+
labelFontSize: 15,
|
|
23
|
+
labelColor: 'rgba(138, 59, 59, 1)',
|
|
24
|
+
molfile: molecule.molfile,
|
|
25
|
+
atomHighlightColor,
|
|
26
|
+
atomHighlightOpacity: 1,
|
|
27
|
+
showAtomNumber: moleculeView.atomAnnotation === 'atom-numbers',
|
|
28
|
+
noAtomCustomLabels: moleculeView.atomAnnotation !== 'custom-labels',
|
|
29
|
+
noCarbonLabelWithCustomLabel: true,
|
|
30
|
+
};
|
|
31
|
+
if (renderAsSVG) {
|
|
32
|
+
return _jsx(MolfileSvgRenderer, { ...baseProps });
|
|
33
|
+
}
|
|
34
|
+
return (_jsx("div", { tabIndex: 0, ref: containerRef, children: _jsx(OCLnmr, { id: `molSVG${index}`, ...baseProps, setSelectedAtom: (atom, event) => handleOnClickAtom(atom, event, molecule.id), highlights: currentDiaIDsToHighlight?.length > 0
|
|
35
|
+
? currentDiaIDsToHighlight
|
|
36
|
+
: assignedDiaIDsMerged, atomHighlightStrategy: "prefer-editor-props", setHoverAtom: (atom) => {
|
|
37
|
+
//TODO Temporary workaround to prevent other focused elements from being triggered by the space key
|
|
38
|
+
containerRef.current?.focus();
|
|
39
|
+
handleOnAtomHover(atom);
|
|
40
|
+
if (atom) {
|
|
41
|
+
onAtomHover(atom);
|
|
42
|
+
}
|
|
43
|
+
}, setMolfile: (molfile) => {
|
|
44
|
+
const diaObject = getLastHoverAtom();
|
|
45
|
+
const assignmentObj = getAssignmentLabelByHover(molecule.id, molfile);
|
|
46
|
+
if (assignmentObj && diaObject) {
|
|
47
|
+
dispatch({
|
|
48
|
+
type: 'CHANGE_ASSIGNMENT_LABEL_BY_DIAIDS',
|
|
49
|
+
payload: {
|
|
50
|
+
diaIDs: [diaObject.idCode].concat(diaObject.attachedHydrogensIDCodes),
|
|
51
|
+
assignment: assignmentObj.assignment,
|
|
52
|
+
previousAssignment: assignmentObj.previousAssignment,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
dispatch({
|
|
57
|
+
type: 'SET_MOLECULE',
|
|
58
|
+
payload: {
|
|
59
|
+
molfile,
|
|
60
|
+
id: molecule.id,
|
|
61
|
+
label: molecule.label,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
} }) }));
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=MoleculeStructure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoleculeStructure.js","sourceRoot":"","sources":["../../../../src/component/panels/MoleculesPanel/MoleculeStructure.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,MAAM,MAAM,eAAe,CAAC;AAGnC,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAmC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,OAAO,iBAAiB,MAAM,8BAA+B,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AAUzF,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,EACJ,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,MAAM,EACN,WAAW,GAAG,KAAK,EACnB,iBAAiB,EACjB,KAAK,GAAG,CAAC,GACV,GAAG,KAAK,CAAC;IACV,MAAM,EACJ,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,GACrB,GAAG,iBAAiB,EAAE,CAAC;IACxB,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAC3C,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,EAAE,WAAW,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,GAChE,6BAA6B,EAAE,CAAC;IAClC,mGAAmG;IACnG,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,MAAM,kBAAkB,GACtB,wBAAwB,E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ACH,CAAC,EACD,UAAU,EAAE,CAAC,OAAO,EAAE,EAAE;gBACtB,MAAM,SAAS,GAAG,gBAAgB,EAAE,CAAC;gBACrC,MAAM,aAAa,GAAG,yBAAyB,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;gBAEtE,IAAI,aAAa,IAAI,SAAS,EAAE,CAAC;oBAC/B,QAAQ,CAAC;wBACP,IAAI,EAAE,mCAAmC;wBACzC,OAAO,EAAE;4BACP,MAAM,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAC/B,SAAS,CAAC,wBAAwB,CACnC;4BACD,UAAU,EAAE,aAAa,CAAC,UAAU;4BACpC,kBAAkB,EAAE,aAAa,CAAC,kBAAkB;yBACrD;qBACF,CAAC,CAAC;gBACL,CAAC;gBAED,QAAQ,CAAC;oBACP,IAAI,EAAE,cAAc;oBACpB,OAAO,EAAE;wBACP,OAAO;wBACP,EAAE,EAAE,QAAQ,CAAC,EAAE;wBACf,KAAK,EAAE,QAAQ,CAAC,KAAK;qBACtB;iBACF,CAAC,CAAC;YACL,CAAC,GACD,GACE,CACP,CAAC;AACJ,CAAC"}
|
package/lib/component/panels/MoleculesPanel/{useAtomAssignment.d.ts → hooks/useAtomAssignment.d.ts}
RENAMED
|
@@ -2,7 +2,7 @@ import type { DiaIDAndInfo } from 'openchemlib-utils';
|
|
|
2
2
|
import type { MouseEvent } from 'react';
|
|
3
3
|
export default function useAtomAssignment(): {
|
|
4
4
|
handleOnAtomHover: (diaIDAndInfo: DiaIDAndInfo | undefined) => void;
|
|
5
|
-
handleOnClickAtom: (diaIDAndInfo: DiaIDAndInfo | undefined, event: MouseEvent) => void;
|
|
5
|
+
handleOnClickAtom: (diaIDAndInfo: DiaIDAndInfo | undefined, event: MouseEvent, moleculeId: string) => void;
|
|
6
6
|
currentDiaIDsToHighlight: string[];
|
|
7
7
|
assignedDiaIDsMerged: string[];
|
|
8
8
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAtomAssignment.d.ts","sourceRoot":"","sources":["../../../../../src/component/panels/MoleculesPanel/hooks/useAtomAssignment.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAuExC,MAAM,CAAC,OAAO,UAAU,iBAAiB;sCA6LE,YAAY,GAAG,SAAS;sCAzDjD,YAAY,GAAG,SAAS,SAC/B,UAAU,cACL,MAAM;;;EAuFrB"}
|
package/lib/component/panels/MoleculesPanel/{useAtomAssignment.js → hooks/useAtomAssignment.js}
RENAMED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { useMemo, useRef } from 'react';
|
|
2
|
-
import { isSpectrum1D } from
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
2
|
+
import { isSpectrum1D } from "../../../../data/data1d/Spectrum1D/isSpectrum1D.js";
|
|
3
|
+
import { isSpectrum2D } from "../../../../data/data2d/Spectrum2D/isSpectrum2D.js";
|
|
4
|
+
import { ConcatenationString } from "../../../../data/utilities/Concatenation.js";
|
|
5
|
+
import checkModifierKeyActivated from "../../../../data/utilities/checkModifierKeyActivated.js";
|
|
6
|
+
import { useTracesSpectra } from "../../../2d/useTracesSpectra.js";
|
|
7
|
+
import { useAssignmentContext } from "../../../assignment/AssignmentsContext.js";
|
|
8
|
+
import { useChartData } from "../../../context/ChartContext.js";
|
|
9
|
+
import { useDispatch } from "../../../context/DispatchContext.js";
|
|
10
|
+
import { useToaster } from "../../../context/ToasterContext.js";
|
|
11
|
+
import { useHighlightData } from "../../../highlight/index.js";
|
|
12
|
+
import useSpectrum from "../../../hooks/useSpectrum.js";
|
|
13
|
+
import { extractFromAtom } from "../utilities/extractFromAtom.js";
|
|
14
|
+
import { getAssignIds } from "../utilities/getAssignIds.js";
|
|
15
|
+
import { getCurrentDiaIDsToHighlight } from "../utilities/getCurrentDiaIDsToHighlight.js";
|
|
16
|
+
import { getHighlightsOnHover } from "../utilities/getHighlightsOnHover.js";
|
|
17
|
+
import { getUniqueDiaIDs } from "../utilities/getUniqueDiaIDs.js";
|
|
18
|
+
import { useExtractAtomAssignmentLabel } from "./useExtractAtomAssignmentLabel.js";
|
|
12
19
|
function flattenAssignedDiaIDs(assignments) {
|
|
13
20
|
const assignedDiaIDs = [];
|
|
14
21
|
for (const id in assignments) {
|
|
@@ -43,11 +50,13 @@ function getSignalsDiaIDs(spectrum, assignments, highlightID) {
|
|
|
43
50
|
export default function useAtomAssignment() {
|
|
44
51
|
const { data: spectra, view: { spectra: { activeTab: nucleus }, }, } = useChartData();
|
|
45
52
|
const spectrum = useSpectrum();
|
|
53
|
+
const tracesSpectra = useTracesSpectra();
|
|
46
54
|
const toaster = useToaster();
|
|
47
55
|
const dispatch = useDispatch();
|
|
48
56
|
const highlightData = useHighlightData();
|
|
49
57
|
const highlightedIdDsRef = useRef([]);
|
|
50
58
|
const assignments = useAssignmentContext();
|
|
59
|
+
const { getAssignmentLabelById } = useExtractAtomAssignmentLabel();
|
|
51
60
|
const { activated: activatedAssignment } = assignments;
|
|
52
61
|
const activatedKey = activatedAssignment
|
|
53
62
|
? activatedAssignment.id
|
|
@@ -56,17 +65,27 @@ export default function useAtomAssignment() {
|
|
|
56
65
|
const assignedDiaIDsMerged = useMemo(() => flattenAssignedDiaIDs(assignments.data), [assignments]);
|
|
57
66
|
const currentDiaIDsToHighlight = useMemo(() => {
|
|
58
67
|
const { highlighted, sourceData } = highlightData.highlight;
|
|
59
|
-
const type = sourceData
|
|
60
|
-
|
|
68
|
+
const { type, extra } = sourceData || {};
|
|
69
|
+
const { spectrumID } = extra || {};
|
|
70
|
+
let currentSpectrum = spectrum;
|
|
71
|
+
if (isSpectrum2D(spectrum) && spectrumID) {
|
|
72
|
+
const traceSpectrum = tracesSpectra.find((traceSpectrum) => traceSpectrum.id === spectrumID);
|
|
73
|
+
if (traceSpectrum) {
|
|
74
|
+
currentSpectrum = traceSpectrum;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (!type || !isValidHighlightEventSource(type) || !currentSpectrum) {
|
|
61
78
|
return [];
|
|
79
|
+
}
|
|
62
80
|
const highlightedAssignmentsIDs = highlighted.filter((highlightID) => {
|
|
63
81
|
return assignments.data[highlightID];
|
|
64
82
|
});
|
|
65
|
-
const highlights = highlightedAssignmentsIDs.flatMap((highlightID) => getSignalsDiaIDs(
|
|
83
|
+
const highlights = highlightedAssignmentsIDs.flatMap((highlightID) => getSignalsDiaIDs(currentSpectrum, assignments.data, highlightID));
|
|
66
84
|
return getCurrentDiaIDsToHighlight(assignments).concat(highlights);
|
|
67
|
-
}, [assignments, highlightData.highlight, spectrum]);
|
|
68
|
-
function assign1DAtom(
|
|
69
|
-
const
|
|
85
|
+
}, [assignments, highlightData.highlight, spectrum, tracesSpectra]);
|
|
86
|
+
function assign1DAtom(options) {
|
|
87
|
+
const { spectrum, assignId, atom, assignmentLabel } = options;
|
|
88
|
+
const assignKeys = getAssignIds(spectrum, assignId);
|
|
70
89
|
if (!assignKeys)
|
|
71
90
|
return;
|
|
72
91
|
const [{ index: rangeIndex }] = assignKeys;
|
|
@@ -88,6 +107,7 @@ export default function useAtomAssignment() {
|
|
|
88
107
|
diaIDs: uniqueDiaIDs.diaIDs,
|
|
89
108
|
keys: assignKeys,
|
|
90
109
|
spectrumId,
|
|
110
|
+
assignment: assignmentLabel || '',
|
|
91
111
|
},
|
|
92
112
|
});
|
|
93
113
|
}
|
|
@@ -116,7 +136,7 @@ export default function useAtomAssignment() {
|
|
|
116
136
|
},
|
|
117
137
|
});
|
|
118
138
|
}
|
|
119
|
-
function handleOnClickAtom(diaIDAndInfo, event) {
|
|
139
|
+
function handleOnClickAtom(diaIDAndInfo, event, moleculeId) {
|
|
120
140
|
if (checkModifierKeyActivated(event) || !activatedAssignment)
|
|
121
141
|
return;
|
|
122
142
|
event.preventDefault(); // prevent floating form custom label edit
|
|
@@ -124,6 +144,9 @@ export default function useAtomAssignment() {
|
|
|
124
144
|
if (!id || !axis) {
|
|
125
145
|
return;
|
|
126
146
|
}
|
|
147
|
+
const assignmentLabel = diaIDAndInfo?.idCode
|
|
148
|
+
? getAssignmentLabelById(moleculeId, diaIDAndInfo.idCode)
|
|
149
|
+
: '';
|
|
127
150
|
const atomInformation = extractFromAtom(diaIDAndInfo, nucleus, axis);
|
|
128
151
|
if (atomInformation.nbAtoms === 0) {
|
|
129
152
|
return toaster.show({
|
|
@@ -141,7 +164,12 @@ export default function useAtomAssignment() {
|
|
|
141
164
|
if (!currentSpectrum)
|
|
142
165
|
return;
|
|
143
166
|
if (isSpectrum1D(currentSpectrum)) {
|
|
144
|
-
assign1DAtom(
|
|
167
|
+
assign1DAtom({
|
|
168
|
+
spectrum: currentSpectrum,
|
|
169
|
+
assignId: activatedAssignment.id,
|
|
170
|
+
atom: atomInformation,
|
|
171
|
+
assignmentLabel,
|
|
172
|
+
});
|
|
145
173
|
}
|
|
146
174
|
else {
|
|
147
175
|
assign2DAtom(currentSpectrum, activatedAssignment.id, atomInformation, axis);
|
|
@@ -153,7 +181,10 @@ export default function useAtomAssignment() {
|
|
|
153
181
|
// on enter the atom
|
|
154
182
|
if (oclIDs.length > 0) {
|
|
155
183
|
// set all IDs to highlight when hovering over an atom from assignment data
|
|
156
|
-
const highlights = getHighlightsOnHover(assignments, oclIDs,
|
|
184
|
+
const highlights = getHighlightsOnHover(assignments, oclIDs, [
|
|
185
|
+
spectrum,
|
|
186
|
+
...tracesSpectra,
|
|
187
|
+
]);
|
|
157
188
|
highlightedIdDsRef.current = highlights;
|
|
158
189
|
highlightData.dispatch({
|
|
159
190
|
type: 'SHOW',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAtomAssignment.js","sourceRoot":"","sources":["../../../../../src/component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AAM;gBACZ,OAAO,EAAE,EAAE,mBAAmB,EAAE,kBAAkB,CAAC,OAAO,EAAE;aAC7D,CAAC,CAAC;YACH,kBAAkB,CAAC,OAAO,GAAG,EAAE,CAAC;QAClC,CAAC;IACH,CAAC;IAED,OAAO;QACL,iBAAiB;QACjB,iBAAiB;QACjB,wBAAwB;QACxB,oBAAoB;KACrB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DiaIDAndInfo } from 'openchemlib-utils';
|
|
2
|
+
export declare function useExtractAtomAssignmentLabel(): {
|
|
3
|
+
getAssignmentLabelByHover: (moleculeId: string, molfile?: string) => {
|
|
4
|
+
assignment: string | undefined;
|
|
5
|
+
previousAssignment: string | undefined;
|
|
6
|
+
} | undefined;
|
|
7
|
+
getAssignmentLabelById: (moleculeId: string, oclID: string, molfile?: string) => string | undefined;
|
|
8
|
+
onAtomHover: (atom: DiaIDAndInfo | undefined) => void;
|
|
9
|
+
getLastHoverAtom: () => DiaIDAndInfo | undefined;
|
|
10
|
+
getTopicAtomByHover: (moleculeId: string, molfile?: string) => import("openchemlib-utils").GroupedDiaID | undefined;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useExtractAtomAssignmentLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useExtractAtomAssignmentLabel.d.ts","sourceRoot":"","sources":["../../../../../src/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKtD,wBAAgB,6BAA6B;4CAmDI,MAAM,YAAY,MAAM;;;;yCAjBzD,MAAM,SACX,MAAM,YACH,MAAM;wBAPS,YAAY,GAAG,SAAS;;sCANV,MAAM,YAAY,MAAM;EA4ClE"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Molecule } from 'openchemlib';
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { useTopicMolecule } from "../../../context/TopicMoleculeContext.js";
|
|
4
|
+
export function useExtractAtomAssignmentLabel() {
|
|
5
|
+
const topicMolecule = useTopicMolecule();
|
|
6
|
+
const lastHoverAtomIdRef = useRef();
|
|
7
|
+
function getLastHoverAtom() {
|
|
8
|
+
return lastHoverAtomIdRef.current;
|
|
9
|
+
}
|
|
10
|
+
function getTopicAtom(moleculeId, oclId, molfile) {
|
|
11
|
+
const baseMolecule = topicMolecule?.[moleculeId];
|
|
12
|
+
if (!baseMolecule)
|
|
13
|
+
return;
|
|
14
|
+
const molecule = molfile
|
|
15
|
+
? baseMolecule.fromMolecule(Molecule.fromMolfile(molfile))
|
|
16
|
+
: baseMolecule;
|
|
17
|
+
const groupedDiaIdsMapping = molecule.getGroupedDiastereotopicAtomIDs();
|
|
18
|
+
if (!Array.isArray(groupedDiaIdsMapping))
|
|
19
|
+
return;
|
|
20
|
+
return groupedDiaIdsMapping.find((obj) => obj.oclID === oclId);
|
|
21
|
+
}
|
|
22
|
+
function getTopicAtomByHover(moleculeId, molfile) {
|
|
23
|
+
if (!lastHoverAtomIdRef.current)
|
|
24
|
+
return;
|
|
25
|
+
return getTopicAtom(moleculeId, lastHoverAtomIdRef.current.idCode, molfile);
|
|
26
|
+
}
|
|
27
|
+
function onAtomHover(atom) {
|
|
28
|
+
lastHoverAtomIdRef.current = atom;
|
|
29
|
+
}
|
|
30
|
+
function getAssignmentLabelById(moleculeId, oclID, molfile) {
|
|
31
|
+
const atomData = getTopicAtom(moleculeId, oclID, molfile);
|
|
32
|
+
if (!atomData)
|
|
33
|
+
return;
|
|
34
|
+
const { customLabels = [], heavyAtomsCustomLabels = [] } = atomData;
|
|
35
|
+
const labels = customLabels.length > 0 ? customLabels : heavyAtomsCustomLabels;
|
|
36
|
+
const uniqueLabels = [
|
|
37
|
+
...new Set(labels.map((l) => l.trim()).filter(Boolean)),
|
|
38
|
+
];
|
|
39
|
+
return uniqueLabels.join(',');
|
|
40
|
+
}
|
|
41
|
+
function getAssignmentLabelByHover(moleculeId, molfile) {
|
|
42
|
+
const diaId = lastHoverAtomIdRef.current?.idCode;
|
|
43
|
+
if (!diaId)
|
|
44
|
+
return;
|
|
45
|
+
return {
|
|
46
|
+
assignment: getAssignmentLabelById(moleculeId, diaId, molfile),
|
|
47
|
+
previousAssignment: getAssignmentLabelById(moleculeId, diaId),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
getAssignmentLabelByHover,
|
|
52
|
+
getAssignmentLabelById,
|
|
53
|
+
onAtomHover,
|
|
54
|
+
getLastHoverAtom,
|
|
55
|
+
getTopicAtomByHover,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=useExtractAtomAssignmentLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useExtractAtomAssignmentLabel.js","sourceRoot":"","sources":["../../../../../src/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA2C,CAAC;AAE7E,MAAM,UAAU,6BAA6B;IAC3C,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,MAAM,kBAAkB,GAAG,MAAM,EAAgB,CAAC;IAElD,SAAS,gBAAgB;QACvB,OAAO,kBAAkB,CAAC,OAAO,CAAC;IACpC,CAAC;IAED,SAAS,YAAY,CAAC,UAAkB,EAAE,KAAa,EAAE,OAAgB;QACvE,MAAM,YAAY,GAAG,aAAa,EAAE,CAAC,UAAU,CAAC,CAAC;QAEjD,IAAI,CAAC,YAAY;YAAE,OAAO;QAE1B,MAAM,QAAQ,GAAG,OAAO;YACtB,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,WAA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ED,SAAS,yBAAyB,CAAC,UAAkB,EAAE,OAAgB;QACrE,MAAM,KAAK,GAAG,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC;QACjD,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,OAAO;YACL,UAAU,EAAE,sBAAsB,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC;YAC9D,kBAAkB,EAAE,sBAAsB,CAAC,UAAU,EAAE,KAAK,CAAC;SAC9D,CAAC;IACJ,CAAC;IAED,OAAO;QACL,yBAAyB;QACzB,sBAAsB;QACtB,WAAW;QACX,gBAAgB;QAChB,mBAAmB;KACpB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AtomData.d.ts","sourceRoot":"","sources":["../../../../../src/component/panels/MoleculesPanel/utilities/AtomData.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AtomData.js","sourceRoot":"","sources":["../../../../../src/component/panels/MoleculesPanel/utilities/AtomData.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DiaIDAndInfo } from 'openchemlib-utils';
|
|
2
|
+
import type { Axis } from '../../../assignment/AssignmentsContext.js';
|
|
3
|
+
import type { AtomData } from './AtomData.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Returns the OCL id(s) and number of atoms of an atom when hovering over
|
|
6
|
+
* or clicking on it. This is depending on an optional given axis.
|
|
7
|
+
* In case of an heavy atom with bonded hydrogens the OCL id(s)
|
|
8
|
+
* and number of these hydrogens are added as well.
|
|
9
|
+
*
|
|
10
|
+
* @param {DiaIDAndInfo} diaIDAndInfo - atom returned by OCLnmr component
|
|
11
|
+
* @param {string} activeTab - active tab
|
|
12
|
+
* @param {Axis} axis - current axis
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export declare function extractFromAtom(diaIDAndInfo: DiaIDAndInfo | undefined, activeTab: string, axis?: Axis | null): AtomData;
|
|
16
|
+
//# sourceMappingURL=extractFromAtom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractFromAtom.d.ts","sourceRoot":"","sources":["../../../../../src/component/panels/MoleculesPanel/utilities/extractFromAtom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2CAA2C,CAAC;AAEtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,YAAY,GAAG,SAAS,EACtC,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GACjB,QAAQ,CAkCV"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the OCL id(s) and number of atoms of an atom when hovering over
|
|
3
|
+
* or clicking on it. This is depending on an optional given axis.
|
|
4
|
+
* In case of an heavy atom with bonded hydrogens the OCL id(s)
|
|
5
|
+
* and number of these hydrogens are added as well.
|
|
6
|
+
*
|
|
7
|
+
* @param {DiaIDAndInfo} diaIDAndInfo - atom returned by OCLnmr component
|
|
8
|
+
* @param {string} activeTab - active tab
|
|
9
|
+
* @param {Axis} axis - current axis
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export function extractFromAtom(diaIDAndInfo, activeTab, axis) {
|
|
13
|
+
const elements = getElements(activeTab);
|
|
14
|
+
if (elements && elements.length > 0 && diaIDAndInfo) {
|
|
15
|
+
const dim = axis === 'x' ? 0 : axis === 'y' ? 1 : null;
|
|
16
|
+
switch (dim !== null && elements[dim]) {
|
|
17
|
+
case diaIDAndInfo.atomLabel: {
|
|
18
|
+
// take always oclID if atom type is same as element of activeTab)
|
|
19
|
+
return {
|
|
20
|
+
oclIDs: [diaIDAndInfo.idCode],
|
|
21
|
+
nbAtoms: diaIDAndInfo.nbEquivalentAtoms,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
case 'H': {
|
|
25
|
+
// if we are in proton spectrum and use then the IDs of attached hydrogens of an atom
|
|
26
|
+
return {
|
|
27
|
+
oclIDs: diaIDAndInfo.attachedHydrogensIDCodes,
|
|
28
|
+
nbAtoms: diaIDAndInfo.nbEquivalentAtoms * diaIDAndInfo.nbAttachedHydrogens,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
default:
|
|
32
|
+
return {
|
|
33
|
+
oclIDs: [diaIDAndInfo.idCode].concat(diaIDAndInfo.attachedHydrogensIDCodes),
|
|
34
|
+
nbAtoms: diaIDAndInfo.nbEquivalentAtoms +
|
|
35
|
+
diaIDAndInfo.nbEquivalentAtoms * diaIDAndInfo.nbAttachedHydrogens,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return { oclIDs: [], nbAtoms: 0 };
|
|
40
|
+
}
|
|
41
|
+
function getElements(activeTab) {
|
|
42
|
+
if (!activeTab)
|
|
43
|
+
return;
|
|
44
|
+
const nuclei = activeTab.split(',');
|
|
45
|
+
return nuclei.map((nucleus) => nucleus.replaceAll(/\d/g, ''));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=extractFromAtom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractFromAtom.js","sourceRoot":"","sources":["../../../../../src/component/panels/MoleculesPanel/utilities/extractFromAtom.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAC7B,YAAsC,EACtC,SAAiB,EACjB,IAAkB;IAElB,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;IAExC,IAAI,QAAQ,IAAI,Q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CAAC,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Spectrum } from '@zakodium/nmrium-core';
|
|
2
|
+
interface TargetAssignment {
|
|
3
|
+
key: string;
|
|
4
|
+
index: number;
|
|
5
|
+
}
|
|
6
|
+
interface RangeTargetAssignKey extends TargetAssignment {
|
|
7
|
+
target: 'range';
|
|
8
|
+
}
|
|
9
|
+
interface ZoneTargetAssignKey extends TargetAssignment {
|
|
10
|
+
target: 'zone';
|
|
11
|
+
}
|
|
12
|
+
interface SignalTargetAssignKey extends TargetAssignment {
|
|
13
|
+
target: 'signal';
|
|
14
|
+
}
|
|
15
|
+
export type TargetAssignKeys = [RangeTargetAssignKey | ZoneTargetAssignKey] | [RangeTargetAssignKey | ZoneTargetAssignKey, SignalTargetAssignKey];
|
|
16
|
+
export declare function getAssignIds(spectrum: Spectrum, id: string): TargetAssignKeys | null;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=getAssignIds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAssignIds.d.ts","sourceRoot":"","sources":["../../../../../src/component/panels/MoleculesPanel/utilities/getAssignIds.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,oBAAqB,SAAQ,gBAAgB;IACrD,MAAM,EAAE,OAAO,CAAC;CACjB;AACD,UAAU,mBAAoB,SAAQ,gBAAgB;IACpD,MAAM,EAAE,MAAM,CAAC;CAChB;AACD,UAAU,qBAAsB,SAAQ,gBAAgB;IACtD,MAAM,EAAE,QAAQ,CAAC;CAClB;AACD,MAAM,MAAM,gBAAgB,GACxB,CAAC,oBAAoB,GAAG,mBAAmB,CAAC,GAC5C,CAAC,oBAAoB,GAAG,mBAAmB,EAAE,qBAAqB,CAAC,CAAC;AAExE,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,MAAM,GACT,gBAAgB,GAAG,IAAI,CAwBzB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { isSpectrum1D } from "../../../../data/data1d/Spectrum1D/isSpectrum1D.js";
|
|
2
|
+
export function getAssignIds(spectrum, id) {
|
|
3
|
+
if (!spectrum)
|
|
4
|
+
return null;
|
|
5
|
+
const data = getRangesOrZones(spectrum);
|
|
6
|
+
const target = isSpectrum1D(spectrum) ? 'range' : 'zone';
|
|
7
|
+
for (let i = 0; i < data.length; i++) {
|
|
8
|
+
const datum = data[i];
|
|
9
|
+
if (datum.id === id) {
|
|
10
|
+
return [{ target, index: i, key: datum.id }];
|
|
11
|
+
}
|
|
12
|
+
const signalIndex = datum.signals.findIndex((signal) => signal.id === id);
|
|
13
|
+
if (signalIndex !== -1) {
|
|
14
|
+
const { id } = datum.signals[signalIndex];
|
|
15
|
+
return [
|
|
16
|
+
{ target, index: i, key: datum.id },
|
|
17
|
+
{ target: 'signal', index: signalIndex, key: id },
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
function getRangesOrZones(spectrum) {
|
|
24
|
+
if (isSpectrum1D(spectrum)) {
|
|
25
|
+
return spectrum.ranges.values;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return spectrum.zones.values;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=getAssignIds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAssignIds.js","sourceRoot":"","sources":["../../../../../src/component/panels/MoleculesPanel/utilities/getAssignIds.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAC;AAoBlF,MAAM,UAAU,YAAY,CAC1B,QAAkB,EAClB,EAAU;IA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AAC,KAAK,CAAC,MAAM,CAAC;IAC/B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCurrentDiaIDsToHighlight.d.ts","sourceRoot":"","sources":["../../../../../src/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAEnF,wBAAgB,2BAA2B,CAAC,cAAc,EAAE,iBAAiB,YAS5E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function getCurrentDiaIDsToHighlight(assignmentData) {
|
|
2
|
+
const { highlighted, data } = assignmentData;
|
|
3
|
+
const assignment = highlighted ? data[highlighted.id] : null;
|
|
4
|
+
const axisHover = highlighted ? highlighted.axis : null;
|
|
5
|
+
if (axisHover && assignment?.[axisHover]) {
|
|
6
|
+
return assignment[axisHover];
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
return (assignment?.x || []).concat(assignment?.y || []);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=getCurrentDiaIDsToHighlight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCurrentDiaIDsToHighlight.js","sourceRoot":"","sources":["../../../../../src/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,2BAA2B,CAAC,cAAiC;IAC3E,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC;IAC7C,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7D,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACxD,IAAI,SAAS,IAAI,UAAU,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;QACzC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Spectrum } from '@zakodium/nmrium-core';
|
|
2
|
+
import type { AssignmentContext } from '../../../assignment/AssignmentsContext.ts';
|
|
3
|
+
export declare function getHighlightsOnHover(assignments: AssignmentContext, oclIDs: string[], spectra: Spectrum[]): string[];
|
|
4
|
+
//# sourceMappingURL=getHighlightsOnHover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getHighlightsOnHover.d.ts","sourceRoot":"","sources":["../../../../../src/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAInF,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,iBAAiB,EAC9B,MAAM,EAAE,MAAM,EAAE,EAChB,OAAO,EAAE,QAAQ,EAAE,YAyBpB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { assignmentAxes } from '../../../assignment/AssignmentsContext.js';
|
|
2
|
+
import { getAssignIds } from "./getAssignIds.js";
|
|
3
|
+
export function getHighlightsOnHover(assignments, oclIDs, spectra) {
|
|
4
|
+
// set all IDs to highlight when hovering over an atom from AssignKey data
|
|
5
|
+
let highlights = [];
|
|
6
|
+
const assignmentsByKey = assignments.data;
|
|
7
|
+
for (const key in assignmentsByKey) {
|
|
8
|
+
const assignments = assignmentsByKey[key];
|
|
9
|
+
for (const axis of assignmentAxes) {
|
|
10
|
+
if (assignments[axis]?.some((oclKey) => oclIDs.includes(oclKey))) {
|
|
11
|
+
highlights = highlights.concat(assignments[axis]);
|
|
12
|
+
for (const spectrum of spectra) {
|
|
13
|
+
const assignIds = getAssignIds(spectrum, key);
|
|
14
|
+
if (!assignIds) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
const ids = assignIds.map((item) => item.key);
|
|
18
|
+
highlights.push(...ids);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return highlights;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=getHighlightsOnHover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getHighlightsOnHover.js","sourceRoot":"","sources":["../../../../../src/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAG3E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,UAAU,oBAAoB,CAClC,WAA8B,EAC9B,MAAgB,EAChB,OAAmB;IAEnB,0EAA0E;IAC1E,IAAI,UAAU,GAAa,EAAE,CAAC;IAC9B,MAAM,gBAAgB,GAAG,WAAW,CAAC,IAAI,CAAC;IAE1C,KAAK,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACnC,MAAM,WAAW,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAC1C,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;YAClC,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;gBACtE,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;gBAClD,KAAK,MAAM,QAAQ,IAAI,OAAO,EAAE,CAAC;oBAC/B,MAAM,SAAS,GAAG,YAAY,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;oBAC9C,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,SAAS;oBACX,CAAC;oBAED,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAS,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;oBACtD,UAAU,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;gBAC1B,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUniqueDiaIDs.d.ts","sourceRoot":"","sources":["../../../../../src/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,eAAe,EAAE,QAAQ;;;EAiB1E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function getUniqueDiaIDs(diaIDs, atomInformation) {
|
|
2
|
+
// a previous version of the code prevented to assign many time the same atom
|
|
3
|
+
// see revision cc13abc18f77b6787b923e3c4edaef51750d9e90
|
|
4
|
+
const { nbAtoms, oclIDs } = atomInformation;
|
|
5
|
+
const diaIDSet = new Set(diaIDs);
|
|
6
|
+
let tempNbAtoms = nbAtoms;
|
|
7
|
+
for (const oclID of oclIDs) {
|
|
8
|
+
if (diaIDSet.has(oclID)) {
|
|
9
|
+
tempNbAtoms *= -1;
|
|
10
|
+
diaIDSet.delete(oclID);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
diaIDSet.add(oclID);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return { diaIDs: Array.from(diaIDSet), nbAtoms: tempNbAtoms };
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=getUniqueDiaIDs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUniqueDiaIDs.js","sourceRoot":"","sources":["../../../../../src/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,eAAe,CAAC,MAAgB,EAAE,eAAyB;IACzE,6EAA6E;IAC7E,wDAAwD;IACxD,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,eAAe,CAAC;IAE5C,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC,IAAI,WAAW,GAAW,OAAO,CAAC;IAElC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YACxB,WAAW,IAAI,CAAC,CAAC,CAAC;YAClB,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;AAChE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeaksPanel.d.ts","sourceRoot":"","sources":["../../../../src/component/panels/PeaksPanel/PeaksPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,MAAM,EAAS,MAAM,qBAAqB,CAAC;AAmCjE,MAAM,WAAW,UAAW,SAAQ,MAAM;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,uBAAuB,EAAE,OAAO,CAAC;CAClC;
|
|
1
|
+
{"version":3,"file":"PeaksPanel.d.ts","sourceRoot":"","sources":["../../../../src/component/panels/PeaksPanel/PeaksPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,MAAM,EAAS,MAAM,qBAAqB,CAAC;AAmCjE,MAAM,WAAW,UAAW,SAAQ,MAAM;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,uBAAuB,EAAE,OAAO,CAAC;CAClC;AA0KD,MAAM,CAAC,OAAO,UAAU,UAAU,4CAgBjC"}
|