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,223 @@
|
|
|
1
|
+
import { Tag } from '@blueprintjs/core';
|
|
2
|
+
import styled from '@emotion/styled';
|
|
3
|
+
import type { GroupedDiaID } from 'openchemlib-utils';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
|
|
6
|
+
import { useChartData } from '../../context/ChartContext.js';
|
|
7
|
+
import { useTopicMolecule } from '../../context/TopicMoleculeContext.js';
|
|
8
|
+
import IsotopesViewer from '../../elements/IsotopesViewer.js';
|
|
9
|
+
import {
|
|
10
|
+
TanStackTable,
|
|
11
|
+
createTanStackColumnHelper,
|
|
12
|
+
} from '../../elements/tanstack_table/index.js';
|
|
13
|
+
|
|
14
|
+
import { AssignmentAtomCell } from './table-cells/AssignmentAtomCell.js';
|
|
15
|
+
import { AssignmentChemicalShiftCell } from './table-cells/AssignmentChemicalShiftCell.js';
|
|
16
|
+
import { AssignmentCorrelationCell } from './table-cells/AssignmentCorrelationCell.js';
|
|
17
|
+
import { AssignmentLabelCell } from './table-cells/AssignmentLabelCell.js';
|
|
18
|
+
import type { AssignmentListRow } from './utilities/atomGroupsToAssignmentRows.js';
|
|
19
|
+
import {
|
|
20
|
+
atomGroupsToAssignmentRows,
|
|
21
|
+
getHydrogenIDsByParent,
|
|
22
|
+
getVisibleAssignmentRows,
|
|
23
|
+
} from './utilities/atomGroupsToAssignmentRows.js';
|
|
24
|
+
import { getAssignedAtomCounts } from './utilities/getAssignedAtomCounts.js';
|
|
25
|
+
import {
|
|
26
|
+
formatLinkedCorrelations,
|
|
27
|
+
getLinkedCorrelationsByExperiment,
|
|
28
|
+
} from './utilities/getLinkedCorrelationsByExperiment.js';
|
|
29
|
+
import { getSignalsByNucleus } from './utilities/getSignalsByNucleus.js';
|
|
30
|
+
import type { SignalsByOclID } from './utilities/types.js';
|
|
31
|
+
|
|
32
|
+
interface MoleculeAssignmentTableProps {
|
|
33
|
+
groups: GroupedDiaID[];
|
|
34
|
+
moleculeId: string;
|
|
35
|
+
expandedGroups: Set<string>;
|
|
36
|
+
onToggleRow: (id: string) => void;
|
|
37
|
+
showAtomNumbers: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const columnHelper = createTanStackColumnHelper<AssignmentListRow>();
|
|
41
|
+
|
|
42
|
+
const SpectrumHeader = styled.div`
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
gap: 5px;
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
interface SpectrumColumnHeaderProps {
|
|
51
|
+
nucleus: string;
|
|
52
|
+
groups: GroupedDiaID[];
|
|
53
|
+
signalsByOclID: SignalsByOclID;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function SpectrumColumnHeader({
|
|
57
|
+
nucleus,
|
|
58
|
+
groups,
|
|
59
|
+
signalsByOclID,
|
|
60
|
+
}: SpectrumColumnHeaderProps) {
|
|
61
|
+
const counts = getAssignedAtomCounts(groups, signalsByOclID, nucleus);
|
|
62
|
+
const atomLabel = nucleus.replace(/^\d+/, '');
|
|
63
|
+
const tooltip = `${counts.assigned} of ${counts.total} ${atomLabel} atoms assigned.`;
|
|
64
|
+
// Green means every atom has an assignment link, not a verified assignment.
|
|
65
|
+
const isFullyAssigned = counts.total > 0 && counts.assigned === counts.total;
|
|
66
|
+
return (
|
|
67
|
+
<SpectrumHeader>
|
|
68
|
+
<IsotopesViewer value={nucleus} />
|
|
69
|
+
<Tag
|
|
70
|
+
minimal
|
|
71
|
+
intent={isFullyAssigned ? 'success' : 'danger'}
|
|
72
|
+
title={tooltip}
|
|
73
|
+
>
|
|
74
|
+
{counts.assigned}/{counts.total}
|
|
75
|
+
</Tag>
|
|
76
|
+
</SpectrumHeader>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function MoleculeAssignmentTable(props: MoleculeAssignmentTableProps) {
|
|
81
|
+
const { groups, moleculeId, expandedGroups, onToggleRow, showAtomNumbers } =
|
|
82
|
+
props;
|
|
83
|
+
const { data } = useChartData();
|
|
84
|
+
const topicMolecule = useTopicMolecule();
|
|
85
|
+
// Build once per data change.
|
|
86
|
+
// headers and cells share the same nucleus lookup.
|
|
87
|
+
const signalsByNucleus = useMemo(() => getSignalsByNucleus(data), [data]);
|
|
88
|
+
const linkedAssignmentsByExperiment = useMemo(
|
|
89
|
+
() =>
|
|
90
|
+
topicMolecule?.[moleculeId]
|
|
91
|
+
? getLinkedCorrelationsByExperiment(data, topicMolecule[moleculeId])
|
|
92
|
+
: new Map(),
|
|
93
|
+
[data, topicMolecule, moleculeId],
|
|
94
|
+
);
|
|
95
|
+
// Keep the complete hierarchy for assignments.
|
|
96
|
+
// Expansion Only hides rows.
|
|
97
|
+
const allRows = useMemo(
|
|
98
|
+
() => atomGroupsToAssignmentRows(groups, true),
|
|
99
|
+
[groups],
|
|
100
|
+
);
|
|
101
|
+
const hydrogenIDsByParent = useMemo(
|
|
102
|
+
() => getHydrogenIDsByParent(allRows),
|
|
103
|
+
[allRows],
|
|
104
|
+
);
|
|
105
|
+
const rows = useMemo(
|
|
106
|
+
() => getVisibleAssignmentRows(allRows, expandedGroups),
|
|
107
|
+
[allRows, expandedGroups],
|
|
108
|
+
);
|
|
109
|
+
const columns = useMemo(() => {
|
|
110
|
+
return columnHelper.columns([
|
|
111
|
+
{
|
|
112
|
+
header: 'Atom',
|
|
113
|
+
accessorKey: 'atomLabel',
|
|
114
|
+
meta: { style: { width: '50px' } },
|
|
115
|
+
enableSorting: false,
|
|
116
|
+
cell: ({ row }) => (
|
|
117
|
+
<AssignmentAtomCell row={row.original} onToggle={onToggleRow} />
|
|
118
|
+
),
|
|
119
|
+
},
|
|
120
|
+
...(showAtomNumbers
|
|
121
|
+
? columnHelper.columns([
|
|
122
|
+
{
|
|
123
|
+
header: 'Atom numbers',
|
|
124
|
+
accessorKey: 'atomNumbers',
|
|
125
|
+
enableSorting: false,
|
|
126
|
+
cell: ({ row }) => (
|
|
127
|
+
<AssignmentLabelCell
|
|
128
|
+
value={row.original.atomNumbers}
|
|
129
|
+
hydrogenValue={row.original.hydrogenAtomNumbers}
|
|
130
|
+
isExpanded={row.original.isExpanded}
|
|
131
|
+
/>
|
|
132
|
+
),
|
|
133
|
+
},
|
|
134
|
+
])
|
|
135
|
+
: []),
|
|
136
|
+
{
|
|
137
|
+
header: 'Atom labels',
|
|
138
|
+
accessorKey: 'atomLabels',
|
|
139
|
+
enableSorting: false,
|
|
140
|
+
cell: ({ row }) => (
|
|
141
|
+
<AssignmentLabelCell
|
|
142
|
+
value={row.original.atomLabels}
|
|
143
|
+
hydrogenValue={row.original.hydrogenAtomLabels}
|
|
144
|
+
isExpanded={row.original.isExpanded}
|
|
145
|
+
/>
|
|
146
|
+
),
|
|
147
|
+
},
|
|
148
|
+
// One column per nucleus, combining assignments from all of its spectra.
|
|
149
|
+
...Array.from(signalsByNucleus).flatMap(([nucleus, signalsByOclID]) =>
|
|
150
|
+
columnHelper.columns([
|
|
151
|
+
{
|
|
152
|
+
header: () => (
|
|
153
|
+
<SpectrumColumnHeader
|
|
154
|
+
nucleus={nucleus}
|
|
155
|
+
groups={groups}
|
|
156
|
+
signalsByOclID={signalsByOclID}
|
|
157
|
+
/>
|
|
158
|
+
),
|
|
159
|
+
id: nucleus,
|
|
160
|
+
enableSorting: false,
|
|
161
|
+
cell: ({ row }) => (
|
|
162
|
+
<AssignmentChemicalShiftCell
|
|
163
|
+
options={{
|
|
164
|
+
row: row.original,
|
|
165
|
+
groups,
|
|
166
|
+
hydrogenIDsByParent,
|
|
167
|
+
signalsByOclID,
|
|
168
|
+
}}
|
|
169
|
+
/>
|
|
170
|
+
),
|
|
171
|
+
},
|
|
172
|
+
]),
|
|
173
|
+
),
|
|
174
|
+
...Array.from(linkedAssignmentsByExperiment).flatMap(
|
|
175
|
+
([experiment, assignmentsByOclID]) =>
|
|
176
|
+
columnHelper.columns([
|
|
177
|
+
{
|
|
178
|
+
header: experiment,
|
|
179
|
+
id: experiment,
|
|
180
|
+
enableSorting: false,
|
|
181
|
+
cell: ({ row }) => (
|
|
182
|
+
<AssignmentCorrelationCell
|
|
183
|
+
assignments={formatLinkedCorrelations(
|
|
184
|
+
row.original,
|
|
185
|
+
assignmentsByOclID,
|
|
186
|
+
hydrogenIDsByParent,
|
|
187
|
+
)}
|
|
188
|
+
/>
|
|
189
|
+
),
|
|
190
|
+
},
|
|
191
|
+
]),
|
|
192
|
+
),
|
|
193
|
+
]);
|
|
194
|
+
}, [
|
|
195
|
+
groups,
|
|
196
|
+
onToggleRow,
|
|
197
|
+
showAtomNumbers,
|
|
198
|
+
signalsByNucleus,
|
|
199
|
+
linkedAssignmentsByExperiment,
|
|
200
|
+
hydrogenIDsByParent,
|
|
201
|
+
]);
|
|
202
|
+
|
|
203
|
+
function getHighlightIDs(row: AssignmentListRow): string[] {
|
|
204
|
+
return [row.id, ...(hydrogenIDsByParent.get(row.id) ?? [])];
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return (
|
|
208
|
+
<TanStackTable
|
|
209
|
+
data={rows}
|
|
210
|
+
columns={columns}
|
|
211
|
+
getHighlightIDs={getHighlightIDs}
|
|
212
|
+
highlightedSource="ASSIGNMENT_TABLE"
|
|
213
|
+
style={{ height: '100%' }}
|
|
214
|
+
rowStyle={({ original }) => ({
|
|
215
|
+
base: {
|
|
216
|
+
backgroundColor:
|
|
217
|
+
!original.isHydrogen && original.isExpanded ? '#f2f2f2' : 'white',
|
|
218
|
+
},
|
|
219
|
+
})}
|
|
220
|
+
emptyDataRowText="No atom groups to display"
|
|
221
|
+
/>
|
|
222
|
+
);
|
|
223
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Button } from '@blueprintjs/core';
|
|
2
|
+
import styled from '@emotion/styled';
|
|
3
|
+
|
|
4
|
+
import type { AssignmentListRow } from '../utilities/atomGroupsToAssignmentRows.js';
|
|
5
|
+
|
|
6
|
+
interface AssignmentAtomCellProps {
|
|
7
|
+
row: AssignmentListRow;
|
|
8
|
+
onToggle: (id: string) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const AtomCellContainer = styled.span`
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
export function AssignmentAtomCell({ row, onToggle }: AssignmentAtomCellProps) {
|
|
17
|
+
return (
|
|
18
|
+
<AtomCellContainer>
|
|
19
|
+
<Button
|
|
20
|
+
variant="minimal"
|
|
21
|
+
size="small"
|
|
22
|
+
icon={row.isExpanded ? 'chevron-down' : 'chevron-right'}
|
|
23
|
+
style={{
|
|
24
|
+
visibility: row.hasChildren ? 'visible' : 'hidden',
|
|
25
|
+
}}
|
|
26
|
+
onClick={(event) => {
|
|
27
|
+
event.stopPropagation();
|
|
28
|
+
onToggle(row.id);
|
|
29
|
+
}}
|
|
30
|
+
/>
|
|
31
|
+
<span style={{ paddingInlineStart: row.isHydrogen ? '0.5em' : 0 }}>
|
|
32
|
+
{row.atomLabel}
|
|
33
|
+
</span>
|
|
34
|
+
</AtomCellContainer>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
|
|
3
|
+
import { useACSSettings } from '../../../hooks/use_acs_settings.js';
|
|
4
|
+
import { formatAssignmentACS } from '../utilities/formatAssignmentACS.js';
|
|
5
|
+
import { formatAssignmentShifts } from '../utilities/formatAssignmentShifts.js';
|
|
6
|
+
import { getAssignmentSignals } from '../utilities/getAssignmentSignals.js';
|
|
7
|
+
import type {
|
|
8
|
+
AssignmentSignals,
|
|
9
|
+
GetAssignmentSignalsOptions,
|
|
10
|
+
} from '../utilities/types.js';
|
|
11
|
+
|
|
12
|
+
interface AssignmentShiftLineProps {
|
|
13
|
+
assignment: AssignmentSignals;
|
|
14
|
+
shiftsOnly: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function AssignmentShift(options: AssignmentShiftLineProps) {
|
|
18
|
+
const { assignment, shiftsOnly } = options;
|
|
19
|
+
const { spectrum } = assignment;
|
|
20
|
+
const acs = useACSSettings(spectrum.info.nucleus);
|
|
21
|
+
const value = shiftsOnly
|
|
22
|
+
? formatAssignmentShifts({ assignment, deltaFormat: acs.deltaFormat })
|
|
23
|
+
: formatAssignmentACS({ assignment, acs });
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<span>
|
|
27
|
+
{shiftsOnly ? (
|
|
28
|
+
<span>{value} ppm</span>
|
|
29
|
+
) : (
|
|
30
|
+
// eslint-disable-next-line @eslint-react/dom-no-dangerously-set-innerhtml
|
|
31
|
+
<span dangerouslySetInnerHTML={{ __html: value }} />
|
|
32
|
+
)}
|
|
33
|
+
</span>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface AssignmentChemicalShiftCellProps {
|
|
38
|
+
options: GetAssignmentSignalsOptions;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function AssignmentChemicalShiftCell(
|
|
42
|
+
props: AssignmentChemicalShiftCellProps,
|
|
43
|
+
) {
|
|
44
|
+
const { options } = props;
|
|
45
|
+
const assignments = getAssignmentSignals(options);
|
|
46
|
+
|
|
47
|
+
// Separate spectra's values with commas while retaining per-spectrum formatting.
|
|
48
|
+
return assignments.map((assignment, index) => (
|
|
49
|
+
<Fragment key={assignment.spectrum.id}>
|
|
50
|
+
{index > 0 && ', '}
|
|
51
|
+
<AssignmentShift
|
|
52
|
+
assignment={assignment}
|
|
53
|
+
shiftsOnly={options.row.isHydrogen}
|
|
54
|
+
/>
|
|
55
|
+
</Fragment>
|
|
56
|
+
));
|
|
57
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { LinkedAssignment } from '../utilities/getLinkedCorrelationsByExperiment.js';
|
|
2
|
+
|
|
3
|
+
interface AssignmentCorrelationCellProps {
|
|
4
|
+
assignments: LinkedAssignment[];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function AssignmentCorrelationCell({
|
|
8
|
+
assignments,
|
|
9
|
+
}: AssignmentCorrelationCellProps) {
|
|
10
|
+
return assignments.map((assignment, index) => (
|
|
11
|
+
<span key={assignment.text}>
|
|
12
|
+
{index > 0 && ', '}
|
|
13
|
+
{assignment.coupling ? (
|
|
14
|
+
<>
|
|
15
|
+
<sup>{assignment.coupling.distance}</sup>J
|
|
16
|
+
<sub>{assignment.coupling.labels}</sub>
|
|
17
|
+
</>
|
|
18
|
+
) : (
|
|
19
|
+
assignment.text
|
|
20
|
+
)}
|
|
21
|
+
</span>
|
|
22
|
+
));
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface AssignmentLabelCellProps {
|
|
2
|
+
value: string;
|
|
3
|
+
hydrogenValue: string;
|
|
4
|
+
isExpanded: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function AssignmentLabelCell(props: AssignmentLabelCellProps) {
|
|
8
|
+
return formatAssignmentLabel(props);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function formatAssignmentLabel(options: AssignmentLabelCellProps) {
|
|
12
|
+
const { value, hydrogenValue, isExpanded } = options;
|
|
13
|
+
if (isExpanded || !hydrogenValue) return value;
|
|
14
|
+
|
|
15
|
+
return value ? `${value} (${hydrogenValue})` : `(${hydrogenValue})`;
|
|
16
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import type { GroupedDiaID } from 'openchemlib-utils';
|
|
2
|
+
|
|
3
|
+
import { sortAssignmentLabels } from '../../MoleculesPanel/utilities/sortAssignmentLabels.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Controls which atoms show their attached hydrogens in the table.
|
|
7
|
+
* - `true`: show hydrogens beneath every atom group.
|
|
8
|
+
* - `false`: hide all hydrogen rows.
|
|
9
|
+
* - A set of group IDs: show hydrogens only beneath the selected groups.
|
|
10
|
+
* Hydrogens without a matching parent remain visible unless this is `false`.
|
|
11
|
+
*/
|
|
12
|
+
export type AssignmentExpansion = boolean | Set<string>;
|
|
13
|
+
|
|
14
|
+
export interface AssignmentListRow {
|
|
15
|
+
/**
|
|
16
|
+
* The atom group's oclID, used to look up signal assignments.
|
|
17
|
+
*/
|
|
18
|
+
id: string;
|
|
19
|
+
parentOclId?: string;
|
|
20
|
+
atomLabel: string;
|
|
21
|
+
atomNumbers: string;
|
|
22
|
+
atomLabels: string;
|
|
23
|
+
hydrogenAtomNumbers: string;
|
|
24
|
+
hydrogenAtomLabels: string;
|
|
25
|
+
isHydrogen: boolean;
|
|
26
|
+
hasChildren: boolean;
|
|
27
|
+
isExpanded: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface AssignmentRowOptions {
|
|
31
|
+
/**
|
|
32
|
+
* ID of the atom group this hydrogen row appears beneath.
|
|
33
|
+
*/
|
|
34
|
+
parentOclId?: string;
|
|
35
|
+
hasChildren?: boolean;
|
|
36
|
+
isExpanded?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Select visible rows from the complete hierarchy and update expansion flags.
|
|
41
|
+
* Rows with no parent or whose parent is expanded remain visible.
|
|
42
|
+
*/
|
|
43
|
+
export function getVisibleAssignmentRows(
|
|
44
|
+
allRows: AssignmentListRow[],
|
|
45
|
+
expandedGroups: Set<string>,
|
|
46
|
+
): AssignmentListRow[] {
|
|
47
|
+
const rows: AssignmentListRow[] = [];
|
|
48
|
+
for (const row of allRows) {
|
|
49
|
+
if (row.parentOclId !== undefined && !expandedGroups.has(row.parentOclId)) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
rows.push(
|
|
53
|
+
row.hasChildren
|
|
54
|
+
? { ...row, isExpanded: expandedGroups.has(row.id) }
|
|
55
|
+
: row,
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
return rows;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function getHydrogenIDsByParent(
|
|
62
|
+
rows: AssignmentListRow[],
|
|
63
|
+
): Map<string, string[]> {
|
|
64
|
+
const hydrogenIDsByParent = new Map<string, string[]>();
|
|
65
|
+
for (const row of rows) {
|
|
66
|
+
if (row.parentOclId === undefined) continue;
|
|
67
|
+
const hydrogenIDs = hydrogenIDsByParent.get(row.parentOclId);
|
|
68
|
+
if (hydrogenIDs) {
|
|
69
|
+
hydrogenIDs.push(row.id);
|
|
70
|
+
} else {
|
|
71
|
+
hydrogenIDsByParent.set(row.parentOclId, [row.id]);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return hydrogenIDsByParent;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface HydrogenPartition {
|
|
78
|
+
/**
|
|
79
|
+
* The attached hydrogen groups to display beneath each atom group.
|
|
80
|
+
*/
|
|
81
|
+
hydrogensByParentOclId: Map<string, GroupedDiaID[]>;
|
|
82
|
+
/**
|
|
83
|
+
* Hydrogen groups that could not be matched to an atom group.
|
|
84
|
+
*/
|
|
85
|
+
unattachedHydrogens: GroupedDiaID[];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function isHydrogenGroup(group: GroupedDiaID): boolean {
|
|
89
|
+
return group.atomLabel === 'H';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function compareByFirstAtomIndex(a: GroupedDiaID, b: GroupedDiaID): number {
|
|
93
|
+
// Keep groups in molecule order using the first atom number in each group.
|
|
94
|
+
return a.atoms[0] - b.atoms[0];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function compareNumbers(a: number, b: number): number {
|
|
98
|
+
return a - b;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function isGroupExpanded(
|
|
102
|
+
expansion: AssignmentExpansion,
|
|
103
|
+
parentOclId: string,
|
|
104
|
+
): boolean {
|
|
105
|
+
return typeof expansion === 'boolean'
|
|
106
|
+
? expansion
|
|
107
|
+
: expansion.has(parentOclId);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function toAssignmentRow(
|
|
111
|
+
group: GroupedDiaID,
|
|
112
|
+
options: AssignmentRowOptions = {},
|
|
113
|
+
): AssignmentListRow {
|
|
114
|
+
const { parentOclId, hasChildren = false, isExpanded = false } = options;
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
id: group.oclID,
|
|
118
|
+
parentOclId,
|
|
119
|
+
atomLabel: group.atomLabel,
|
|
120
|
+
atomNumbers: group.atoms.toSorted(compareNumbers).join(','),
|
|
121
|
+
atomLabels: sortAssignmentLabels(group.customLabels).join(','),
|
|
122
|
+
// The molecule already provides attached H values; keep them separate from the parent's.
|
|
123
|
+
hydrogenAtomNumbers: group.attachedHydrogens
|
|
124
|
+
.toSorted(compareNumbers)
|
|
125
|
+
.join(','),
|
|
126
|
+
hydrogenAtomLabels: sortAssignmentLabels(
|
|
127
|
+
group.attachedHydrogensCustomLabels,
|
|
128
|
+
).join(','),
|
|
129
|
+
isHydrogen: isHydrogenGroup(group),
|
|
130
|
+
hasChildren,
|
|
131
|
+
isExpanded,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Find which atom group each hydrogen group belongs beneath.
|
|
137
|
+
* A "heavy atom" means any atom other than hydrogen.
|
|
138
|
+
*
|
|
139
|
+
* Use the molecule's atom numbers to find attachments.
|
|
140
|
+
* First record the group containing each heavy atom, then use that record to place the hydrogens without repeated searches.
|
|
141
|
+
* Each heavy atom is expected to belong to only one group.
|
|
142
|
+
*/
|
|
143
|
+
function partitionHydrogenGroups(
|
|
144
|
+
heavyAtomGroups: GroupedDiaID[],
|
|
145
|
+
hydrogenGroups: GroupedDiaID[],
|
|
146
|
+
): HydrogenPartition {
|
|
147
|
+
const heavyGroupByAtomIndex = new Map<number, GroupedDiaID>();
|
|
148
|
+
for (const heavyGroup of heavyAtomGroups) {
|
|
149
|
+
for (const atomIndex of heavyGroup.atoms) {
|
|
150
|
+
heavyGroupByAtomIndex.set(atomIndex, heavyGroup);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const hydrogensByParentOclId = new Map<string, GroupedDiaID[]>();
|
|
155
|
+
const unattachedHydrogens: GroupedDiaID[] = [];
|
|
156
|
+
|
|
157
|
+
for (const hydrogenGroup of hydrogenGroups) {
|
|
158
|
+
// Several attached atoms may share one group; show its hydrogen row only once.
|
|
159
|
+
const parentGroups = new Set<GroupedDiaID>();
|
|
160
|
+
for (const heavyAtomIndex of hydrogenGroup.heavyAtoms) {
|
|
161
|
+
const parentGroup = heavyGroupByAtomIndex.get(heavyAtomIndex);
|
|
162
|
+
if (parentGroup) parentGroups.add(parentGroup);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (parentGroups.size === 0) {
|
|
166
|
+
unattachedHydrogens.push(hydrogenGroup);
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
for (const parentGroup of parentGroups) {
|
|
171
|
+
const siblings = hydrogensByParentOclId.get(parentGroup.oclID);
|
|
172
|
+
if (siblings) {
|
|
173
|
+
siblings.push(hydrogenGroup);
|
|
174
|
+
} else {
|
|
175
|
+
hydrogensByParentOclId.set(parentGroup.oclID, [hydrogenGroup]);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return { hydrogensByParentOclId, unattachedHydrogens };
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Prepare the rows shown in the assignment list.
|
|
185
|
+
*
|
|
186
|
+
* Input comes from `TopicMolecule.getGroupedDiastereotopicAtomIDs()`.
|
|
187
|
+
* Each group describes equivalent atoms that belong in the same table row:
|
|
188
|
+
* - `oclID`: the group's identifier.
|
|
189
|
+
* - `atomLabel`: the element symbol, such as C or H.
|
|
190
|
+
* - `atoms`: the atom numbers in this group, starting at zero.
|
|
191
|
+
* - `customLabels`: custom names assigned to these atoms, such as "3a".
|
|
192
|
+
* - `heavyAtoms`: for hydrogens, the numbers of the atoms they are attached to.
|
|
193
|
+
*
|
|
194
|
+
* The table lists each heavy-atom group, followed by its hydrogen groups when
|
|
195
|
+
* expanded. Parents retain their attached hydrogen values for collapsed cells.
|
|
196
|
+
* for example:
|
|
197
|
+
* Input: carbon c1 contains atom 0, carbon c2 contains atom 1, and hydrogen group h1 contains atoms 2, 3, 4 attached to atom 0.
|
|
198
|
+
* atomGroupsToAssignmentRows(groups, new Set(['c1']));
|
|
199
|
+
* Output table:
|
|
200
|
+
* Atom | Atom numbers
|
|
201
|
+
* C | 0
|
|
202
|
+
* H | 2,3,4
|
|
203
|
+
* C | 1
|
|
204
|
+
*/
|
|
205
|
+
export function atomGroupsToAssignmentRows(
|
|
206
|
+
groups: GroupedDiaID[],
|
|
207
|
+
expansion: AssignmentExpansion,
|
|
208
|
+
): AssignmentListRow[] {
|
|
209
|
+
// 1. Put groups in molecule order and separate hydrogens from other atoms.
|
|
210
|
+
const sortedGroups = groups.toSorted(compareByFirstAtomIndex);
|
|
211
|
+
const heavyAtomGroups = sortedGroups.filter(
|
|
212
|
+
(group) => !isHydrogenGroup(group),
|
|
213
|
+
);
|
|
214
|
+
const hydrogenGroups = sortedGroups.filter(isHydrogenGroup);
|
|
215
|
+
|
|
216
|
+
// 2. Find the parent groups for the hydrogens.
|
|
217
|
+
const { hydrogensByParentOclId, unattachedHydrogens } =
|
|
218
|
+
partitionHydrogenGroups(heavyAtomGroups, hydrogenGroups);
|
|
219
|
+
|
|
220
|
+
const rows: AssignmentListRow[] = [];
|
|
221
|
+
|
|
222
|
+
// 3. Add each parent, followed by its hydrogens if the row is expanded.
|
|
223
|
+
for (const parentGroup of heavyAtomGroups) {
|
|
224
|
+
const childHydrogens = hydrogensByParentOclId.get(parentGroup.oclID) ?? [];
|
|
225
|
+
const hasChildren = childHydrogens.length > 0;
|
|
226
|
+
const isExpanded =
|
|
227
|
+
hasChildren && isGroupExpanded(expansion, parentGroup.oclID);
|
|
228
|
+
|
|
229
|
+
rows.push(
|
|
230
|
+
toAssignmentRow(parentGroup, {
|
|
231
|
+
hasChildren,
|
|
232
|
+
isExpanded,
|
|
233
|
+
}),
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
if (isExpanded) {
|
|
237
|
+
for (const hydrogenGroup of childHydrogens) {
|
|
238
|
+
rows.push(
|
|
239
|
+
toAssignmentRow(hydrogenGroup, { parentOclId: parentGroup.oclID }),
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Currently this case is not exits but it is a fallback for any unattached hydrogens.
|
|
246
|
+
// 4. Keep unmatched hydrogens at the end so they are not lost from the list.
|
|
247
|
+
if (expansion !== false) {
|
|
248
|
+
for (const hydrogenGroup of unattachedHydrogens) {
|
|
249
|
+
rows.push(toAssignmentRow(hydrogenGroup));
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return rows;
|
|
254
|
+
}
|