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
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
|
-
import type {
|
|
3
|
-
Signal1D,
|
|
4
|
-
Signal2D,
|
|
5
|
-
Zone,
|
|
6
|
-
Zones as ZonesType,
|
|
7
|
-
} from '@zakodium/nmr-types';
|
|
2
|
+
import type { Signal2D, Zone, Zones as ZonesType } from '@zakodium/nmr-types';
|
|
8
3
|
import type { Spectrum1D, Spectrum2D } from '@zakodium/nmrium-core';
|
|
9
4
|
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
10
5
|
import { PiTextTSlash } from 'react-icons/pi';
|
|
@@ -16,15 +11,15 @@ import { useGlobal } from '../../context/GlobalContext.js';
|
|
|
16
11
|
import { useShareData } from '../../context/ShareDataContext.js';
|
|
17
12
|
import { SVGButton } from '../../elements/SVGButton.js';
|
|
18
13
|
import { SVGGroup } from '../../elements/SVGGroup.js';
|
|
19
|
-
import type { Position } from '../../elements/draggable/useDraggable.js';
|
|
20
14
|
import useDraggable from '../../elements/draggable/useDraggable.js';
|
|
21
15
|
import { useHighlight } from '../../highlight/index.js';
|
|
22
16
|
import { useActiveSpectrumZonesViewState } from '../../hooks/useActiveSpectrumZonesViewState.js';
|
|
23
17
|
import useSpectrum from '../../hooks/useSpectrum.js';
|
|
24
18
|
import type { GetTracesSpectraOptions } from '../useTracesSpectra.js';
|
|
25
19
|
import { getTracesSpectra } from '../useTracesSpectra.js';
|
|
26
|
-
import {
|
|
20
|
+
import { getClosestSignal } from '../utilities/extractSpectrumSignals.js';
|
|
27
21
|
import { useScale2DX, useScale2DY } from '../utilities/scale.js';
|
|
22
|
+
import { useAssignmentLabelLinkPath } from '../utilities/useAssignmentLabelLinkPath.js';
|
|
28
23
|
|
|
29
24
|
interface ZonesInnerProps {
|
|
30
25
|
zones: ZonesType;
|
|
@@ -39,174 +34,6 @@ const distance = 30;
|
|
|
39
34
|
const iconSize = 16;
|
|
40
35
|
const LabelBoxPadding = { left: 35, right: 0, top: 15, bottom: 15 };
|
|
41
36
|
|
|
42
|
-
interface TargetBoundary {
|
|
43
|
-
x1: number;
|
|
44
|
-
x2: number;
|
|
45
|
-
y1: number;
|
|
46
|
-
y2: number;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function getDistance(x1: number, y1: number, x2: number, y2: number) {
|
|
50
|
-
const deltaX = x2 - x1;
|
|
51
|
-
const deltaY = y2 - y1;
|
|
52
|
-
return Math.hypot(deltaX, deltaY);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function radiansToDegrees(radians: number) {
|
|
56
|
-
return radians * (180 / Math.PI);
|
|
57
|
-
}
|
|
58
|
-
function getAngleFromSides(a: number, b: number, c: number) {
|
|
59
|
-
const radians = Math.acos((b ** 2 + c ** 2 - a ** 2) / (2 * b * c));
|
|
60
|
-
return radiansToDegrees(radians);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
interface FindBestLinkResult {
|
|
64
|
-
sourcePoint: { a: Position; b: Position };
|
|
65
|
-
targetPoint: Position;
|
|
66
|
-
distance: number;
|
|
67
|
-
angle: number;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function findBestLink(
|
|
71
|
-
sourcePoints: Array<{ a: Position; b: Position }>,
|
|
72
|
-
targetPoints: Position[],
|
|
73
|
-
): FindBestLinkResult {
|
|
74
|
-
const result: FindBestLinkResult[] = [];
|
|
75
|
-
|
|
76
|
-
for (const sourcePoint of sourcePoints) {
|
|
77
|
-
const { a, b } = sourcePoint;
|
|
78
|
-
for (const targetPoint of targetPoints) {
|
|
79
|
-
const { x, y } = targetPoint;
|
|
80
|
-
const aLength = getDistance(a.x, a.y, x, y);
|
|
81
|
-
const bLength = getDistance(b.x, b.y, x, y);
|
|
82
|
-
const deltaLength = getDistance(a.x, a.y, b.x, b.y);
|
|
83
|
-
|
|
84
|
-
const distance = Math.min(aLength, bLength);
|
|
85
|
-
const angle = Number(
|
|
86
|
-
getAngleFromSides(deltaLength, aLength, bLength).toFixed(1),
|
|
87
|
-
);
|
|
88
|
-
|
|
89
|
-
result.push({ distance, angle, targetPoint, sourcePoint });
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
result.sort((a, b) => {
|
|
94
|
-
if (a.angle !== b.angle) {
|
|
95
|
-
return b.angle - a.angle;
|
|
96
|
-
}
|
|
97
|
-
return a.distance - b.distance;
|
|
98
|
-
});
|
|
99
|
-
return result[0];
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function useLinkPath(
|
|
103
|
-
currentPosition: Position,
|
|
104
|
-
targetBoundary: TargetBoundary,
|
|
105
|
-
sourceElementBoundary: Boundary,
|
|
106
|
-
options: { sideLength?: number; shift?: number } = {},
|
|
107
|
-
) {
|
|
108
|
-
const { sideLength = 6, shift = 5 } = options;
|
|
109
|
-
|
|
110
|
-
const { x1, x2, y1, y2 } = targetBoundary;
|
|
111
|
-
const { x, y } = currentPosition;
|
|
112
|
-
const scaleX = useScale2DX();
|
|
113
|
-
const scaleY = useScale2DY();
|
|
114
|
-
|
|
115
|
-
const { width, height } = sourceElementBoundary;
|
|
116
|
-
const centerX = width / 2;
|
|
117
|
-
const centerY = height / 2;
|
|
118
|
-
const leftX = x - centerX - shift;
|
|
119
|
-
const rightX = x + centerX + shift;
|
|
120
|
-
const topY = y - height;
|
|
121
|
-
const bottomY = y + shift;
|
|
122
|
-
|
|
123
|
-
const targetWidth = scaleX(x2) - scaleX(x1);
|
|
124
|
-
const targetHeight = scaleY(y2) - scaleY(y1);
|
|
125
|
-
const targetXCenter = scaleX(x1) + targetWidth / 2;
|
|
126
|
-
const targetYCenter = scaleY(y1) + targetHeight / 2;
|
|
127
|
-
|
|
128
|
-
const sourcePoints: Array<{ a: Position; b: Position }> = [
|
|
129
|
-
{
|
|
130
|
-
a: { x, y: bottomY },
|
|
131
|
-
b: { x: x + sideLength, y: bottomY },
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
a: { x, y: topY },
|
|
135
|
-
b: { x: x + sideLength, y: topY },
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
a: { x: leftX, y: y - centerY - sideLength / 2 },
|
|
139
|
-
b: { x: leftX, y: y - centerY + sideLength / 2 },
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
a: { x: rightX, y: y - centerY - sideLength / 2 },
|
|
143
|
-
b: { x: rightX, y: y - centerY + sideLength / 2 },
|
|
144
|
-
},
|
|
145
|
-
];
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Zone coordination
|
|
149
|
-
* xMid= x2-x1/2;
|
|
150
|
-
* yMid= y2-y1/2;
|
|
151
|
-
* (x1,y1) ---------- (xMid,y1) ---------- (x2,y1)
|
|
152
|
-
* | |
|
|
153
|
-
* | |
|
|
154
|
-
* (x1,yMid) (x2,yMid)
|
|
155
|
-
* | |
|
|
156
|
-
* | |
|
|
157
|
-
* (x1,y2) ---------- (xMid,y2) ---------- (x2,y2)
|
|
158
|
-
*
|
|
159
|
-
*/
|
|
160
|
-
|
|
161
|
-
const targetPoints: Position[] = [
|
|
162
|
-
{
|
|
163
|
-
//Left Top
|
|
164
|
-
x: scaleX(x1),
|
|
165
|
-
y: scaleY(y1),
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
//Center Top
|
|
169
|
-
x: targetXCenter,
|
|
170
|
-
y: scaleY(y1),
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
//Right Top
|
|
174
|
-
x: scaleX(x2),
|
|
175
|
-
y: scaleY(y1),
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
//Right Center
|
|
179
|
-
x: scaleX(x2),
|
|
180
|
-
y: targetYCenter,
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
//Right Bottom
|
|
184
|
-
x: scaleX(x2),
|
|
185
|
-
y: scaleY(y2),
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
//Center Bottom
|
|
189
|
-
x: targetXCenter,
|
|
190
|
-
y: scaleY(y2),
|
|
191
|
-
},
|
|
192
|
-
|
|
193
|
-
{
|
|
194
|
-
//Left Bottom
|
|
195
|
-
x: scaleX(x1),
|
|
196
|
-
y: scaleY(y2),
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
//Left Center
|
|
200
|
-
x: scaleX(x1),
|
|
201
|
-
y: targetYCenter,
|
|
202
|
-
},
|
|
203
|
-
];
|
|
204
|
-
|
|
205
|
-
const link = findBestLink(sourcePoints, targetPoints);
|
|
206
|
-
|
|
207
|
-
return `${link.sourcePoint.a.x},${link.sourcePoint.a.y} ${link.sourcePoint.b.x},${link.sourcePoint.b.y} ${link.targetPoint.x},${link.targetPoint.y}`;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
37
|
const GroupContainer = styled.g<{ isMoveActive: boolean }>(
|
|
211
38
|
({ isMoveActive }) =>
|
|
212
39
|
!isMoveActive
|
|
@@ -236,32 +63,12 @@ interface GetDefaultAssignmentOptions extends GetTracesSpectraOptions {
|
|
|
236
63
|
zone: Zone;
|
|
237
64
|
}
|
|
238
65
|
|
|
239
|
-
function findClosestAssignment(signals: Signal1D[], target: number) {
|
|
240
|
-
if (signals.length === 0) return '';
|
|
241
|
-
let closest = signals[0];
|
|
242
|
-
let minDiff = Math.abs(closest.delta - target);
|
|
243
|
-
|
|
244
|
-
for (let i = 1; i < signals.length; i++) {
|
|
245
|
-
const { delta } = signals[i];
|
|
246
|
-
const diff = Math.abs(delta - target);
|
|
247
|
-
if (diff < minDiff) {
|
|
248
|
-
closest = signals[i];
|
|
249
|
-
minDiff = diff;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
return closest.assignment || '';
|
|
254
|
-
}
|
|
255
|
-
|
|
256
66
|
function getAssignmentLabel(
|
|
257
67
|
spectrum: Spectrum1D | null,
|
|
258
68
|
options: { from: number; to: number; center: number },
|
|
259
69
|
) {
|
|
260
70
|
if (!spectrum) return null;
|
|
261
|
-
|
|
262
|
-
const signalList = extractSpectrumSignals(spectrum, { from, to });
|
|
263
|
-
signalList.sort((a, b) => a.delta - b.delta);
|
|
264
|
-
return findClosestAssignment(signalList, center);
|
|
71
|
+
return getClosestSignal(spectrum, options)?.assignment || '';
|
|
265
72
|
}
|
|
266
73
|
|
|
267
74
|
function getDefaultAssignmentLabel(options: GetDefaultAssignmentOptions) {
|
|
@@ -401,7 +208,7 @@ function AssignmentLabel(props: AssignmentLabelProps) {
|
|
|
401
208
|
},
|
|
402
209
|
parentElement: viewerRef,
|
|
403
210
|
});
|
|
404
|
-
const path =
|
|
211
|
+
const path = useAssignmentLabelLinkPath(
|
|
405
212
|
currentPosition,
|
|
406
213
|
{ x1: x.to, x2: x.from, y1: y.from, y2: y.to },
|
|
407
214
|
labelBoundary,
|
|
@@ -28,6 +28,8 @@ import type {
|
|
|
28
28
|
MouseButton,
|
|
29
29
|
Position,
|
|
30
30
|
} from './brush_tracker.types.ts';
|
|
31
|
+
import type { DragGestureController } from './brush_tracker_drag_gesture.ts';
|
|
32
|
+
import { createDragGesture } from './brush_tracker_drag_gesture.ts';
|
|
31
33
|
import type { BrushTrackerEventEmitter } from './brush_tracker_events_listeners.ts';
|
|
32
34
|
import {
|
|
33
35
|
BrushTrackerEventEmitterContext,
|
|
@@ -83,6 +85,15 @@ export function useBrushTracker() {
|
|
|
83
85
|
function isSelfControlledTarget(target: EventTarget) {
|
|
84
86
|
return (target as Element).closest('[data-self-control="true"]') !== null;
|
|
85
87
|
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Minimal pointer travel in px between pointerdown and pointerup for the
|
|
91
|
+
* gesture to be considered a drag. Pointer jitter below this threshold
|
|
92
|
+
* (hand tremor, trackpad imprecision) still counts as a click.
|
|
93
|
+
* Keep it in sync with the consumer drag threshold
|
|
94
|
+
* (`ProcessingOperatorUI.ChartBrushTracker` dragThreshold).
|
|
95
|
+
*/
|
|
96
|
+
const dragDetectionThreshold = 4;
|
|
86
97
|
function getMouseXY(event: MouseEvent, currentTarget?: Element) {
|
|
87
98
|
const boundingRect = (
|
|
88
99
|
currentTarget ?? event.currentTarget
|
|
@@ -112,8 +123,16 @@ export function BrushTracker(options: BrushTrackerProps) {
|
|
|
112
123
|
const lastRef = useRef<Position>({ x: 0, y: 0 });
|
|
113
124
|
const isSelfControlledRef = useRef(false);
|
|
114
125
|
|
|
115
|
-
const {
|
|
116
|
-
|
|
126
|
+
const {
|
|
127
|
+
onClick,
|
|
128
|
+
onDoubleClick,
|
|
129
|
+
onBrush,
|
|
130
|
+
onBrushEnd,
|
|
131
|
+
onZoom,
|
|
132
|
+
onDrag,
|
|
133
|
+
onDragEnd,
|
|
134
|
+
emitter,
|
|
135
|
+
} = useWrappedEvents(options);
|
|
117
136
|
|
|
118
137
|
const handleClickWithDebounce = useCallback(
|
|
119
138
|
(event: MouseEvent, currentTarget: Element) => {
|
|
@@ -179,6 +198,8 @@ export function BrushTracker(options: BrushTrackerProps) {
|
|
|
179
198
|
|
|
180
199
|
isDraggingRef.current = false; // Reset dragging flag
|
|
181
200
|
|
|
201
|
+
let dragGesture: DragGestureController | null = null;
|
|
202
|
+
|
|
182
203
|
//check that the right or left mouse button pressed
|
|
183
204
|
if ([0, 2].includes(event.button)) {
|
|
184
205
|
if (noPropagation) {
|
|
@@ -193,6 +214,14 @@ export function BrushTracker(options: BrushTrackerProps) {
|
|
|
193
214
|
};
|
|
194
215
|
lastRef.current = { x: 0, y: 0 };
|
|
195
216
|
|
|
217
|
+
dragGesture = createDragGesture({
|
|
218
|
+
mouseButton: MouseButtons[event.button],
|
|
219
|
+
startX: startPositionRef.current.x,
|
|
220
|
+
startY: startPositionRef.current.y,
|
|
221
|
+
rectX: boundingRect.x,
|
|
222
|
+
rectY: boundingRect.y,
|
|
223
|
+
});
|
|
224
|
+
|
|
196
225
|
if (!event.ctrlKey) {
|
|
197
226
|
dispatch({
|
|
198
227
|
type: 'DOWN',
|
|
@@ -211,16 +240,31 @@ export function BrushTracker(options: BrushTrackerProps) {
|
|
|
211
240
|
}
|
|
212
241
|
|
|
213
242
|
function moveCallback(event: globalThis.PointerEvent) {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
243
|
+
const { clientX, clientY } = event;
|
|
244
|
+
|
|
245
|
+
// Only a real pointer travel marks the gesture as a drag: pointer
|
|
246
|
+
// jitter must not suppress the click event dispatched on pointerup.
|
|
247
|
+
// Both positions must be compared in the same coordinate system:
|
|
248
|
+
// `clientX` is viewport-relative while `startPositionRef` is
|
|
249
|
+
// relative to the chart container, so the container offset must
|
|
250
|
+
// be removed before comparing, otherwise the layout offset itself
|
|
251
|
+
// counts as pointer travel. The same threshold also gates the
|
|
252
|
+
// `MOVE` dispatch, so pointer jitter neither shows the brush
|
|
253
|
+
// banner nor updates the brush range while clicking (e.g. adding
|
|
254
|
+
// anchors).
|
|
255
|
+
const boundingRect = boundingRectRef.current;
|
|
256
|
+
const isPointerTravel =
|
|
257
|
+
boundingRect &&
|
|
258
|
+
Math.hypot(
|
|
259
|
+
clientX - boundingRect.x - startPositionRef.current.x,
|
|
260
|
+
clientY - boundingRect.y - startPositionRef.current.y,
|
|
261
|
+
) > dragDetectionThreshold;
|
|
262
|
+
|
|
263
|
+
if (isPointerTravel) {
|
|
264
|
+
isDraggingRef.current = true;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const { screenX, screenY, shiftKey, altKey, ctrlKey } = event;
|
|
224
268
|
|
|
225
269
|
if (ctrlKey) {
|
|
226
270
|
if (boundingRectRef.current) {
|
|
@@ -248,19 +292,31 @@ export function BrushTracker(options: BrushTrackerProps) {
|
|
|
248
292
|
lastRef.current = { x, y };
|
|
249
293
|
}
|
|
250
294
|
} else {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
295
|
+
const dragEvent = dragGesture?.move(event);
|
|
296
|
+
if (dragEvent) {
|
|
297
|
+
onDrag(dragEvent);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
if (!dragEvent?.isPropagationStopped() && isPointerTravel) {
|
|
301
|
+
dispatch({
|
|
302
|
+
type: 'MOVE',
|
|
303
|
+
payload: {
|
|
304
|
+
screenX,
|
|
305
|
+
screenY,
|
|
306
|
+
clientX,
|
|
307
|
+
clientY,
|
|
308
|
+
},
|
|
309
|
+
});
|
|
310
|
+
}
|
|
260
311
|
}
|
|
261
312
|
}
|
|
262
313
|
|
|
263
|
-
function upCallback() {
|
|
314
|
+
function upCallback(pointerUpEvent: globalThis.PointerEvent) {
|
|
315
|
+
const dragEndEvent = dragGesture?.end(pointerUpEvent);
|
|
316
|
+
if (dragEndEvent) {
|
|
317
|
+
onDragEnd(dragEndEvent);
|
|
318
|
+
}
|
|
319
|
+
|
|
264
320
|
if (isDraggingRef.current) {
|
|
265
321
|
dispatch({
|
|
266
322
|
type: 'UP',
|
|
@@ -283,7 +339,14 @@ export function BrushTracker(options: BrushTrackerProps) {
|
|
|
283
339
|
|
|
284
340
|
return false;
|
|
285
341
|
},
|
|
286
|
-
[
|
|
342
|
+
[
|
|
343
|
+
clickTriggerMode,
|
|
344
|
+
handleClickWithDebounce,
|
|
345
|
+
noPropagation,
|
|
346
|
+
onDrag,
|
|
347
|
+
onDragEnd,
|
|
348
|
+
onZoom,
|
|
349
|
+
],
|
|
287
350
|
);
|
|
288
351
|
|
|
289
352
|
const handleMouseWheel = useCallback(
|
|
@@ -590,7 +653,13 @@ export function detectBrushing(
|
|
|
590
653
|
|
|
591
654
|
type UseWrappedEventsProps = Pick<
|
|
592
655
|
BrushTrackerProps,
|
|
593
|
-
|
|
656
|
+
| 'onBrush'
|
|
657
|
+
| 'onBrushEnd'
|
|
658
|
+
| 'onClick'
|
|
659
|
+
| 'onDoubleClick'
|
|
660
|
+
| 'onZoom'
|
|
661
|
+
| 'onDrag'
|
|
662
|
+
| 'onDragEnd'
|
|
594
663
|
>;
|
|
595
664
|
|
|
596
665
|
interface UseWrappedEvents extends Required<UseWrappedEventsProps> {
|
|
@@ -610,6 +679,8 @@ function useWrappedEvents(props: UseWrappedEventsProps): UseWrappedEvents {
|
|
|
610
679
|
onZoom: onZoomProp = noop,
|
|
611
680
|
onDoubleClick: onDoubleClickProp = noop,
|
|
612
681
|
onClick: onClickProp = noop,
|
|
682
|
+
onDrag: onDragProp = noop,
|
|
683
|
+
onDragEnd: onDragEndProp = noop,
|
|
613
684
|
} = props;
|
|
614
685
|
const emitter = useInitBrushTrackerEventEmitter();
|
|
615
686
|
|
|
@@ -680,5 +751,44 @@ function useWrappedEvents(props: UseWrappedEventsProps): UseWrappedEvents {
|
|
|
680
751
|
},
|
|
681
752
|
);
|
|
682
753
|
|
|
683
|
-
|
|
754
|
+
const onDrag = useEventCallback<Parameters<typeof onDragProp>, void>(
|
|
755
|
+
(event) => {
|
|
756
|
+
try {
|
|
757
|
+
emitter.emit('drag', event);
|
|
758
|
+
} catch (error) {
|
|
759
|
+
reportError(error);
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
if (event.isPropagationStopped()) return;
|
|
763
|
+
if (event.isDefaultPrevented()) return;
|
|
764
|
+
|
|
765
|
+
onDragProp(event);
|
|
766
|
+
},
|
|
767
|
+
);
|
|
768
|
+
|
|
769
|
+
const onDragEnd = useEventCallback<Parameters<typeof onDragEndProp>, void>(
|
|
770
|
+
(event) => {
|
|
771
|
+
try {
|
|
772
|
+
emitter.emit('drag-end', event);
|
|
773
|
+
} catch (error) {
|
|
774
|
+
reportError(error);
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
if (event.isPropagationStopped()) return;
|
|
778
|
+
if (event.isDefaultPrevented()) return;
|
|
779
|
+
|
|
780
|
+
onDragEndProp(event);
|
|
781
|
+
},
|
|
782
|
+
);
|
|
783
|
+
|
|
784
|
+
return {
|
|
785
|
+
onClick,
|
|
786
|
+
onDoubleClick,
|
|
787
|
+
onBrush,
|
|
788
|
+
onBrushEnd,
|
|
789
|
+
onZoom,
|
|
790
|
+
onDrag,
|
|
791
|
+
onDragEnd,
|
|
792
|
+
emitter,
|
|
793
|
+
};
|
|
684
794
|
}
|
|
@@ -49,6 +49,47 @@ export type OnZoom = (options: ZoomOptions) => void;
|
|
|
49
49
|
export type OnBrush = (state: BrushTrackerData) => void;
|
|
50
50
|
type OnBrushEnd = OnBrush;
|
|
51
51
|
|
|
52
|
+
interface DragCoordination {
|
|
53
|
+
/**
|
|
54
|
+
x coordinate relative to the chart container
|
|
55
|
+
*/
|
|
56
|
+
x: number;
|
|
57
|
+
/**
|
|
58
|
+
y coordinate relative to the chart container
|
|
59
|
+
*/
|
|
60
|
+
y: number;
|
|
61
|
+
/**
|
|
62
|
+
x coordinate relative to the chart container at pointerdown
|
|
63
|
+
*/
|
|
64
|
+
startX: number;
|
|
65
|
+
/**
|
|
66
|
+
y coordinate relative to the chart container at pointerdown
|
|
67
|
+
*/
|
|
68
|
+
startY: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface DragTrackerEvent extends DragCoordination {
|
|
72
|
+
/**
|
|
73
|
+
Native pointer event that triggered this event
|
|
74
|
+
*/
|
|
75
|
+
domEvent: globalThis.PointerEvent;
|
|
76
|
+
mouseButton: MouseButton;
|
|
77
|
+
shiftKey: boolean;
|
|
78
|
+
altKey: boolean;
|
|
79
|
+
ctrlKey: boolean;
|
|
80
|
+
isDefaultPrevented(): boolean;
|
|
81
|
+
isPropagationStopped(): boolean;
|
|
82
|
+
preventDefault(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Claim the current gesture as a drag.
|
|
85
|
+
* Prevents the default brush behavior for the rest of the gesture.
|
|
86
|
+
*/
|
|
87
|
+
stopPropagation(): void;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
type OnDrag = (event: DragTrackerEvent) => void;
|
|
91
|
+
type OnDragEnd = OnDrag;
|
|
92
|
+
|
|
52
93
|
export type BaseDetectBrushingOptions = AdvanceOmit<
|
|
53
94
|
DetectBrushingOptions,
|
|
54
95
|
'width' | 'height'
|
|
@@ -60,6 +101,8 @@ export interface BrushTrackerProps {
|
|
|
60
101
|
style?: CSSProperties;
|
|
61
102
|
onBrushEnd?: OnBrushEnd;
|
|
62
103
|
onBrush?: OnBrush;
|
|
104
|
+
onDrag?: OnDrag;
|
|
105
|
+
onDragEnd?: OnDragEnd;
|
|
63
106
|
onZoom?: OnZoom;
|
|
64
107
|
onDoubleClick?: OnDoubleClick;
|
|
65
108
|
onClick?: OnClick;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { DragTrackerEvent, MouseButton } from './brush_tracker.types.ts';
|
|
2
|
+
|
|
3
|
+
export interface DragGestureOptions {
|
|
4
|
+
mouseButton: MouseButton;
|
|
5
|
+
/**
|
|
6
|
+
x coordinate of the pointerdown relative to the chart container.
|
|
7
|
+
*/
|
|
8
|
+
startX: number;
|
|
9
|
+
/**
|
|
10
|
+
y coordinate of the pointerdown relative to the chart container.
|
|
11
|
+
*/
|
|
12
|
+
startY: number;
|
|
13
|
+
/**
|
|
14
|
+
x of the chart container bounding rect origin.
|
|
15
|
+
*/
|
|
16
|
+
rectX: number;
|
|
17
|
+
/**
|
|
18
|
+
y of the chart container bounding rect origin.
|
|
19
|
+
*/
|
|
20
|
+
rectY: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface DragGestureController {
|
|
24
|
+
/**
|
|
25
|
+
* Create the drag event for a pointermove.
|
|
26
|
+
* The consumer decides via the event claim API (`stopPropagation`)
|
|
27
|
+
* whether the gesture takes precedence over the default brush behavior.
|
|
28
|
+
*/
|
|
29
|
+
move(pointerEvent: globalThis.PointerEvent): DragTrackerEvent;
|
|
30
|
+
/**
|
|
31
|
+
* Create the drag-end event for the pointerup,
|
|
32
|
+
* or `null` if no drag was emitted during the gesture.
|
|
33
|
+
*/
|
|
34
|
+
end(pointerEvent: globalThis.PointerEvent): DragTrackerEvent | null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Stateful factory for the drag events of a single pointer gesture.
|
|
39
|
+
*
|
|
40
|
+
* The claim state (`stopPropagation` / `preventDefault`) is shared by all
|
|
41
|
+
* the events of the gesture, so a consumer claiming the gesture on the
|
|
42
|
+
* first `drag` event keeps it claimed until `drag-end`.
|
|
43
|
+
*/
|
|
44
|
+
export function createDragGesture(
|
|
45
|
+
options: DragGestureOptions,
|
|
46
|
+
): DragGestureController {
|
|
47
|
+
const { mouseButton, startX, startY, rectX, rectY } = options;
|
|
48
|
+
let claimed = false;
|
|
49
|
+
let defaultPrevented = false;
|
|
50
|
+
let emitted = false;
|
|
51
|
+
|
|
52
|
+
function build(pointerEvent: globalThis.PointerEvent): DragTrackerEvent {
|
|
53
|
+
return {
|
|
54
|
+
x: pointerEvent.clientX - rectX,
|
|
55
|
+
y: pointerEvent.clientY - rectY,
|
|
56
|
+
startX,
|
|
57
|
+
startY,
|
|
58
|
+
domEvent: pointerEvent,
|
|
59
|
+
mouseButton,
|
|
60
|
+
shiftKey: pointerEvent.shiftKey,
|
|
61
|
+
altKey: pointerEvent.altKey,
|
|
62
|
+
ctrlKey: pointerEvent.ctrlKey,
|
|
63
|
+
isDefaultPrevented: () => defaultPrevented,
|
|
64
|
+
isPropagationStopped: () => claimed,
|
|
65
|
+
preventDefault: () => {
|
|
66
|
+
defaultPrevented = true;
|
|
67
|
+
},
|
|
68
|
+
stopPropagation: () => {
|
|
69
|
+
claimed = true;
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
move(pointerEvent) {
|
|
76
|
+
emitted = true;
|
|
77
|
+
return build(pointerEvent);
|
|
78
|
+
},
|
|
79
|
+
end(pointerEvent) {
|
|
80
|
+
if (!emitted) return null;
|
|
81
|
+
return build(pointerEvent);
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
@@ -3,7 +3,13 @@ import { EventEmitter } from 'eventemitter3';
|
|
|
3
3
|
import { createContext, use, useState } from 'react';
|
|
4
4
|
|
|
5
5
|
export type BrushTrackerEventEmitterSupportedEvents =
|
|
6
|
-
|
|
6
|
+
| 'click'
|
|
7
|
+
| 'click-double'
|
|
8
|
+
| 'zoom'
|
|
9
|
+
| 'brush'
|
|
10
|
+
| 'brush-end'
|
|
11
|
+
| 'drag'
|
|
12
|
+
| 'drag-end';
|
|
7
13
|
export type BrushTrackerEventEmitter =
|
|
8
14
|
EventEmitter<BrushTrackerEventEmitterSupportedEvents>;
|
|
9
15
|
|
|
@@ -8,6 +8,7 @@ import type { DomainActions } from '../reducer/actions/DomainActions.js';
|
|
|
8
8
|
import type { FiltersActions } from '../reducer/actions/FiltersActions.js';
|
|
9
9
|
import type { InsetsActions } from '../reducer/actions/InsetActions.js';
|
|
10
10
|
import type { IntegralsActions } from '../reducer/actions/IntegralsActions.js';
|
|
11
|
+
import type { LinkedSignalsActions } from '../reducer/actions/LinkedSignalsActions.js';
|
|
11
12
|
import type { LoadAction } from '../reducer/actions/LoadAction.js';
|
|
12
13
|
import type { MoleculeActions } from '../reducer/actions/MoleculeActions.js';
|
|
13
14
|
import type { PeaksActions } from '../reducer/actions/PeaksActions.js';
|
|
@@ -25,6 +26,7 @@ export type Action =
|
|
|
25
26
|
| SpectrumActions
|
|
26
27
|
| LoadAction
|
|
27
28
|
| IntegralsActions
|
|
29
|
+
| LinkedSignalsActions
|
|
28
30
|
| RangesActions
|
|
29
31
|
| DatabaseActions
|
|
30
32
|
| DimensionsActions
|
|
@@ -23,7 +23,7 @@ import { initializeContoursLevels } from '../../data/data2d/Spectrum2D/contours.
|
|
|
23
23
|
import type { LiveEdit, State } from '../reducer/Reducer.ts';
|
|
24
24
|
import { setDomain, setMode } from '../reducer/actions/DomainActions.ts';
|
|
25
25
|
import { updateView } from '../reducer/actions/FiltersActions.ts';
|
|
26
|
-
import {
|
|
26
|
+
import { restoreLastZoomUnlessDomainChanged } from '../reducer/helper/ZoomHistoryManager.ts';
|
|
27
27
|
import { getActiveSpectrum } from '../reducer/helper/getActiveSpectrum.ts';
|
|
28
28
|
|
|
29
29
|
import { useChartData } from './ChartContext.tsx';
|
|
@@ -207,6 +207,10 @@ export function useProcessingsMutationsAPI() {
|
|
|
207
207
|
const operation = spectrum.processings[operationIndex];
|
|
208
208
|
operation.enabled = !operation.enabled;
|
|
209
209
|
|
|
210
|
+
// `processSpectrum` mutates the spectrum in place, so capture the current
|
|
211
|
+
// FID/FT state before processing to detect a FID <-> FT transition.
|
|
212
|
+
const wasFt = spectrum.info.isFt;
|
|
213
|
+
|
|
210
214
|
resetSelectedTool();
|
|
211
215
|
await submit(spectrum, indexSpectrum, (draft, processedSpectrum) => {
|
|
212
216
|
if (isSpectrum2D(processedSpectrum) && processedSpectrum.info.isFt) {
|
|
@@ -216,7 +220,7 @@ export function useProcessingsMutationsAPI() {
|
|
|
216
220
|
|
|
217
221
|
setDomain(draft);
|
|
218
222
|
setMode(draft);
|
|
219
|
-
|
|
223
|
+
restoreLastZoomUnlessDomainChanged(draft, wasFt);
|
|
220
224
|
});
|
|
221
225
|
});
|
|
222
226
|
|