nmrium 3.1.0 → 3.2.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/BrushTracker1D.d.ts.map +1 -1
- package/lib/component/1d/BrushTracker1D.js +5 -2
- package/lib/component/1d/BrushTracker1D.js.map +1 -1
- package/lib/component/1d/FloatPublicationString.d.ts.map +1 -1
- package/lib/component/1d/FloatPublicationString.js +28 -24
- package/lib/component/1d/FloatPublicationString.js.map +1 -1
- package/lib/component/1d/plugin_chart_brush_tracker.d.ts.map +1 -1
- package/lib/component/1d/plugin_chart_brush_tracker.js +2 -1
- package/lib/component/1d/plugin_chart_brush_tracker.js.map +1 -1
- package/lib/component/1d/plugin_svg_chart.d.ts.map +1 -1
- package/lib/component/1d/plugin_svg_chart.js +15 -2
- package/lib/component/1d/plugin_svg_chart.js.map +1 -1
- package/lib/component/1d/ranges/FloatingRanges.js +2 -2
- package/lib/component/1d/ranges/FloatingRanges.js.map +1 -1
- package/lib/component/1d/ranges/Range.d.ts.map +1 -1
- package/lib/component/1d/ranges/Range.js +1 -1
- package/lib/component/1d/ranges/Range.js.map +1 -1
- package/lib/component/1d-2d/FieldEdition.d.ts +2 -1
- package/lib/component/1d-2d/FieldEdition.d.ts.map +1 -1
- package/lib/component/1d-2d/FieldEdition.js +3 -3
- package/lib/component/1d-2d/FieldEdition.js.map +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +3 -3
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js.map +1 -1
- package/lib/component/2d/1d-tracer/HorizontalSliceChart.d.ts.map +1 -1
- package/lib/component/2d/1d-tracer/HorizontalSliceChart.js +2 -1
- package/lib/component/2d/1d-tracer/HorizontalSliceChart.js.map +1 -1
- package/lib/component/2d/1d-tracer/VerticalSliceChart.d.ts.map +1 -1
- package/lib/component/2d/1d-tracer/VerticalSliceChart.js +2 -1
- package/lib/component/2d/1d-tracer/VerticalSliceChart.js.map +1 -1
- package/lib/component/2d/BrushTracker2D.d.ts.map +1 -1
- package/lib/component/2d/BrushTracker2D.js +5 -1
- package/lib/component/2d/BrushTracker2D.js.map +1 -1
- package/lib/component/2d/SVGContent2D.d.ts.map +1 -1
- package/lib/component/2d/SVGContent2D.js +2 -1
- package/lib/component/2d/SVGContent2D.js.map +1 -1
- package/lib/component/2d/SignalDeltaLine.d.ts +3 -0
- package/lib/component/2d/SignalDeltaLine.d.ts.map +1 -1
- package/lib/component/2d/SignalDeltaLine.js +3 -4
- package/lib/component/2d/SignalDeltaLine.js.map +1 -1
- package/lib/component/2d/linked-signals/LinkedSignal.d.ts +7 -0
- package/lib/component/2d/linked-signals/LinkedSignal.d.ts.map +1 -0
- package/lib/component/2d/linked-signals/LinkedSignal.js +42 -0
- package/lib/component/2d/linked-signals/LinkedSignal.js.map +1 -0
- package/lib/component/2d/linked-signals/LinkedSignalAssignmentLabel.d.ts +8 -0
- package/lib/component/2d/linked-signals/LinkedSignalAssignmentLabel.d.ts.map +1 -0
- package/lib/component/2d/linked-signals/LinkedSignalAssignmentLabel.js +152 -0
- package/lib/component/2d/linked-signals/LinkedSignalAssignmentLabel.js.map +1 -0
- package/lib/component/2d/linked-signals/LinkedSignals.d.ts +2 -0
- package/lib/component/2d/linked-signals/LinkedSignals.d.ts.map +1 -0
- package/lib/component/2d/linked-signals/LinkedSignals.js +32 -0
- package/lib/component/2d/linked-signals/LinkedSignals.js.map +1 -0
- package/lib/component/2d/linked-signals/SignalCrossingIndicator.d.ts +3 -0
- package/lib/component/2d/linked-signals/SignalCrossingIndicator.d.ts.map +1 -0
- package/lib/component/2d/linked-signals/SignalCrossingIndicator.js +36 -0
- package/lib/component/2d/linked-signals/SignalCrossingIndicator.js.map +1 -0
- package/lib/component/2d/linked-signals/useClassifyCorrelation.d.ts +5 -0
- package/lib/component/2d/linked-signals/useClassifyCorrelation.d.ts.map +1 -0
- package/lib/component/2d/linked-signals/useClassifyCorrelation.js +16 -0
- package/lib/component/2d/linked-signals/useClassifyCorrelation.js.map +1 -0
- package/lib/component/2d/linked-signals/useNearestSignalCrossing.d.ts +13 -0
- package/lib/component/2d/linked-signals/useNearestSignalCrossing.d.ts.map +1 -0
- package/lib/component/2d/linked-signals/useNearestSignalCrossing.js +41 -0
- package/lib/component/2d/linked-signals/useNearestSignalCrossing.js.map +1 -0
- package/lib/component/2d/linked-signals/utilities/getCorrelationColor.d.ts +5 -0
- package/lib/component/2d/linked-signals/utilities/getCorrelationColor.d.ts.map +1 -0
- package/lib/component/2d/linked-signals/utilities/getCorrelationColor.js +31 -0
- package/lib/component/2d/linked-signals/utilities/getCorrelationColor.js.map +1 -0
- package/lib/component/2d/linked-signals/utilities/getCouplingLength.d.ts +3 -0
- package/lib/component/2d/linked-signals/utilities/getCouplingLength.d.ts.map +1 -0
- package/lib/component/2d/linked-signals/utilities/getCouplingLength.js +41 -0
- package/lib/component/2d/linked-signals/utilities/getCouplingLength.js.map +1 -0
- package/lib/component/2d/linked-signals/utilities/signalCrossings.d.ts +45 -0
- package/lib/component/2d/linked-signals/utilities/signalCrossings.d.ts.map +1 -0
- package/lib/component/2d/linked-signals/utilities/signalCrossings.js +73 -0
- package/lib/component/2d/linked-signals/utilities/signalCrossings.js.map +1 -0
- package/lib/component/2d/utilities/extractSpectrumSignals.d.ts +5 -0
- package/lib/component/2d/utilities/extractSpectrumSignals.d.ts.map +1 -1
- package/lib/component/2d/utilities/extractSpectrumSignals.js +15 -0
- package/lib/component/2d/utilities/extractSpectrumSignals.js.map +1 -1
- package/lib/component/2d/utilities/useAssignmentLabelLinkPath.d.ts +17 -0
- package/lib/component/2d/utilities/useAssignmentLabelLinkPath.d.ts.map +1 -0
- package/lib/component/2d/utilities/useAssignmentLabelLinkPath.js +99 -0
- package/lib/component/2d/utilities/useAssignmentLabelLinkPath.js.map +1 -0
- package/lib/component/2d/zones/SignalsGuideLines.d.ts.map +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.js +3 -2
- package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
- package/lib/component/2d/zones/Zone.d.ts.map +1 -1
- package/lib/component/2d/zones/Zone.js +47 -1
- package/lib/component/2d/zones/Zone.js.map +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.d.ts.map +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.js +4 -148
- package/lib/component/2d/zones/ZonesAssignmentsLabels.js.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.js +101 -16
- package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.js +6 -0
- package/lib/component/EventsTrackers/KeysListenerTracker.js.map +1 -1
- package/lib/component/EventsTrackers/brush_tracker.types.d.ts +40 -0
- package/lib/component/EventsTrackers/brush_tracker.types.d.ts.map +1 -1
- package/lib/component/EventsTrackers/brush_tracker_drag_gesture.d.ts +42 -0
- package/lib/component/EventsTrackers/brush_tracker_drag_gesture.d.ts.map +1 -0
- package/lib/component/EventsTrackers/brush_tracker_drag_gesture.js +46 -0
- package/lib/component/EventsTrackers/brush_tracker_drag_gesture.js.map +1 -0
- package/lib/component/EventsTrackers/brush_tracker_events_listeners.d.ts +1 -1
- package/lib/component/EventsTrackers/brush_tracker_events_listeners.d.ts.map +1 -1
- package/lib/component/EventsTrackers/brush_tracker_events_listeners.js.map +1 -1
- package/lib/component/context/DispatchContext.d.ts +2 -1
- package/lib/component/context/DispatchContext.d.ts.map +1 -1
- package/lib/component/context/DispatchContext.js.map +1 -1
- package/lib/component/context/processings_mutations_context.api.d.ts.map +1 -1
- package/lib/component/context/processings_mutations_context.api.js +5 -2
- package/lib/component/context/processings_mutations_context.api.js.map +1 -1
- package/lib/component/elements/ActionsButtonsPopover.d.ts +1 -0
- package/lib/component/elements/ActionsButtonsPopover.d.ts.map +1 -1
- package/lib/component/elements/ActionsButtonsPopover.js +14 -6
- package/lib/component/elements/ActionsButtonsPopover.js.map +1 -1
- package/lib/component/elements/export/ExportContent.js +1 -1
- package/lib/component/elements/export/ExportContent.js.map +1 -1
- package/lib/component/elements/print/PrintContent.js +1 -1
- package/lib/component/elements/print/PrintContent.js.map +1 -1
- package/lib/component/elements/tanstack_table/elements/table_row.d.ts.map +1 -1
- package/lib/component/elements/tanstack_table/elements/table_row.js +2 -2
- package/lib/component/elements/tanstack_table/elements/table_row.js.map +1 -1
- package/lib/component/elements/tanstack_table/table.d.ts.map +1 -1
- package/lib/component/elements/tanstack_table/table.js +2 -1
- package/lib/component/elements/tanstack_table/table.js.map +1 -1
- package/lib/component/elements/tanstack_table/types.d.ts +2 -0
- package/lib/component/elements/tanstack_table/types.d.ts.map +1 -1
- package/lib/component/highlight/index.d.ts +2 -0
- package/lib/component/highlight/index.d.ts.map +1 -1
- package/lib/component/highlight/index.js.map +1 -1
- package/lib/component/hooks/usePanelPreferences.d.ts +2 -2
- package/lib/component/hooks/usePanelPreferences.d.ts.map +1 -1
- package/lib/component/hooks/usePanelPreferences.js +5 -1
- package/lib/component/hooks/usePanelPreferences.js.map +1 -1
- package/lib/component/hooks/useToolsFunctions.d.ts.map +1 -1
- package/lib/component/hooks/useToolsFunctions.js +8 -5
- package/lib/component/hooks/useToolsFunctions.js.map +1 -1
- package/lib/component/hooks/use_publication_strings.d.ts +3 -1
- package/lib/component/hooks/use_publication_strings.d.ts.map +1 -1
- package/lib/component/hooks/use_publication_strings.js +10 -6
- package/lib/component/hooks/use_publication_strings.js.map +1 -1
- package/lib/component/modal/PredictSpectraModal.d.ts.map +1 -1
- package/lib/component/modal/PredictSpectraModal.js +5 -2
- package/lib/component/modal/PredictSpectraModal.js.map +1 -1
- package/lib/component/modal/PredictionLimitModal.d.ts +10 -0
- package/lib/component/modal/PredictionLimitModal.d.ts.map +1 -0
- package/lib/component/modal/PredictionLimitModal.js +31 -0
- package/lib/component/modal/PredictionLimitModal.js.map +1 -0
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +1 -1
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/errors/context.d.ts +24 -0
- package/lib/component/modal/setting/tanstack_general_settings/errors/context.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.d.ts +24 -0
- package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts +24 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts +12 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts +12 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts +2 -0
- package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts +12 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/axis_tab.d.ts +12 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/axis_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts +12 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts +12 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts +12 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts +12 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts +12 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts +12 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts +12 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.js +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts +12 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.d.ts +12 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts +12 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts +12 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.js +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.d.ts +11 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.js +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.d.ts +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.js +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation.d.ts +12 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation.d.ts.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralTable.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +5 -5
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.js +11 -9
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js +7 -2
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.d.ts +3 -0
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.js +31 -17
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useSignalAssignmentUpdates.d.ts +18 -0
- package/lib/component/panels/MoleculesPanel/hooks/useSignalAssignmentUpdates.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/hooks/useSignalAssignmentUpdates.js +113 -0
- package/lib/component/panels/MoleculesPanel/hooks/useSignalAssignmentUpdates.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/sortAssignmentLabels.d.ts +11 -0
- package/lib/component/panels/MoleculesPanel/utilities/sortAssignmentLabels.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/sortAssignmentLabels.js +28 -0
- package/lib/component/panels/MoleculesPanel/utilities/sortAssignmentLabels.js.map +1 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js.map +1 -1
- package/lib/component/panels/SpectraPanel/SpectraPanelHeader.js +1 -1
- package/lib/component/panels/SpectraPanel/SpectraPanelHeader.js.map +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js.map +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentLabelColumn.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentLabelColumn.js +40 -4
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentLabelColumn.js.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +17 -5
- package/lib/component/panels/ZonesPanel/ZonesPanel.js.map +1 -1
- package/lib/component/panels/accordionItems.d.ts.map +1 -1
- package/lib/component/panels/accordionItems.js +7 -0
- package/lib/component/panels/accordionItems.js.map +1 -1
- package/lib/component/panels/assignment-summary/AssignmentSummaryPanel.d.ts +2 -0
- package/lib/component/panels/assignment-summary/AssignmentSummaryPanel.d.ts.map +1 -0
- package/lib/component/panels/assignment-summary/AssignmentSummaryPanel.js +136 -0
- package/lib/component/panels/assignment-summary/AssignmentSummaryPanel.js.map +1 -0
- package/lib/component/panels/assignment-summary/AssignmentsExportModal.d.ts +10 -0
- package/lib/component/panels/assignment-summary/AssignmentsExportModal.d.ts.map +1 -0
- package/lib/component/panels/assignment-summary/AssignmentsExportModal.js +128 -0
- package/lib/component/panels/assignment-summary/AssignmentsExportModal.js.map +1 -0
- package/lib/component/panels/assignment-summary/MoleculeAssignmentTable.d.ts +11 -0
- package/lib/component/panels/assignment-summary/MoleculeAssignmentTable.d.ts.map +1 -0
- package/lib/component/panels/assignment-summary/MoleculeAssignmentTable.js +113 -0
- package/lib/component/panels/assignment-summary/MoleculeAssignmentTable.js.map +1 -0
- package/lib/component/panels/assignment-summary/table-cells/AssignmentAtomCell.d.ts +8 -0
- package/lib/component/panels/assignment-summary/table-cells/AssignmentAtomCell.d.ts.map +1 -0
- package/lib/component/panels/assignment-summary/table-cells/AssignmentAtomCell.js +16 -0
- package/lib/component/panels/assignment-summary/table-cells/AssignmentAtomCell.js.map +1 -0
- package/lib/component/panels/assignment-summary/table-cells/AssignmentChemicalShiftCell.d.ts +7 -0
- package/lib/component/panels/assignment-summary/table-cells/AssignmentChemicalShiftCell.d.ts.map +1 -0
- package/lib/component/panels/assignment-summary/table-cells/AssignmentChemicalShiftCell.js +22 -0
- package/lib/component/panels/assignment-summary/table-cells/AssignmentChemicalShiftCell.js.map +1 -0
- package/lib/component/panels/assignment-summary/table-cells/AssignmentCorrelationCell.d.ts +7 -0
- package/lib/component/panels/assignment-summary/table-cells/AssignmentCorrelationCell.d.ts.map +1 -0
- package/lib/component/panels/assignment-summary/table-cells/AssignmentCorrelationCell.js +5 -0
- package/lib/component/panels/assignment-summary/table-cells/AssignmentCorrelationCell.js.map +1 -0
- package/lib/component/panels/assignment-summary/table-cells/AssignmentLabelCell.d.ts +9 -0
- package/lib/component/panels/assignment-summary/table-cells/AssignmentLabelCell.d.ts.map +1 -0
- package/lib/component/panels/assignment-summary/table-cells/AssignmentLabelCell.js +10 -0
- package/lib/component/panels/assignment-summary/table-cells/AssignmentLabelCell.js.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/atomGroupsToAssignmentRows.d.ts +54 -0
- package/lib/component/panels/assignment-summary/utilities/atomGroupsToAssignmentRows.d.ts.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/atomGroupsToAssignmentRows.js +161 -0
- package/lib/component/panels/assignment-summary/utilities/atomGroupsToAssignmentRows.js.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/exportAssignments.d.ts +19 -0
- package/lib/component/panels/assignment-summary/utilities/exportAssignments.d.ts.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/exportAssignments.js +74 -0
- package/lib/component/panels/assignment-summary/utilities/exportAssignments.js.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/formatAssignmentACS.d.ts +7 -0
- package/lib/component/panels/assignment-summary/utilities/formatAssignmentACS.d.ts.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/formatAssignmentACS.js +28 -0
- package/lib/component/panels/assignment-summary/utilities/formatAssignmentACS.js.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/formatAssignmentShifts.d.ts +12 -0
- package/lib/component/panels/assignment-summary/utilities/formatAssignmentShifts.d.ts.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/formatAssignmentShifts.js +14 -0
- package/lib/component/panels/assignment-summary/utilities/formatAssignmentShifts.js.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/getAssignedAtomCounts.d.ts +9 -0
- package/lib/component/panels/assignment-summary/utilities/getAssignedAtomCounts.d.ts.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/getAssignedAtomCounts.js +23 -0
- package/lib/component/panels/assignment-summary/utilities/getAssignedAtomCounts.js.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/getAssignmentSignals.d.ts +7 -0
- package/lib/component/panels/assignment-summary/utilities/getAssignmentSignals.d.ts.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/getAssignmentSignals.js +41 -0
- package/lib/component/panels/assignment-summary/utilities/getAssignmentSignals.js.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/getLinkedCorrelationsByExperiment.d.ts +18 -0
- package/lib/component/panels/assignment-summary/utilities/getLinkedCorrelationsByExperiment.d.ts.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/getLinkedCorrelationsByExperiment.js +121 -0
- package/lib/component/panels/assignment-summary/utilities/getLinkedCorrelationsByExperiment.js.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/getSignalsByNucleus.d.ts +16 -0
- package/lib/component/panels/assignment-summary/utilities/getSignalsByNucleus.d.ts.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/getSignalsByNucleus.js +53 -0
- package/lib/component/panels/assignment-summary/utilities/getSignalsByNucleus.js.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/types.d.ts +39 -0
- package/lib/component/panels/assignment-summary/utilities/types.d.ts.map +1 -0
- package/lib/component/panels/assignment-summary/utilities/types.js +2 -0
- package/lib/component/panels/assignment-summary/utilities/types.js.map +1 -0
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js.map +1 -1
- package/lib/component/panels/filtersPanel/processings/operator_edit_banner.d.ts +6 -0
- package/lib/component/panels/filtersPanel/processings/operator_edit_banner.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/processings/operator_edit_banner.js +2 -2
- package/lib/component/panels/filtersPanel/processings/operator_edit_banner.js.map +1 -1
- package/lib/component/panels/filtersPanel/processings/processing_item.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/processings/processing_item.js +1 -1
- package/lib/component/panels/filtersPanel/processings/processing_item.js.map +1 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.d.ts.map +1 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +4 -2
- package/lib/component/panels/predictionPanel/PredictionPanel.js.map +1 -1
- package/lib/component/reducer/Reducer.d.ts.map +1 -1
- package/lib/component/reducer/Reducer.js +14 -2
- package/lib/component/reducer/Reducer.js.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.js +5 -2
- package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
- package/lib/component/reducer/actions/LinkedSignalsActions.d.ts +29 -0
- package/lib/component/reducer/actions/LinkedSignalsActions.d.ts.map +1 -0
- package/lib/component/reducer/actions/LinkedSignalsActions.js +62 -0
- package/lib/component/reducer/actions/LinkedSignalsActions.js.map +1 -0
- package/lib/component/reducer/actions/MoleculeActions.d.ts +7 -28
- package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.js +78 -10
- package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
- package/lib/component/reducer/actions/RangesActions.d.ts +2 -8
- package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/RangesActions.js +3 -43
- package/lib/component/reducer/actions/RangesActions.js.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +10 -0
- package/lib/component/reducer/actions/ToolsActions.js.map +1 -1
- package/lib/component/reducer/actions/ZonesActions.d.ts +16 -2
- package/lib/component/reducer/actions/ZonesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/ZonesActions.js +57 -14
- package/lib/component/reducer/actions/ZonesActions.js.map +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +19 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts.map +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.js +19 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.js.map +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +3 -2
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts.map +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +4 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js.map +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts.map +1 -1
- package/lib/component/toolbar/ToolTypes.js +15 -0
- package/lib/component/toolbar/ToolTypes.js.map +1 -1
- package/lib/component/toolbar/nmr_toolbar.d.ts.map +1 -1
- package/lib/component/toolbar/nmr_toolbar.js +15 -7
- package/lib/component/toolbar/nmr_toolbar.js.map +1 -1
- package/lib/component/utility/core_slots/core_operator_chart_brush.commons.d.ts.map +1 -1
- package/lib/component/utility/core_slots/core_operator_chart_brush.commons.js +62 -4
- package/lib/component/utility/core_slots/core_operator_chart_brush.commons.js.map +1 -1
- package/lib/component/utility/core_slots/core_operator_chart_svg.d.ts.map +1 -1
- package/lib/component/utility/core_slots/core_operator_chart_svg.js +2 -2
- package/lib/component/utility/core_slots/core_operator_chart_svg.js.map +1 -1
- package/lib/component/workspaces/assignment.d.ts.map +1 -1
- package/lib/component/workspaces/assignment.js +5 -3
- 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 +7 -5
- 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 +1 -0
- package/lib/component/workspaces/embedded.js.map +1 -1
- package/lib/component/workspaces/prediction.d.ts.map +1 -1
- package/lib/component/workspaces/prediction.js +1 -0
- package/lib/component/workspaces/prediction.js.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +2 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
- package/lib/data/PredictionManager.d.ts +5 -0
- package/lib/data/PredictionManager.d.ts.map +1 -1
- package/lib/data/PredictionManager.js +11 -1
- package/lib/data/PredictionManager.js.map +1 -1
- package/lib/data/constants/Multiplets.js +2 -2
- package/lib/data/constants/Multiplets.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -0
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +9 -10
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js.map +1 -1
- package/lib/data/molecules/Molecule.d.ts +1 -0
- package/lib/data/molecules/Molecule.d.ts.map +1 -1
- package/lib/data/molecules/Molecule.js +18 -3
- package/lib/data/molecules/Molecule.js.map +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +5 -2
- package/lib/data/molecules/MoleculeManager.d.ts.map +1 -1
- package/lib/data/molecules/MoleculeManager.js +10 -7
- package/lib/data/molecules/MoleculeManager.js.map +1 -1
- package/lib/utils/clipboard/clipboardHooks.d.ts +3 -1
- package/lib/utils/clipboard/clipboardHooks.d.ts.map +1 -1
- package/lib/utils/clipboard/clipboardHooks.js +15 -9
- package/lib/utils/clipboard/clipboardHooks.js.map +1 -1
- package/lib/versionInfo.js +1 -1
- package/package.json +48 -48
- package/src/component/1d/BrushTracker1D.tsx +5 -2
- package/src/component/1d/FloatPublicationString.tsx +39 -33
- package/src/component/1d/plugin_chart_brush_tracker.tsx +2 -0
- package/src/component/1d/plugin_svg_chart.tsx +20 -1
- package/src/component/1d/ranges/FloatingRanges.tsx +2 -2
- package/src/component/1d/ranges/Range.tsx +1 -2
- package/src/component/1d-2d/FieldEdition.tsx +14 -4
- package/src/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.tsx +3 -3
- package/src/component/2d/1d-tracer/HorizontalSliceChart.tsx +6 -1
- package/src/component/2d/1d-tracer/VerticalSliceChart.tsx +6 -1
- package/src/component/2d/BrushTracker2D.tsx +7 -1
- package/src/component/2d/SVGContent2D.tsx +2 -0
- package/src/component/2d/SignalDeltaLine.tsx +8 -2
- package/src/component/2d/linked-signals/LinkedSignal.tsx +68 -0
- package/src/component/2d/linked-signals/LinkedSignalAssignmentLabel.tsx +248 -0
- package/src/component/2d/linked-signals/LinkedSignals.tsx +56 -0
- package/src/component/2d/linked-signals/SignalCrossingIndicator.tsx +63 -0
- package/src/component/2d/linked-signals/useClassifyCorrelation.ts +24 -0
- package/src/component/2d/linked-signals/useNearestSignalCrossing.ts +68 -0
- package/src/component/2d/linked-signals/utilities/getCorrelationColor.ts +46 -0
- package/src/component/2d/linked-signals/utilities/getCouplingLength.ts +58 -0
- package/src/component/2d/linked-signals/utilities/signalCrossings.ts +167 -0
- package/src/component/2d/utilities/extractSpectrumSignals.ts +22 -0
- package/src/component/2d/utilities/useAssignmentLabelLinkPath.ts +138 -0
- package/src/component/2d/zones/SignalsGuideLines.tsx +9 -2
- package/src/component/2d/zones/Zone.tsx +58 -1
- package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +5 -198
- package/src/component/EventsTrackers/BrushTracker.tsx +135 -25
- package/src/component/EventsTrackers/KeysListenerTracker.tsx +6 -0
- package/src/component/EventsTrackers/brush_tracker.types.ts +43 -0
- package/src/component/EventsTrackers/brush_tracker_drag_gesture.ts +84 -0
- package/src/component/EventsTrackers/brush_tracker_events_listeners.ts +7 -1
- package/src/component/context/DispatchContext.tsx +2 -0
- package/src/component/context/processings_mutations_context.api.ts +6 -2
- package/src/component/elements/ActionsButtonsPopover.tsx +22 -3
- package/src/component/elements/export/ExportContent.tsx +1 -0
- package/src/component/elements/print/PrintContent.tsx +1 -0
- package/src/component/elements/tanstack_table/elements/table_row.tsx +5 -1
- package/src/component/elements/tanstack_table/table.tsx +2 -0
- package/src/component/elements/tanstack_table/types.ts +2 -0
- package/src/component/highlight/index.tsx +2 -0
- package/src/component/hooks/usePanelPreferences.ts +15 -5
- package/src/component/hooks/useToolsFunctions.ts +8 -4
- package/src/component/hooks/use_publication_strings.ts +19 -7
- package/src/component/modal/PredictSpectraModal.tsx +8 -2
- package/src/component/modal/PredictionLimitModal.tsx +88 -0
- package/src/component/modal/editRange/forms/validation/EditRangeValidation.ts +1 -1
- package/src/component/modal/setting/tanstack_general_settings/tabs/panels_tab.tsx +6 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/tools_tab.tsx +3 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.ts +1 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.ts +1 -0
- package/src/component/panels/IntegralsPanel/IntegralTable.tsx +2 -2
- package/src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx +7 -5
- package/src/component/panels/MoleculesPanel/MoleculeStructure.tsx +14 -12
- package/src/component/panels/MoleculesPanel/hooks/useAtomAssignment.tsx +12 -2
- package/src/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.ts +57 -20
- package/src/component/panels/MoleculesPanel/hooks/useSignalAssignmentUpdates.ts +191 -0
- package/src/component/panels/MoleculesPanel/utilities/sortAssignmentLabels.ts +29 -0
- package/src/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.tsx +2 -2
- package/src/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.tsx +2 -2
- package/src/component/panels/SpectraPanel/SpectraPanelHeader.tsx +1 -1
- package/src/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.tsx +3 -3
- package/src/component/panels/ZonesPanel/TableColumns/ZoneAssignmentLabelColumn.tsx +57 -4
- package/src/component/panels/ZonesPanel/ZonesPanel.tsx +19 -8
- package/src/component/panels/accordionItems.tsx +7 -0
- package/src/component/panels/assignment-summary/AssignmentSummaryPanel.tsx +263 -0
- package/src/component/panels/assignment-summary/AssignmentsExportModal.tsx +249 -0
- package/src/component/panels/assignment-summary/MoleculeAssignmentTable.tsx +223 -0
- package/src/component/panels/assignment-summary/table-cells/AssignmentAtomCell.tsx +36 -0
- package/src/component/panels/assignment-summary/table-cells/AssignmentChemicalShiftCell.tsx +57 -0
- package/src/component/panels/assignment-summary/table-cells/AssignmentCorrelationCell.tsx +23 -0
- package/src/component/panels/assignment-summary/table-cells/AssignmentLabelCell.tsx +16 -0
- package/src/component/panels/assignment-summary/utilities/atomGroupsToAssignmentRows.ts +254 -0
- package/src/component/panels/assignment-summary/utilities/exportAssignments.ts +135 -0
- package/src/component/panels/assignment-summary/utilities/formatAssignmentACS.ts +35 -0
- package/src/component/panels/assignment-summary/utilities/formatAssignmentShifts.ts +26 -0
- package/src/component/panels/assignment-summary/utilities/getAssignedAtomCounts.ts +32 -0
- package/src/component/panels/assignment-summary/utilities/getAssignmentSignals.ts +55 -0
- package/src/component/panels/assignment-summary/utilities/getLinkedCorrelationsByExperiment.ts +175 -0
- package/src/component/panels/assignment-summary/utilities/getSignalsByNucleus.ts +60 -0
- package/src/component/panels/assignment-summary/utilities/types.ts +47 -0
- package/src/component/panels/extra/utilities/MultiplicityUtilities.ts +2 -2
- package/src/component/panels/filtersPanel/processings/operator_edit_banner.tsx +8 -1
- package/src/component/panels/filtersPanel/processings/processing_item.tsx +2 -1
- package/src/component/panels/predictionPanel/PredictionPanel.tsx +6 -2
- package/src/component/reducer/Reducer.ts +23 -5
- package/src/component/reducer/actions/FiltersActions.ts +6 -2
- package/src/component/reducer/actions/LinkedSignalsActions.ts +128 -0
- package/src/component/reducer/actions/MoleculeActions.ts +139 -11
- package/src/component/reducer/actions/RangesActions.ts +3 -85
- package/src/component/reducer/actions/ToolsActions.ts +13 -0
- package/src/component/reducer/actions/ZonesActions.ts +95 -13
- package/src/component/reducer/helper/ZoomHistoryManager.ts +41 -1
- package/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts +7 -0
- package/src/component/toolbar/ToolTypes.ts +15 -0
- package/src/component/toolbar/nmr_toolbar.tsx +17 -21
- package/src/component/utility/core_slots/core_operator_chart_brush.commons.ts +99 -3
- package/src/component/utility/core_slots/core_operator_chart_svg.tsx +4 -0
- package/src/component/workspaces/assignment.ts +5 -3
- package/src/component/workspaces/basic.ts +7 -5
- package/src/component/workspaces/embedded.ts +1 -0
- package/src/component/workspaces/prediction.ts +1 -0
- package/src/component/workspaces/workspaceDefaultProperties.ts +2 -0
- package/src/data/PredictionManager.ts +11 -1
- package/src/data/constants/Multiplets.ts +2 -2
- package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +1 -0
- package/src/data/data2d/Spectrum2D/zones/detectZonesManual.ts +1 -1
- package/src/data/data2d/Spectrum2D/zones/getDetectionZones.ts +7 -8
- package/src/data/molecules/Molecule.ts +22 -6
- package/src/data/molecules/MoleculeManager.ts +11 -9
- package/src/utils/clipboard/clipboardHooks.ts +19 -16
- package/src/versionInfo.ts +1 -1
- package/lib/utils/clipboard/clipboard.d.ts +0 -15
- package/lib/utils/clipboard/clipboard.d.ts.map +0 -1
- package/lib/utils/clipboard/clipboard.js +0 -19
- package/lib/utils/clipboard/clipboard.js.map +0 -1
- package/src/utils/clipboard/clipboard.ts +0 -36
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { ACSExportOptions, Spectrum } from '@zakodium/nmrium-core';
|
|
2
|
+
import type { GroupedDiaID, TopicMolecule } from 'openchemlib-utils';
|
|
3
|
+
import papa from 'papaparse';
|
|
4
|
+
|
|
5
|
+
import { formatAssignmentLabel } from '../table-cells/AssignmentLabelCell.js';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
atomGroupsToAssignmentRows,
|
|
9
|
+
getHydrogenIDsByParent,
|
|
10
|
+
getVisibleAssignmentRows,
|
|
11
|
+
} from './atomGroupsToAssignmentRows.js';
|
|
12
|
+
import { formatAssignmentACS } from './formatAssignmentACS.js';
|
|
13
|
+
import { formatAssignmentShifts } from './formatAssignmentShifts.js';
|
|
14
|
+
import { getAssignmentSignals } from './getAssignmentSignals.js';
|
|
15
|
+
import {
|
|
16
|
+
formatLinkedCorrelations,
|
|
17
|
+
getLinkedCorrelationsByExperiment,
|
|
18
|
+
} from './getLinkedCorrelationsByExperiment.js';
|
|
19
|
+
import { getSignalsByNucleus } from './getSignalsByNucleus.js';
|
|
20
|
+
import type { GetAssignmentSignalsOptions } from './types.js';
|
|
21
|
+
|
|
22
|
+
export type AssignmentExportRowMode = 'current' | 'expanded' | 'collapsed';
|
|
23
|
+
|
|
24
|
+
interface AssignmentExportOptions {
|
|
25
|
+
groups: GroupedDiaID[];
|
|
26
|
+
topicMolecule: TopicMolecule;
|
|
27
|
+
spectra: Spectrum[];
|
|
28
|
+
expandedGroups: Set<string>;
|
|
29
|
+
rowMode: AssignmentExportRowMode;
|
|
30
|
+
acsExportSettings: Record<string, ACSExportOptions>;
|
|
31
|
+
defaultACSOptions: ACSExportOptions;
|
|
32
|
+
delimiter: ',' | '\t';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Export the selected molecule as CSV or TSV using the table's formatting rules.
|
|
37
|
+
*/
|
|
38
|
+
export function exportAssignments(options: AssignmentExportOptions): string {
|
|
39
|
+
const { fields, data } = getAssignmentExportData(options);
|
|
40
|
+
return papa.unparse(
|
|
41
|
+
{ fields, data },
|
|
42
|
+
{ delimiter: options.delimiter, escapeFormulae: true },
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function getAssignmentExportData(options: AssignmentExportOptions) {
|
|
47
|
+
const {
|
|
48
|
+
groups,
|
|
49
|
+
topicMolecule,
|
|
50
|
+
spectra,
|
|
51
|
+
expandedGroups,
|
|
52
|
+
rowMode,
|
|
53
|
+
acsExportSettings,
|
|
54
|
+
defaultACSOptions,
|
|
55
|
+
} = options;
|
|
56
|
+
const allRows = atomGroupsToAssignmentRows(groups, true);
|
|
57
|
+
const rows =
|
|
58
|
+
rowMode === 'expanded'
|
|
59
|
+
? allRows
|
|
60
|
+
: getVisibleAssignmentRows(
|
|
61
|
+
allRows,
|
|
62
|
+
rowMode === 'current' ? expandedGroups : new Set<string>(),
|
|
63
|
+
);
|
|
64
|
+
const hydrogenIDsByParent = getHydrogenIDsByParent(allRows);
|
|
65
|
+
const linkedAssignmentsByExperiment = Array.from(
|
|
66
|
+
getLinkedCorrelationsByExperiment(spectra, topicMolecule),
|
|
67
|
+
);
|
|
68
|
+
const nuclei = Array.from(
|
|
69
|
+
getSignalsByNucleus(spectra),
|
|
70
|
+
([nucleus, signals]) => ({
|
|
71
|
+
nucleus,
|
|
72
|
+
signalsByOclID: signals,
|
|
73
|
+
acs: acsExportSettings[nucleus] ?? defaultACSOptions,
|
|
74
|
+
}),
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const fields = [
|
|
78
|
+
'Atom',
|
|
79
|
+
'Atom numbers',
|
|
80
|
+
'Atom labels',
|
|
81
|
+
...nuclei.map(({ nucleus }) => nucleus),
|
|
82
|
+
...linkedAssignmentsByExperiment.map(([experiment]) => experiment),
|
|
83
|
+
];
|
|
84
|
+
const data = rows.map((row) => [
|
|
85
|
+
row.atomLabel,
|
|
86
|
+
formatAssignmentLabel({
|
|
87
|
+
value: row.atomNumbers,
|
|
88
|
+
hydrogenValue: row.hydrogenAtomNumbers,
|
|
89
|
+
isExpanded: row.isExpanded,
|
|
90
|
+
}),
|
|
91
|
+
formatAssignmentLabel({
|
|
92
|
+
value: row.atomLabels,
|
|
93
|
+
hydrogenValue: row.hydrogenAtomLabels,
|
|
94
|
+
isExpanded: row.isExpanded,
|
|
95
|
+
}),
|
|
96
|
+
...nuclei.map(({ signalsByOclID, acs }) =>
|
|
97
|
+
formatAssignmentCell({
|
|
98
|
+
row,
|
|
99
|
+
signalsByOclID,
|
|
100
|
+
hydrogenIDsByParent,
|
|
101
|
+
groups,
|
|
102
|
+
acs,
|
|
103
|
+
}),
|
|
104
|
+
),
|
|
105
|
+
...linkedAssignmentsByExperiment.map(([, assignmentsByOclID]) =>
|
|
106
|
+
formatLinkedCorrelations(row, assignmentsByOclID, hydrogenIDsByParent)
|
|
107
|
+
.map(({ text }) => text)
|
|
108
|
+
.join(', '),
|
|
109
|
+
),
|
|
110
|
+
]);
|
|
111
|
+
|
|
112
|
+
return { fields, data };
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
interface FormatAssignmentCellOptions extends GetAssignmentSignalsOptions {
|
|
116
|
+
acs: ACSExportOptions;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function formatAssignmentCell(options: FormatAssignmentCellOptions): string {
|
|
120
|
+
const { row, acs } = options;
|
|
121
|
+
|
|
122
|
+
return getAssignmentSignals(options)
|
|
123
|
+
.map((assignment) => {
|
|
124
|
+
if (row.isHydrogen) {
|
|
125
|
+
return `${formatAssignmentShifts({ assignment, deltaFormat: acs.deltaFormat })} ppm`;
|
|
126
|
+
}
|
|
127
|
+
// The ACS formatter emits <i>J</i> for couplings
|
|
128
|
+
// Strip HTML tags so spreadsheet cells contain plain text.
|
|
129
|
+
return formatAssignmentACS({ assignment, acs }).replaceAll(
|
|
130
|
+
/<[^>]+>/g,
|
|
131
|
+
'',
|
|
132
|
+
);
|
|
133
|
+
})
|
|
134
|
+
.join(', ');
|
|
135
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ACSExportOptions } from '@zakodium/nmrium-core';
|
|
2
|
+
import { rangesToACS } from 'nmr-processing';
|
|
3
|
+
|
|
4
|
+
import { getRangesToACSOptions } from '../../../hooks/use_publication_strings.js';
|
|
5
|
+
|
|
6
|
+
import type { FormatAssignmentOptions } from './types.js';
|
|
7
|
+
|
|
8
|
+
const assignmentACSOptions: Partial<ACSExportOptions> = {
|
|
9
|
+
signalKind: 'signal',
|
|
10
|
+
ascending: true,
|
|
11
|
+
format: 'IMJ',
|
|
12
|
+
textStyle: {},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Format one spectrum's assignments as ACS HTML without the spectrum header,
|
|
17
|
+
* delta prefix, or final period.
|
|
18
|
+
*/
|
|
19
|
+
export function formatAssignmentACS(options: FormatAssignmentOptions): string {
|
|
20
|
+
const { assignment } = options;
|
|
21
|
+
const { spectrum, ranges } = assignment;
|
|
22
|
+
const acs = {
|
|
23
|
+
...options.acs,
|
|
24
|
+
...assignmentACSOptions,
|
|
25
|
+
...(spectrum.info.nucleus === '13C' && { format: 'D' }),
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const acsString = rangesToACS(ranges, {
|
|
29
|
+
...getRangesToACSOptions(spectrum.info, acs),
|
|
30
|
+
filter: false,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// "1H NMR (600 MHz): δ 4.04 (d)." becomes "4.04 (d)".
|
|
34
|
+
return acsString.replaceAll(/^(?:[^:]*:\s*)?\u{03B4}\s*|\.$/gu, '');
|
|
35
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { formatNumber } from '../../../utility/formatNumber.js';
|
|
2
|
+
|
|
3
|
+
import type { AssignmentSignals } from './types.js';
|
|
4
|
+
|
|
5
|
+
interface FormatAssignmentShiftsOptions {
|
|
6
|
+
assignment: AssignmentSignals;
|
|
7
|
+
deltaFormat: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Sort and format signal deltas without adding spectrum details or units.
|
|
12
|
+
* @returns Shift values joined with ', '
|
|
13
|
+
*/
|
|
14
|
+
export function formatAssignmentShifts(
|
|
15
|
+
options: FormatAssignmentShiftsOptions,
|
|
16
|
+
): string {
|
|
17
|
+
const { assignment, deltaFormat } = options;
|
|
18
|
+
const deltas = assignment.ranges.flatMap(({ signals }) =>
|
|
19
|
+
signals.map(({ delta }) => delta),
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
return deltas
|
|
23
|
+
.toSorted((a, b) => a - b)
|
|
24
|
+
.map((delta) => formatNumber(delta, deltaFormat))
|
|
25
|
+
.join(', ');
|
|
26
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { GroupedDiaID } from 'openchemlib-utils';
|
|
2
|
+
|
|
3
|
+
import type { AssignedAtomCounts, SignalsByOclID } from './types.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Count atoms of the nucleus's element in the selected molecule.
|
|
7
|
+
* The lookup must belong to that nucleus. Counts measure assignment coverage,
|
|
8
|
+
* not the number of signals or whether the assignments have been verified.
|
|
9
|
+
*/
|
|
10
|
+
export function getAssignedAtomCounts(
|
|
11
|
+
groups: GroupedDiaID[],
|
|
12
|
+
signalsByOclID: SignalsByOclID,
|
|
13
|
+
nucleus: string,
|
|
14
|
+
): AssignedAtomCounts {
|
|
15
|
+
let assigned = 0;
|
|
16
|
+
let total = 0;
|
|
17
|
+
const atomLabel = nucleus.replace(/^\d+/, '');
|
|
18
|
+
|
|
19
|
+
for (const group of groups) {
|
|
20
|
+
if (group.atomLabel !== atomLabel) continue;
|
|
21
|
+
|
|
22
|
+
// Count individual equivalent atoms (for example, 3 H in a methyl group),
|
|
23
|
+
// not one atom per group. The total is independent of observed signals.
|
|
24
|
+
total += group.atoms.length;
|
|
25
|
+
// A group counts once if assigned in any spectrum of this nucleus.
|
|
26
|
+
if (signalsByOclID.has(group.oclID)) {
|
|
27
|
+
assigned += group.atoms.length;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return { assigned, total };
|
|
32
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Range } from '@zakodium/nmr-types';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
AssignedSignal,
|
|
5
|
+
AssignmentSignals,
|
|
6
|
+
GetAssignmentSignalsOptions,
|
|
7
|
+
} from './types.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Build each spectrum's ranges for a row, keeping only the row's signals and
|
|
11
|
+
* write how many of the row's atoms each range is assigned to as its integration.
|
|
12
|
+
*/
|
|
13
|
+
export function getAssignmentSignals(
|
|
14
|
+
options: GetAssignmentSignalsOptions,
|
|
15
|
+
): AssignmentSignals[] {
|
|
16
|
+
const { row, groups, signalsByOclID, hydrogenIDsByParent } = options;
|
|
17
|
+
const atomCountByOclID = new Map(
|
|
18
|
+
groups.map(({ oclID, atoms }) => [oclID, atoms.length]),
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
// A signal appears under every group it is assigned to, so visiting the
|
|
22
|
+
// row's groups accumulates exactly the row's atoms for that signal.
|
|
23
|
+
const atomCounts = new Map<AssignedSignal, number>();
|
|
24
|
+
for (const oclID of [row.id, ...(hydrogenIDsByParent.get(row.id) ?? [])]) {
|
|
25
|
+
for (const entry of signalsByOclID.get(oclID) ?? []) {
|
|
26
|
+
const atomCount = atomCountByOclID.get(oclID) ?? 0;
|
|
27
|
+
atomCounts.set(entry, (atomCounts.get(entry) ?? 0) + atomCount);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const assignmentsBySpectrum = new Map<string, AssignmentSignals>();
|
|
32
|
+
const rowRangeBySource = new Map<Range, Range>();
|
|
33
|
+
for (const [{ spectrum, range, signal }, atomCount] of atomCounts) {
|
|
34
|
+
let assignment = assignmentsBySpectrum.get(spectrum.id);
|
|
35
|
+
if (!assignment) {
|
|
36
|
+
assignment = { spectrum, ranges: [] };
|
|
37
|
+
assignmentsBySpectrum.set(spectrum.id, assignment);
|
|
38
|
+
}
|
|
39
|
+
let rowRange = rowRangeBySource.get(range);
|
|
40
|
+
if (!rowRange) {
|
|
41
|
+
rowRange = {
|
|
42
|
+
...range,
|
|
43
|
+
signals: [],
|
|
44
|
+
integration: 0,
|
|
45
|
+
pubIntegral: undefined,
|
|
46
|
+
};
|
|
47
|
+
rowRangeBySource.set(range, rowRange);
|
|
48
|
+
assignment.ranges.push(rowRange);
|
|
49
|
+
}
|
|
50
|
+
rowRange.signals.push(signal);
|
|
51
|
+
rowRange.integration = (rowRange.integration ?? 0) + atomCount;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return Array.from(assignmentsBySpectrum.values());
|
|
55
|
+
}
|
package/src/component/panels/assignment-summary/utilities/getLinkedCorrelationsByExperiment.ts
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import type { Spectrum } from '@zakodium/nmrium-core';
|
|
2
|
+
import { isSpectrum1D, isSpectrum2DFt } from '@zakodium/nmrium-core';
|
|
3
|
+
import type { TopicMolecule } from 'openchemlib-utils';
|
|
4
|
+
|
|
5
|
+
import { getCouplingLength } from '../../../2d/linked-signals/utilities/getCouplingLength.js';
|
|
6
|
+
import { sortAssignmentLabels } from '../../MoleculesPanel/utilities/sortAssignmentLabels.js';
|
|
7
|
+
|
|
8
|
+
import type { AssignmentListRow } from './atomGroupsToAssignmentRows.js';
|
|
9
|
+
|
|
10
|
+
export interface LinkedAssignment {
|
|
11
|
+
text: string;
|
|
12
|
+
coupling?: { distance: number; labels: string };
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type LinkedAssignmentsByOclID = Map<string, Map<string, LinkedAssignment>>;
|
|
16
|
+
|
|
17
|
+
function getOclIDsBySignalId(spectra: Spectrum[]): Map<string, string[]> {
|
|
18
|
+
const oclIDsBySignalId = new Map<string, string[]>();
|
|
19
|
+
|
|
20
|
+
for (const spectrum of spectra) {
|
|
21
|
+
if (!isSpectrum1D(spectrum)) continue;
|
|
22
|
+
|
|
23
|
+
for (const range of spectrum.ranges.values) {
|
|
24
|
+
for (const signal of range.signals) {
|
|
25
|
+
oclIDsBySignalId.set(signal.id, signal.diaIDs ?? []);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return oclIDsBySignalId;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getAtomLabel(topicMolecule: TopicMolecule, atom: number): string {
|
|
34
|
+
const molecule = topicMolecule.moleculeWithH;
|
|
35
|
+
const label = molecule.getAtomCustomLabel(atom);
|
|
36
|
+
const heavyAtomLabel =
|
|
37
|
+
molecule.getAtomicNo(atom) === 1
|
|
38
|
+
? molecule.getAtomCustomLabel(molecule.getConnAtom(atom, 0))
|
|
39
|
+
: undefined;
|
|
40
|
+
return (label || heavyAtomLabel || '').replace(/^\]/, '').trim();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function getShortestAssignment(
|
|
44
|
+
topicMolecule: TopicMolecule,
|
|
45
|
+
xOclIDs: string[],
|
|
46
|
+
yOclIDs: string[],
|
|
47
|
+
): ResolvedLinkAssignment | null {
|
|
48
|
+
const distance = getCouplingLength(
|
|
49
|
+
{ selected: topicMolecule },
|
|
50
|
+
xOclIDs,
|
|
51
|
+
yOclIDs,
|
|
52
|
+
);
|
|
53
|
+
if (!distance) return null;
|
|
54
|
+
|
|
55
|
+
const groups = topicMolecule.getDiaIDsObject();
|
|
56
|
+
const matrix = topicMolecule.distanceMatrix;
|
|
57
|
+
for (const xDiaID of xOclIDs) {
|
|
58
|
+
for (const yDiaID of yOclIDs) {
|
|
59
|
+
for (const xAtom of groups[xDiaID]?.atoms ?? []) {
|
|
60
|
+
for (const yAtom of groups[yDiaID]?.atoms ?? []) {
|
|
61
|
+
if (matrix[xAtom][yAtom] !== distance) continue;
|
|
62
|
+
|
|
63
|
+
const xLabel = getAtomLabel(topicMolecule, xAtom);
|
|
64
|
+
const yLabel = getAtomLabel(topicMolecule, yAtom);
|
|
65
|
+
if (!xLabel || !yLabel) return null;
|
|
66
|
+
const labels = `${xLabel} - ${yLabel}`;
|
|
67
|
+
return {
|
|
68
|
+
oclIDs: [xDiaID, yDiaID],
|
|
69
|
+
assignment: {
|
|
70
|
+
text: `${distance}J${labels}`,
|
|
71
|
+
coupling: { distance, labels },
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
interface ResolvedLinkAssignment {
|
|
82
|
+
oclIDs: string[];
|
|
83
|
+
assignment: LinkedAssignment;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Decide what a single 2D link contributes to the summary:
|
|
88
|
+
* the shortest coupling path when the molecule provides one,
|
|
89
|
+
* otherwise the label saved on the link.
|
|
90
|
+
*/
|
|
91
|
+
function resolveLinkAssignment(
|
|
92
|
+
topicMolecule: TopicMolecule,
|
|
93
|
+
link: { xOclIDs: string[]; yOclIDs: string[]; assignment?: string },
|
|
94
|
+
): ResolvedLinkAssignment | null {
|
|
95
|
+
const { xOclIDs, yOclIDs, assignment } = link;
|
|
96
|
+
const shortest = getShortestAssignment(topicMolecule, xOclIDs, yOclIDs);
|
|
97
|
+
if (shortest) return shortest;
|
|
98
|
+
|
|
99
|
+
if (!assignment) return null;
|
|
100
|
+
|
|
101
|
+
return { oclIDs: [...xOclIDs, ...yOclIDs], assignment: { text: assignment } };
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Group 2D correlations by experiment and the selected molecule's atom groups.
|
|
106
|
+
*/
|
|
107
|
+
export function getLinkedCorrelationsByExperiment(
|
|
108
|
+
spectra: Spectrum[],
|
|
109
|
+
topicMolecule: TopicMolecule,
|
|
110
|
+
): Map<string, LinkedAssignmentsByOclID> {
|
|
111
|
+
const oclIDsBySignalId = getOclIDsBySignalId(spectra);
|
|
112
|
+
const assignmentsByExperiment = new Map<string, LinkedAssignmentsByOclID>();
|
|
113
|
+
|
|
114
|
+
for (const spectrum of spectra) {
|
|
115
|
+
if (!isSpectrum2DFt(spectrum)) continue;
|
|
116
|
+
|
|
117
|
+
const experiment = spectrum.info.experiment?.toUpperCase() || '2D';
|
|
118
|
+
let assignmentsByOclID = assignmentsByExperiment.get(experiment);
|
|
119
|
+
if (!assignmentsByOclID) {
|
|
120
|
+
assignmentsByOclID = new Map();
|
|
121
|
+
assignmentsByExperiment.set(experiment, assignmentsByOclID);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
for (const link of spectrum.linkedSignals ?? []) {
|
|
125
|
+
const resolved = resolveLinkAssignment(topicMolecule, {
|
|
126
|
+
xOclIDs: oclIDsBySignalId.get(link.xSignalId) ?? [],
|
|
127
|
+
yOclIDs: oclIDsBySignalId.get(link.ySignalId) ?? [],
|
|
128
|
+
assignment: link.assignment,
|
|
129
|
+
});
|
|
130
|
+
if (!resolved) continue;
|
|
131
|
+
addAssignmentToAtoms(
|
|
132
|
+
assignmentsByOclID,
|
|
133
|
+
resolved.oclIDs,
|
|
134
|
+
resolved.assignment,
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return assignmentsByExperiment;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function addAssignmentToAtoms(
|
|
143
|
+
assignmentsByOclID: LinkedAssignmentsByOclID,
|
|
144
|
+
oclIDs: string[],
|
|
145
|
+
assignment: LinkedAssignment,
|
|
146
|
+
) {
|
|
147
|
+
for (const oclID of oclIDs) {
|
|
148
|
+
let assignments = assignmentsByOclID.get(oclID);
|
|
149
|
+
if (!assignments) {
|
|
150
|
+
assignments = new Map();
|
|
151
|
+
assignmentsByOclID.set(oclID, assignments);
|
|
152
|
+
}
|
|
153
|
+
assignments.set(assignment.text, assignment);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export function formatLinkedCorrelations(
|
|
158
|
+
row: AssignmentListRow,
|
|
159
|
+
assignmentsByOclID: LinkedAssignmentsByOclID,
|
|
160
|
+
hydrogenIDsByParent: Map<string, string[]>,
|
|
161
|
+
): LinkedAssignment[] {
|
|
162
|
+
const oclIDs = [row.id, ...(hydrogenIDsByParent.get(row.id) ?? [])];
|
|
163
|
+
const assignments = new Map<string, LinkedAssignment>();
|
|
164
|
+
|
|
165
|
+
for (const oclID of oclIDs) {
|
|
166
|
+
for (const [text, assignment] of assignmentsByOclID.get(oclID) ?? []) {
|
|
167
|
+
assignments.set(text, assignment);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
const assignmentKeys = Array.from(assignments.keys());
|
|
171
|
+
return sortAssignmentLabels(assignmentKeys).flatMap((text) => {
|
|
172
|
+
const assignment = assignments.get(text);
|
|
173
|
+
return assignment ? [assignment] : [];
|
|
174
|
+
});
|
|
175
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Spectrum } from '@zakodium/nmrium-core';
|
|
2
|
+
import { isSpectrum1D } from '@zakodium/nmrium-core';
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
AssignedSignal,
|
|
6
|
+
AssignmentSpectrum,
|
|
7
|
+
SignalsByNucleus,
|
|
8
|
+
} from './types.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Build a nucleus to oclIDs lookup of assigned 1D signals.
|
|
12
|
+
*
|
|
13
|
+
* @returns A map containing an OCL ID lookup for each 1D nucleus, including
|
|
14
|
+
* nuclei without assignments so their columns remain visible.
|
|
15
|
+
* Only the spectrum ID, nucleus, and frequency are retained in a shared metadata
|
|
16
|
+
* object.
|
|
17
|
+
*
|
|
18
|
+
* Notes:
|
|
19
|
+
* 1. Unassigned signals are omitted.
|
|
20
|
+
* 2. Repeated IDs within a signal occur once.
|
|
21
|
+
*/
|
|
22
|
+
export function getSignalsByNucleus(spectra: Spectrum[]): SignalsByNucleus {
|
|
23
|
+
const signalsByNucleus = new Map<string, Map<string, AssignedSignal[]>>();
|
|
24
|
+
for (const spectrum of spectra) {
|
|
25
|
+
if (!isSpectrum1D(spectrum)) continue;
|
|
26
|
+
|
|
27
|
+
// Share one atom-group lookup across all 1D spectra of the same nucleus.
|
|
28
|
+
// Create it even without assignments so the nucleus column stays visible.
|
|
29
|
+
const nucleus = spectrum.info.nucleus;
|
|
30
|
+
let signalsByOclID = signalsByNucleus.get(nucleus);
|
|
31
|
+
|
|
32
|
+
if (!signalsByOclID) {
|
|
33
|
+
signalsByOclID = new Map();
|
|
34
|
+
signalsByNucleus.set(nucleus, signalsByOclID);
|
|
35
|
+
}
|
|
36
|
+
// Keep each spectrum's frequency for formatting its own coupling values.
|
|
37
|
+
const assignmentSpectrum: AssignmentSpectrum = {
|
|
38
|
+
id: spectrum.id,
|
|
39
|
+
info: {
|
|
40
|
+
nucleus: spectrum.info.nucleus,
|
|
41
|
+
originFrequency: spectrum.info.originFrequency,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
for (const range of spectrum.ranges.values) {
|
|
45
|
+
for (const signal of range.signals) {
|
|
46
|
+
const entry = { spectrum: assignmentSpectrum, range, signal };
|
|
47
|
+
// Index a signal under every linked group, without repeating a link.
|
|
48
|
+
for (const oclID of new Set(signal.diaIDs)) {
|
|
49
|
+
const entries = signalsByOclID.get(oclID);
|
|
50
|
+
if (entries) {
|
|
51
|
+
entries.push(entry);
|
|
52
|
+
} else {
|
|
53
|
+
signalsByOclID.set(oclID, [entry]);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return signalsByNucleus;
|
|
60
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Range, Signal1D } from '@zakodium/nmr-types';
|
|
2
|
+
import type { ACSExportOptions, Spectrum1D } from '@zakodium/nmrium-core';
|
|
3
|
+
import type { GroupedDiaID } from 'openchemlib-utils';
|
|
4
|
+
|
|
5
|
+
import type { AssignmentListRow } from './atomGroupsToAssignmentRows.js';
|
|
6
|
+
|
|
7
|
+
export interface AssignmentSpectrum {
|
|
8
|
+
id: string;
|
|
9
|
+
info: Pick<Spectrum1D['info'], 'nucleus' | 'originFrequency'>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface AssignedSignal {
|
|
13
|
+
spectrum: AssignmentSpectrum;
|
|
14
|
+
range: Range;
|
|
15
|
+
signal: Signal1D;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type SignalsByOclID = Map<string, AssignedSignal[]>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Index signals by nucleus, then OCL ID, so each column can directly look up
|
|
22
|
+
* assignments across all spectra of its nucleus without filtering other nuclei.
|
|
23
|
+
* Entries retain spectrum metadata because ACS formatting needs its frequency.
|
|
24
|
+
*/
|
|
25
|
+
export type SignalsByNucleus = Map<string, SignalsByOclID>;
|
|
26
|
+
|
|
27
|
+
export interface AssignedAtomCounts {
|
|
28
|
+
assigned: number;
|
|
29
|
+
total: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface AssignmentSignals {
|
|
33
|
+
spectrum: AssignmentSpectrum;
|
|
34
|
+
ranges: Range[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface GetAssignmentSignalsOptions {
|
|
38
|
+
row: AssignmentListRow;
|
|
39
|
+
groups: GroupedDiaID[];
|
|
40
|
+
signalsByOclID: SignalsByOclID;
|
|
41
|
+
hydrogenIDsByParent: Map<string, string[]>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface FormatAssignmentOptions {
|
|
45
|
+
assignment: AssignmentSignals;
|
|
46
|
+
acs: ACSExportOptions;
|
|
47
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
checkMultiplicity,
|
|
3
2
|
findMultiplet,
|
|
3
|
+
isMultiplicityValid,
|
|
4
4
|
translateMultiplet,
|
|
5
5
|
} from 'nmr-processing';
|
|
6
6
|
|
|
@@ -17,7 +17,7 @@ function hasCouplingConstant(multiplet: string) {
|
|
|
17
17
|
multiplet = translateMultiplet(multiplet);
|
|
18
18
|
}
|
|
19
19
|
// with the pre-set rejected ones, we check the given multiplicity for the need of having a coupling constant (massive and singlet do not)
|
|
20
|
-
return
|
|
20
|
+
return isMultiplicityValid(multiplet, ['m', 's']);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function getPascal(n: number | undefined, spin: number) {
|
|
@@ -7,6 +7,12 @@ import { Button } from 'react-science/ui';
|
|
|
7
7
|
import type { UseLiveEdit } from './use_live_edit.ts';
|
|
8
8
|
|
|
9
9
|
interface OperatorEditBannerProps {
|
|
10
|
+
/**
|
|
11
|
+
* Content rendered at the leftmost position of the banner, before the
|
|
12
|
+
* live preview controls. Provided by the processing operator UI
|
|
13
|
+
* (second argument of the `children` render method).
|
|
14
|
+
*/
|
|
15
|
+
leftContent?: ReactNode;
|
|
10
16
|
isLiveEditable: boolean;
|
|
11
17
|
liveEdit: UseLiveEdit;
|
|
12
18
|
onClose: () => void;
|
|
@@ -14,10 +20,11 @@ interface OperatorEditBannerProps {
|
|
|
14
20
|
}
|
|
15
21
|
|
|
16
22
|
export function OperatorEditBanner(props: OperatorEditBannerProps) {
|
|
17
|
-
const { isLiveEditable, liveEdit, children, onClose } = props;
|
|
23
|
+
const { leftContent, isLiveEditable, liveEdit, children, onClose } = props;
|
|
18
24
|
|
|
19
25
|
return (
|
|
20
26
|
<LiveEditBanner>
|
|
27
|
+
{leftContent}
|
|
21
28
|
{isLiveEditable && (
|
|
22
29
|
<>
|
|
23
30
|
<Switch
|
|
@@ -125,9 +125,10 @@ export function ProcessingItem(props: ProcessingItemProps) {
|
|
|
125
125
|
);
|
|
126
126
|
}}
|
|
127
127
|
>
|
|
128
|
-
{(submitButton) =>
|
|
128
|
+
{(submitButton, leftContent) =>
|
|
129
129
|
!isEditable ? null : (
|
|
130
130
|
<OperatorEditBanner
|
|
131
|
+
leftContent={leftContent}
|
|
131
132
|
isLiveEditable={isLiveEditable ?? false}
|
|
132
133
|
liveEdit={liveEdit}
|
|
133
134
|
onClose={() => selectProcessingOperator(undefined)}
|
|
@@ -15,6 +15,7 @@ import { useToaster } from '../../context/ToasterContext.js';
|
|
|
15
15
|
import { NextPrev } from '../../elements/NextPrev.js';
|
|
16
16
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences.js';
|
|
17
17
|
import { useMoleculeEditor } from '../../modal/MoleculeStructureEditorModal.js';
|
|
18
|
+
import { usePredictionErrorHandler } from '../../modal/PredictionLimitModal.tsx';
|
|
18
19
|
import MoleculeHeader from '../MoleculesPanel/MoleculeHeader.js';
|
|
19
20
|
import MoleculePanelHeader from '../MoleculesPanel/MoleculePanelHeader.js';
|
|
20
21
|
import { TablePanel } from '../extra/BasicPanelStyle.js';
|
|
@@ -61,6 +62,8 @@ export default function PredictionPanel() {
|
|
|
61
62
|
const { open: openAccordionPanel } = useAccordionControls();
|
|
62
63
|
const predictionPreferences = usePanelPreferences('prediction');
|
|
63
64
|
const { modal, openMoleculeEditor } = useMoleculeEditor(true);
|
|
65
|
+
const { handlePredictionError, predictionLimitModal } =
|
|
66
|
+
usePredictionErrorHandler();
|
|
64
67
|
const refreshSliderRef = useRef<boolean>(true);
|
|
65
68
|
|
|
66
69
|
const [initialMolfile] = useState(molfile ?? '');
|
|
@@ -129,8 +132,8 @@ export default function PredictionPanel() {
|
|
|
129
132
|
},
|
|
130
133
|
});
|
|
131
134
|
openAccordionPanel('spectraPanel');
|
|
132
|
-
} catch (error:
|
|
133
|
-
|
|
135
|
+
} catch (error: unknown) {
|
|
136
|
+
handlePredictionError(error);
|
|
134
137
|
} finally {
|
|
135
138
|
hideLoading();
|
|
136
139
|
}
|
|
@@ -261,6 +264,7 @@ export default function PredictionPanel() {
|
|
|
261
264
|
</>
|
|
262
265
|
)}
|
|
263
266
|
{modal}
|
|
267
|
+
{predictionLimitModal}
|
|
264
268
|
</TablePanel>
|
|
265
269
|
);
|
|
266
270
|
}
|