nmrium 2.2.0 → 2.4.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/PredictionErrorsNotations.js +3 -3
- package/lib/component/1d/PredictionErrorsNotations.js.map +1 -1
- package/lib/component/1d/peaks/PeakEditionManager.d.ts +1 -1
- package/lib/component/1d/peaks/Peaks.d.ts.map +1 -1
- package/lib/component/1d/peaks/Peaks.js +2 -1
- package/lib/component/1d/peaks/Peaks.js.map +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts.map +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.js.map +1 -1
- package/lib/component/1d/ranges/AssignmentLabel.js +1 -1
- package/lib/component/1d/ranges/AssignmentLabel.js.map +1 -1
- package/lib/component/1d/ranges/FloatingRangeTablePreferencesModal.d.ts +9 -0
- package/lib/component/1d/ranges/FloatingRangeTablePreferencesModal.d.ts.map +1 -0
- package/lib/component/1d/ranges/FloatingRangeTablePreferencesModal.js +138 -0
- package/lib/component/1d/ranges/FloatingRangeTablePreferencesModal.js.map +1 -0
- package/lib/component/1d/ranges/FloatingRanges.d.ts.map +1 -0
- package/lib/component/1d/ranges/FloatingRanges.js +362 -0
- package/lib/component/1d/ranges/FloatingRanges.js.map +1 -0
- package/lib/component/1d/ranges/Ranges.js +2 -2
- package/lib/component/1d/ranges/Ranges.js.map +1 -1
- package/lib/component/1d-2d/FieldEdition.d.ts +2 -2
- package/lib/component/1d-2d/FieldEdition.d.ts.map +1 -1
- package/lib/component/1d-2d/FieldEdition.js +2 -2
- package/lib/component/1d-2d/FieldEdition.js.map +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +7 -7
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js.map +1 -1
- package/lib/component/1d-2d/tools/BrushXY.js +6 -6
- package/lib/component/1d-2d/tools/BrushXY.js.map +1 -1
- package/lib/component/2d/1d-tracer/Left1DChart.d.ts.map +1 -1
- package/lib/component/2d/1d-tracer/Left1DChart.js +6 -2
- package/lib/component/2d/1d-tracer/Left1DChart.js.map +1 -1
- package/lib/component/2d/1d-tracer/Ranges1D.d.ts +9 -0
- package/lib/component/2d/1d-tracer/Ranges1D.d.ts.map +1 -0
- package/lib/component/2d/1d-tracer/Ranges1D.js +76 -0
- package/lib/component/2d/1d-tracer/Ranges1D.js.map +1 -0
- package/lib/component/2d/1d-tracer/Signals1D.d.ts +11 -0
- package/lib/component/2d/1d-tracer/Signals1D.d.ts.map +1 -0
- package/lib/component/2d/1d-tracer/Signals1D.js +90 -0
- package/lib/component/2d/1d-tracer/Signals1D.js.map +1 -0
- package/lib/component/2d/1d-tracer/Top1DChart.d.ts.map +1 -1
- package/lib/component/2d/1d-tracer/Top1DChart.js +6 -2
- package/lib/component/2d/1d-tracer/Top1DChart.js.map +1 -1
- package/lib/component/2d/ft/FTContainer.d.ts.map +1 -1
- package/lib/component/2d/ft/FTContainer.js.map +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.js +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.js +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.js.map +1 -1
- package/lib/component/AnchorSVG.d.ts +37 -0
- package/lib/component/AnchorSVG.d.ts.map +1 -0
- package/lib/component/AnchorSVG.js +137 -0
- package/lib/component/AnchorSVG.js.map +1 -0
- package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.js +4 -0
- package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
- package/lib/component/SVGTable.d.ts +5 -3
- package/lib/component/SVGTable.d.ts.map +1 -1
- package/lib/component/SVGTable.js +16 -16
- package/lib/component/SVGTable.js.map +1 -1
- package/lib/component/context/KeyModifierContext.d.ts +1 -0
- package/lib/component/context/KeyModifierContext.d.ts.map +1 -1
- package/lib/component/context/KeyModifierContext.js +4 -0
- package/lib/component/context/KeyModifierContext.js.map +1 -1
- package/lib/component/context/LoggerContext.d.ts.map +1 -1
- package/lib/component/context/LoggerContext.js.map +1 -1
- package/lib/component/context/SortSpectraContext.d.ts.map +1 -1
- package/lib/component/context/SortSpectraContext.js.map +1 -1
- package/lib/component/elements/ActionsButtonsPopover.d.ts +2 -2
- package/lib/component/elements/ActionsButtonsPopover.d.ts.map +1 -1
- package/lib/component/elements/ActionsButtonsPopover.js +6 -9
- package/lib/component/elements/ActionsButtonsPopover.js.map +1 -1
- package/lib/component/elements/Button.d.ts.map +1 -1
- package/lib/component/elements/Button.js.map +1 -1
- package/lib/component/elements/DraggableDialog.d.ts.map +1 -1
- package/lib/component/elements/DraggableDialog.js +1 -2
- package/lib/component/elements/DraggableDialog.js.map +1 -1
- package/lib/component/elements/Sections.d.ts +3 -3
- package/lib/component/elements/Sections.d.ts.map +1 -1
- package/lib/component/elements/Sections.js +1 -1
- package/lib/component/elements/Sections.js.map +1 -1
- package/lib/component/elements/TabTitle.d.ts.map +1 -1
- package/lib/component/elements/TabTitle.js +2 -2
- package/lib/component/elements/TabTitle.js.map +1 -1
- package/lib/component/elements/ToolbarPopoverItem.d.ts +1 -0
- package/lib/component/elements/ToolbarPopoverItem.d.ts.map +1 -1
- package/lib/component/elements/ToolbarPopoverItem.js +10 -3
- package/lib/component/elements/ToolbarPopoverItem.js.map +1 -1
- package/lib/component/elements/dropDownButton/DropDownButton.d.ts.map +1 -1
- package/lib/component/elements/dropDownButton/DropDownButton.js +2 -2
- package/lib/component/elements/dropDownButton/DropDownButton.js.map +1 -1
- package/lib/component/elements/export/ExportOptionsModal.d.ts +1 -1
- package/lib/component/elements/export/ExportOptionsModal.d.ts.map +1 -1
- package/lib/component/elements/export/ExportOptionsModal.js +28 -110
- package/lib/component/elements/export/ExportOptionsModal.js.map +1 -1
- package/lib/component/elements/export/units.d.ts +0 -28
- package/lib/component/elements/export/units.d.ts.map +1 -1
- package/lib/component/elements/export/units.js +0 -5
- package/lib/component/elements/export/units.js.map +1 -1
- package/lib/component/elements/export/utilities/getExportOptions.d.ts.map +1 -1
- package/lib/component/elements/export/utilities/getExportOptions.js.map +1 -1
- package/lib/component/elements/print/pageSize.d.ts +1 -1
- package/lib/component/elements/print/pageSize.d.ts.map +1 -1
- package/lib/component/header/Header.d.ts.map +1 -1
- package/lib/component/header/Header.js +2 -4
- package/lib/component/header/Header.js.map +1 -1
- package/lib/component/hooks/useExport.d.ts.map +1 -1
- package/lib/component/hooks/useExport.js.map +1 -1
- package/lib/component/hooks/usePanelPreferences.d.ts +3 -3
- package/lib/component/hooks/usePanelPreferences.d.ts.map +1 -1
- package/lib/component/hooks/useSaveSettings.d.ts.map +1 -1
- package/lib/component/hooks/useSaveSettings.js +3 -6
- package/lib/component/hooks/useSaveSettings.js.map +1 -1
- package/lib/component/hooks/useTextMetrics.d.ts.map +1 -1
- package/lib/component/hooks/useTextMetrics.js +1 -0
- package/lib/component/hooks/useTextMetrics.js.map +1 -1
- package/lib/component/main/NMRiumViewer.js +1 -1
- package/lib/component/main/NMRiumViewer.js.map +1 -1
- package/lib/component/modal/EditPeakShapeModal.js +2 -2
- package/lib/component/modal/EditPeakShapeModal.js.map +1 -1
- package/lib/component/modal/PublicationStringModal.d.ts.map +1 -1
- package/lib/component/modal/PublicationStringModal.js +2 -6
- package/lib/component/modal/PublicationStringModal.js.map +1 -1
- package/lib/component/modal/SaveAsModal.d.ts +2 -2
- package/lib/component/modal/SaveAsModal.d.ts.map +1 -1
- package/lib/component/modal/SaveAsModal.js +40 -35
- package/lib/component/modal/SaveAsModal.js.map +1 -1
- package/lib/component/modal/aboutUs/AboutUsModal.d.ts.map +1 -1
- package/lib/component/modal/aboutUs/AboutUsModal.js +2 -4
- package/lib/component/modal/aboutUs/AboutUsModal.js.map +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +4 -3
- package/lib/component/modal/editRange/EditRangeModal.js.map +1 -1
- package/lib/component/modal/editRange/forms/components/NewSignalTab.d.ts.map +1 -1
- package/lib/component/modal/editRange/forms/components/NewSignalTab.js +39 -37
- package/lib/component/modal/editRange/forms/components/NewSignalTab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/errors/context.d.ts +29 -29
- package/lib/component/modal/setting/tanstack_general_settings/errors/context.js +3 -3
- package/lib/component/modal/setting/tanstack_general_settings/errors/context.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.d.ts +29 -29
- package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.js +2 -2
- package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.js +9 -12
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts +29 -29
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.js +2 -2
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts +29 -29
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.js +2 -2
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts +4 -4
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts +29 -29
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.js +2 -2
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/axis_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.d.ts +14 -14
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.js +2 -2
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.d.ts +24 -24
- 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/spectra_label_tab.js +3 -2
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts +24 -24
- 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/title_block_tab.js +3 -2
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts +24 -24
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +30 -3
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -9
- package/lib/component/panels/PeaksPanel/PeaksPanel.js.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +18 -18
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +17 -17
- package/lib/component/panels/PeaksPanel/PeaksTable.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.js +22 -22
- package/lib/component/panels/RangesPanel/RangesPreferences.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
- package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +5 -4
- package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.js +2 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.js.map +1 -1
- package/lib/component/panels/SpectraPanel/SpectraTable.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/SpectraTable.js +5 -1
- package/lib/component/panels/SpectraPanel/SpectraTable.js.map +1 -1
- package/lib/component/panels/SpectraPanel/base/RenderAsHTML.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/base/RenderAsHTML.js +7 -4
- package/lib/component/panels/SpectraPanel/base/RenderAsHTML.js.map +1 -1
- package/lib/component/panels/SpectraPanel/base/SpectrumName.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/base/SpectrumName.js +5 -1
- package/lib/component/panels/SpectraPanel/base/SpectrumName.js.map +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.js +2 -2
- package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.js.map +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.d.ts.map +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +7 -0
- package/lib/component/panels/SummaryPanel/SummaryPanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/FilterPanel.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/FilterPanel.js +5 -2
- package/lib/component/panels/filtersPanel/FilterPanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js +1 -1
- package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js.map +1 -1
- package/lib/component/panels/filtersPanel/processings_sections_panel.d.ts +2 -0
- package/lib/component/panels/filtersPanel/processings_sections_panel.d.ts.map +1 -0
- package/lib/component/panels/filtersPanel/processings_sections_panel.js +144 -0
- package/lib/component/panels/filtersPanel/processings_sections_panel.js.map +1 -0
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.d.ts +3 -2
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.d.ts.map +1 -1
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.js +14 -8
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.js.map +1 -1
- package/lib/component/panels/informationPanel/MixedValuesBadge.d.ts.map +1 -1
- package/lib/component/panels/informationPanel/MixedValuesBadge.js +2 -2
- package/lib/component/panels/informationPanel/MixedValuesBadge.js.map +1 -1
- package/lib/component/panels/informationPanel/SpectraPicker.d.ts.map +1 -1
- package/lib/component/panels/informationPanel/SpectraPicker.js +2 -2
- package/lib/component/panels/informationPanel/SpectraPicker.js.map +1 -1
- package/lib/component/reducer/Reducer.d.ts.map +1 -1
- package/lib/component/reducer/Reducer.js +2 -0
- package/lib/component/reducer/Reducer.js.map +1 -1
- package/lib/component/reducer/actions/CorrelationsActions.js +1 -1
- package/lib/component/reducer/actions/CorrelationsActions.js.map +1 -1
- package/lib/component/reducer/actions/DomainActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/DomainActions.js.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
- package/lib/component/reducer/actions/LoadAction.d.ts.map +1 -1
- package/lib/component/reducer/actions/LoadAction.js.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +9 -0
- package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/RangesActions.d.ts +11 -2
- package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/RangesActions.js +23 -5
- 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 +5 -17
- package/lib/component/reducer/actions/ToolsActions.js.map +1 -1
- package/lib/component/reducer/helper/getTraceSpectrumID.d.ts +5 -0
- package/lib/component/reducer/helper/getTraceSpectrumID.d.ts.map +1 -0
- package/lib/component/reducer/helper/getTraceSpectrumID.js +14 -0
- package/lib/component/reducer/helper/getTraceSpectrumID.js.map +1 -0
- package/lib/component/reducer/helper/setRangesViewProperty.d.ts.map +1 -1
- package/lib/component/reducer/helper/setRangesViewProperty.js.map +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts.map +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +35 -26
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js.map +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +2 -2
- package/lib/component/reducer/preferences/preferencesReducer.d.ts.map +1 -1
- package/lib/component/reducer/preferences/utilities/initWorkspace.d.ts +2 -2
- package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts +2 -2
- package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts.map +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/toolbar/nmr_toolbar.d.ts.map +1 -1
- package/lib/component/toolbar/nmr_toolbar.js +3 -1
- package/lib/component/toolbar/nmr_toolbar.js.map +1 -1
- package/lib/component/utility/CoreSlot.d.ts +27 -0
- package/lib/component/utility/CoreSlot.d.ts.map +1 -0
- package/lib/component/utility/CoreSlot.js +56 -0
- package/lib/component/utility/CoreSlot.js.map +1 -0
- package/lib/component/utility/export.d.ts.map +1 -1
- package/lib/component/utility/export.js +1 -0
- package/lib/component/utility/export.js.map +1 -1
- package/lib/data/PredictionManager.js.map +1 -1
- package/lib/data/constants/signalsKinds.d.ts +1 -2
- package/lib/data/constants/signalsKinds.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -0
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +35 -30
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js +1 -0
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js.map +1 -1
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +2 -2
- package/lib/data/matrixGeneration.d.ts.map +1 -1
- package/lib/data/matrixGeneration.js.map +1 -1
- package/lib/versionInfo.js +1 -1
- package/package.json +37 -37
- package/src/component/1d/PredictionErrorsNotations.tsx +5 -4
- package/src/component/1d/peaks/Peaks.tsx +5 -2
- package/src/component/1d/peaks/usePeakShapesPath.ts +0 -1
- package/src/component/1d/ranges/AssignmentLabel.tsx +1 -1
- package/src/component/1d/ranges/FloatingRangeTablePreferencesModal.tsx +238 -0
- package/src/component/1d/ranges/FloatingRanges.tsx +529 -0
- package/src/component/1d/ranges/Ranges.tsx +2 -2
- package/src/component/1d-2d/FieldEdition.tsx +4 -4
- package/src/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.tsx +8 -8
- package/src/component/1d-2d/tools/BrushXY.tsx +8 -8
- package/src/component/2d/1d-tracer/Left1DChart.tsx +24 -1
- package/src/component/2d/1d-tracer/Ranges1D.tsx +134 -0
- package/src/component/2d/1d-tracer/Signals1D.tsx +145 -0
- package/src/component/2d/1d-tracer/Top1DChart.tsx +29 -2
- package/src/component/2d/ft/FTContainer.tsx +1 -0
- package/src/component/2d/zones/SignalsGuideLines.tsx +1 -1
- package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +1 -1
- package/src/component/AnchorSVG.tsx +370 -0
- package/src/component/EventsTrackers/BrushTracker.tsx +7 -2
- package/src/component/SVGTable.tsx +35 -33
- package/src/component/context/KeyModifierContext.tsx +6 -2
- package/src/component/context/LoggerContext.tsx +1 -7
- package/src/component/context/SortSpectraContext.tsx +1 -3
- package/src/component/elements/ActionsButtonsPopover.tsx +12 -14
- package/src/component/elements/Button.tsx +1 -6
- package/src/component/elements/DraggableDialog.tsx +1 -2
- package/src/component/elements/Sections.tsx +9 -7
- package/src/component/elements/TabTitle.tsx +7 -5
- package/src/component/elements/ToolbarPopoverItem.tsx +13 -2
- package/src/component/elements/dropDownButton/DropDownButton.tsx +7 -5
- package/src/component/elements/export/ExportOptionsModal.tsx +51 -280
- package/src/component/elements/export/units.ts +0 -6
- package/src/component/elements/export/utilities/getExportOptions.ts +1 -0
- package/src/component/elements/print/pageSize.ts +1 -1
- package/src/component/header/Header.tsx +2 -4
- package/src/component/hooks/useExport.tsx +1 -3
- package/src/component/hooks/usePanelPreferences.ts +4 -4
- package/src/component/hooks/useSaveSettings.tsx +4 -15
- package/src/component/hooks/useTextMetrics.ts +1 -0
- package/src/component/main/NMRiumViewer.tsx +1 -1
- package/src/component/modal/EditPeakShapeModal.tsx +2 -2
- package/src/component/modal/PublicationStringModal.tsx +5 -11
- package/src/component/modal/SaveAsModal.tsx +80 -82
- package/src/component/modal/aboutUs/AboutUsModal.tsx +5 -4
- package/src/component/modal/editRange/EditRangeModal.tsx +6 -4
- package/src/component/modal/editRange/forms/components/NewSignalTab.tsx +58 -58
- package/src/component/modal/setting/WorkspaceItem.tsx +2 -2
- package/src/component/modal/setting/tanstack_general_settings/errors/context.tsx +3 -3
- package/src/component/modal/setting/tanstack_general_settings/errors/renderer.tsx +2 -2
- package/src/component/modal/setting/tanstack_general_settings/general_settings.tsx +23 -29
- package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.tsx +2 -2
- package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.tsx +2 -2
- package/src/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.tsx +2 -2
- package/src/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.tsx +2 -2
- package/src/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.tsx +3 -2
- package/src/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.tsx +3 -2
- package/src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx +41 -8
- package/src/component/panels/PeaksPanel/PeaksPanel.tsx +1 -8
- package/src/component/panels/PeaksPanel/PeaksPreferences.tsx +18 -18
- package/src/component/panels/PeaksPanel/PeaksTable.tsx +19 -17
- package/src/component/panels/RangesPanel/RangesHeader.tsx +1 -2
- package/src/component/panels/RangesPanel/RangesPanel.tsx +2 -2
- package/src/component/panels/RangesPanel/RangesPreferences.tsx +22 -22
- package/src/component/panels/RangesPanel/RangesTable.tsx +19 -17
- package/src/component/panels/RangesPanel/RangesTableRow.tsx +25 -25
- package/src/component/panels/SpectraPanel/SpectraTable.tsx +12 -1
- package/src/component/panels/SpectraPanel/base/RenderAsHTML.tsx +22 -4
- package/src/component/panels/SpectraPanel/base/SpectrumName.tsx +15 -6
- package/src/component/panels/SpectraPanel/base/setting/SpectrumSetting.tsx +3 -2
- package/src/component/panels/SummaryPanel/SummaryPanel.tsx +14 -16
- package/src/component/panels/filtersPanel/FilterPanel.tsx +10 -0
- package/src/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.tsx +1 -0
- package/src/component/panels/filtersPanel/processings_sections_panel.tsx +324 -0
- package/src/component/panels/hooks/useMoleculeAnnotationCore.ts +17 -9
- package/src/component/panels/informationPanel/MixedValuesBadge.tsx +3 -2
- package/src/component/panels/informationPanel/SpectraPicker.tsx +12 -4
- package/src/component/panels/multipleAnalysisPanel/AnalysisChart.tsx +2 -2
- package/src/component/reducer/Reducer.ts +2 -0
- package/src/component/reducer/actions/CorrelationsActions.ts +1 -1
- package/src/component/reducer/actions/DomainActions.ts +1 -4
- package/src/component/reducer/actions/FiltersActions.ts +1 -2
- package/src/component/reducer/actions/LoadAction.ts +1 -3
- package/src/component/reducer/actions/RangesActions.ts +39 -5
- package/src/component/reducer/actions/ToolsActions.ts +5 -21
- package/src/component/reducer/helper/getTraceSpectrumID.tsx +25 -0
- package/src/component/reducer/helper/setRangesViewProperty.ts +1 -2
- package/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts +32 -19
- package/src/component/reducer/preferences/preferencesReducer.ts +2 -2
- package/src/component/reducer/preferences/utilities/initWorkspace.ts +2 -2
- package/src/component/reducer/preferences/utilities/mapWorkspaces.ts +2 -2
- package/src/component/toolbar/ToolTypes.ts +2 -2
- package/src/component/toolbar/nmr_toolbar.tsx +3 -2
- package/src/component/utility/CoreSlot.tsx +126 -0
- package/src/component/utility/export.ts +1 -0
- package/src/data/PredictionManager.ts +4 -6
- package/src/data/constants/signalsKinds.ts +1 -1
- package/src/data/data1d/Spectrum1D/peaks/autoPeakPicking.ts +1 -0
- package/src/data/data1d/Spectrum1D/peaks/optimizePeaks.ts +35 -30
- package/src/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.ts +1 -0
- package/src/data/data1d/multipleSpectraAnalysis.ts +2 -2
- package/src/data/matrixGeneration.ts +1 -5
- package/src/versionInfo.ts +1 -1
- package/lib/component/1d/FloatingRanges.d.ts.map +0 -1
- package/lib/component/1d/FloatingRanges.js +0 -263
- package/lib/component/1d/FloatingRanges.js.map +0 -1
- package/lib/component/elements/export/utilities/exportOptionValidationSchema.d.ts +0 -17
- package/lib/component/elements/export/utilities/exportOptionValidationSchema.d.ts.map +0 -1
- package/lib/component/elements/export/utilities/exportOptionValidationSchema.js +0 -79
- package/lib/component/elements/export/utilities/exportOptionValidationSchema.js.map +0 -1
- package/lib/component/elements/export/utilities/getModes.d.ts +0 -4
- package/lib/component/elements/export/utilities/getModes.d.ts.map +0 -1
- package/lib/component/elements/export/utilities/getModes.js +0 -11
- package/lib/component/elements/export/utilities/getModes.js.map +0 -1
- package/lib/component/utility/renderCoreSlot.d.ts +0 -11
- package/lib/component/utility/renderCoreSlot.d.ts.map +0 -1
- package/lib/component/utility/renderCoreSlot.js +0 -13
- package/lib/component/utility/renderCoreSlot.js.map +0 -1
- package/src/component/1d/FloatingRanges.tsx +0 -378
- package/src/component/elements/export/utilities/exportOptionValidationSchema.ts +0 -106
- package/src/component/elements/export/utilities/getModes.ts +0 -14
- package/src/component/utility/renderCoreSlot.tsx +0 -21
- /package/lib/component/1d/{FloatingRanges.d.ts → ranges/FloatingRanges.d.ts} +0 -0
|
@@ -1,378 +0,0 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
|
-
import type { Ranges } from '@zakodium/nmr-types';
|
|
3
|
-
import type { BoundingBox } from '@zakodium/nmrium-core';
|
|
4
|
-
import { checkMultiplicity } from 'nmr-processing';
|
|
5
|
-
import { memo, useEffect, useState } from 'react';
|
|
6
|
-
import { BsArrowsMove } from 'react-icons/bs';
|
|
7
|
-
import { FaTimes } from 'react-icons/fa';
|
|
8
|
-
import { Rnd } from 'react-rnd';
|
|
9
|
-
|
|
10
|
-
import { isSpectrum1D } from '../../data/data1d/Spectrum1D/index.js';
|
|
11
|
-
import { isSignalRange } from '../../data/utilities/RangeUtilities.js';
|
|
12
|
-
import type { SVGTableColumn } from '../SVGTable.js';
|
|
13
|
-
import { SVGTable } from '../SVGTable.js';
|
|
14
|
-
import { useChartData } from '../context/ChartContext.js';
|
|
15
|
-
import { useDispatch } from '../context/DispatchContext.js';
|
|
16
|
-
import { useGlobal } from '../context/GlobalContext.js';
|
|
17
|
-
import type { ActionsButtonsPopoverProps } from '../elements/ActionsButtonsPopover.js';
|
|
18
|
-
import { ActionsButtonsPopover } from '../elements/ActionsButtonsPopover.js';
|
|
19
|
-
import { useActiveNucleusTab } from '../hooks/useActiveNucleusTab.js';
|
|
20
|
-
import { usePanelPreferences } from '../hooks/usePanelPreferences.js';
|
|
21
|
-
import { useSVGUnitConverter } from '../hooks/useSVGUnitConverter.js';
|
|
22
|
-
import useSpectraByActiveNucleus from '../hooks/useSpectraPerNucleus.js';
|
|
23
|
-
import { useCheckExportStatus } from '../hooks/useViewportSize.js';
|
|
24
|
-
import { extractChemicalElement } from '../utility/extractChemicalElement.js';
|
|
25
|
-
import { formatNumber } from '../utility/formatNumber.js';
|
|
26
|
-
|
|
27
|
-
const ReactRnd = styled(Rnd)`
|
|
28
|
-
border: 1px solid transparent;
|
|
29
|
-
|
|
30
|
-
:hover {
|
|
31
|
-
background-color: white;
|
|
32
|
-
border: 1px solid #ebecf1;
|
|
33
|
-
|
|
34
|
-
button {
|
|
35
|
-
visibility: visible;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
|
|
40
|
-
interface RangesTableProps {
|
|
41
|
-
ranges: Ranges['values'];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
interface RangeItem {
|
|
45
|
-
id: string;
|
|
46
|
-
delta: string;
|
|
47
|
-
multiplicity: string;
|
|
48
|
-
integration: string;
|
|
49
|
-
coupling: string;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function useMapRanges(ranges: Ranges['values']) {
|
|
53
|
-
const output: RangeItem[] = [];
|
|
54
|
-
const activeTab = useActiveNucleusTab();
|
|
55
|
-
const preferences = usePanelPreferences('ranges', activeTab);
|
|
56
|
-
for (const range of ranges) {
|
|
57
|
-
const { id, from, to, integration, signals = [] } = range;
|
|
58
|
-
const relativeFlag = isSignalRange(range);
|
|
59
|
-
const formattedValue = formatNumber(
|
|
60
|
-
integration,
|
|
61
|
-
preferences.relative.format,
|
|
62
|
-
);
|
|
63
|
-
const integrationValue = relativeFlag
|
|
64
|
-
? formattedValue
|
|
65
|
-
: `[ ${formattedValue} ]`;
|
|
66
|
-
|
|
67
|
-
const rangeText = `${formatNumber(from, preferences.from.format)} - ${formatNumber(
|
|
68
|
-
to,
|
|
69
|
-
preferences.to.format,
|
|
70
|
-
)}`;
|
|
71
|
-
if (signals.length > 0) {
|
|
72
|
-
for (const signal of signals) {
|
|
73
|
-
const { multiplicity, delta, js = [] } = signal;
|
|
74
|
-
const coupling = js
|
|
75
|
-
.map((jsItem) =>
|
|
76
|
-
!Number.isNaN(jsItem.coupling)
|
|
77
|
-
? formatNumber(jsItem.coupling, preferences.coupling.format)
|
|
78
|
-
: '',
|
|
79
|
-
)
|
|
80
|
-
.join(',');
|
|
81
|
-
const signalDelta = !checkMultiplicity(multiplicity, ['m'])
|
|
82
|
-
? rangeText
|
|
83
|
-
: formatNumber(delta, preferences.deltaPPM.format);
|
|
84
|
-
output.push({
|
|
85
|
-
id,
|
|
86
|
-
delta: signalDelta,
|
|
87
|
-
multiplicity,
|
|
88
|
-
integration: integrationValue,
|
|
89
|
-
coupling,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
} else {
|
|
93
|
-
output.push({
|
|
94
|
-
id,
|
|
95
|
-
delta: rangeText,
|
|
96
|
-
multiplicity: 'm',
|
|
97
|
-
integration: integrationValue,
|
|
98
|
-
coupling: '',
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return output;
|
|
103
|
-
}
|
|
104
|
-
function InnerSVGRangesTable(props: RangesTableProps) {
|
|
105
|
-
const { ranges } = props;
|
|
106
|
-
const {
|
|
107
|
-
view: {
|
|
108
|
-
spectra: { activeTab },
|
|
109
|
-
},
|
|
110
|
-
} = useChartData();
|
|
111
|
-
const data = useMapRanges(ranges);
|
|
112
|
-
|
|
113
|
-
if (!data) return null;
|
|
114
|
-
|
|
115
|
-
const element = extractChemicalElement(activeTab);
|
|
116
|
-
|
|
117
|
-
const columns: Array<SVGTableColumn<RangeItem>> = [
|
|
118
|
-
{
|
|
119
|
-
accessorKey: 'delta',
|
|
120
|
-
header: 'δ (ppm)',
|
|
121
|
-
width: 100,
|
|
122
|
-
rowSpanGroupKey: 'id',
|
|
123
|
-
headerTextProps: { fontWeight: 'bold' },
|
|
124
|
-
cellBoxProps: { stroke: '#dedede', fill: 'white', fillOpacity: 0.8 },
|
|
125
|
-
headerBoxProps: { stroke: '#dedede', fill: '#E5E8EB' },
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
accessorKey: 'integration',
|
|
129
|
-
header: `Rel. ${element}`,
|
|
130
|
-
width: 60,
|
|
131
|
-
rowSpanGroupKey: 'id',
|
|
132
|
-
headerTextProps: { fontWeight: 'bold' },
|
|
133
|
-
cellBoxProps: { stroke: '#dedede', fill: 'white', fillOpacity: 0.8 },
|
|
134
|
-
headerBoxProps: { stroke: '#dedede', fill: '#E5E8EB' },
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
accessorKey: 'multiplicity',
|
|
138
|
-
header: 'Mult.',
|
|
139
|
-
width: 60,
|
|
140
|
-
rowSpanGroupKey: 'id',
|
|
141
|
-
headerTextProps: { fontWeight: 'bold' },
|
|
142
|
-
cellBoxProps: { stroke: '#dedede', fill: 'white', fillOpacity: 0.8 },
|
|
143
|
-
headerBoxProps: { stroke: '#dedede', fill: '#E5E8EB' },
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
accessorKey: 'coupling',
|
|
147
|
-
header: 'J (Hz)',
|
|
148
|
-
width: 120,
|
|
149
|
-
headerTextProps: { fontWeight: 'bold' },
|
|
150
|
-
cellBoxProps: { stroke: '#dedede', fill: 'white', fillOpacity: 0.8 },
|
|
151
|
-
headerBoxProps: { stroke: '#dedede', fill: '#E5E8EB' },
|
|
152
|
-
},
|
|
153
|
-
];
|
|
154
|
-
|
|
155
|
-
return <SVGTable<RangeItem> data={data} columns={columns} />;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const SVGRangesTable = memo(InnerSVGRangesTable);
|
|
159
|
-
|
|
160
|
-
interface DraggablePublicationStringProps {
|
|
161
|
-
ranges: Ranges['values'] | undefined;
|
|
162
|
-
bonding: BoundingBox;
|
|
163
|
-
spectrumKey: string;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function DraggableRanges(props: DraggablePublicationStringProps) {
|
|
167
|
-
const { ranges = [], bonding: externalBounding, spectrumKey } = props;
|
|
168
|
-
const dispatch = useDispatch();
|
|
169
|
-
const { viewerRef } = useGlobal();
|
|
170
|
-
const [bounding, setBounding] = useState<BoundingBox>(externalBounding);
|
|
171
|
-
const [isMoveActive, setIsMoveActive] = useState(false);
|
|
172
|
-
const { percentToPixel, pixelToPercent } = useSVGUnitConverter();
|
|
173
|
-
const isExportProcessStart = useCheckExportStatus();
|
|
174
|
-
|
|
175
|
-
useEffect(() => {
|
|
176
|
-
setBounding({ ...externalBounding });
|
|
177
|
-
}, [externalBounding]);
|
|
178
|
-
|
|
179
|
-
function handleResize(
|
|
180
|
-
internalBounding: Pick<BoundingBox, 'height' | 'width'>,
|
|
181
|
-
) {
|
|
182
|
-
const { width = 0, height = 0 } = convertToPixel(externalBounding);
|
|
183
|
-
internalBounding.width += width;
|
|
184
|
-
internalBounding.height += height;
|
|
185
|
-
setBounding((prevBounding) => ({
|
|
186
|
-
...prevBounding,
|
|
187
|
-
...convertToPercent(internalBounding),
|
|
188
|
-
}));
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
function handleDrag(internalBounding: Pick<BoundingBox, 'x' | 'y'>) {
|
|
192
|
-
setBounding((prevBounding) => ({
|
|
193
|
-
...prevBounding,
|
|
194
|
-
...convertToPercent(internalBounding),
|
|
195
|
-
}));
|
|
196
|
-
}
|
|
197
|
-
function handleChangeInsetBounding(bounding: Partial<BoundingBox>) {
|
|
198
|
-
if (
|
|
199
|
-
typeof bounding?.width === 'number' &&
|
|
200
|
-
typeof bounding?.height === 'number'
|
|
201
|
-
) {
|
|
202
|
-
const { width, height } = externalBounding;
|
|
203
|
-
bounding.width += width;
|
|
204
|
-
bounding.height += height;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
dispatch({
|
|
208
|
-
type: 'CHANGE_RANGES_VIEW_FLOATING_BOX_BOUNDING',
|
|
209
|
-
payload: {
|
|
210
|
-
spectrumKey,
|
|
211
|
-
bounding: convertToPercent(bounding),
|
|
212
|
-
target: 'rangesBounding',
|
|
213
|
-
},
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function convertToPixel(bounding: Partial<BoundingBox>) {
|
|
218
|
-
const { x, y, height, width } = bounding;
|
|
219
|
-
const output: Partial<BoundingBox> = {};
|
|
220
|
-
|
|
221
|
-
if (x) {
|
|
222
|
-
output.x = percentToPixel(x, 'x');
|
|
223
|
-
}
|
|
224
|
-
if (y) {
|
|
225
|
-
output.y = percentToPixel(y, 'y');
|
|
226
|
-
}
|
|
227
|
-
if (width) {
|
|
228
|
-
output.width = width;
|
|
229
|
-
}
|
|
230
|
-
if (height) {
|
|
231
|
-
output.height = height;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
return output;
|
|
235
|
-
}
|
|
236
|
-
function convertToPercent(bounding: Partial<BoundingBox>) {
|
|
237
|
-
const { x, y, height, width } = bounding;
|
|
238
|
-
const output: Partial<BoundingBox> = {};
|
|
239
|
-
|
|
240
|
-
if (x) {
|
|
241
|
-
output.x = pixelToPercent(x, 'x');
|
|
242
|
-
}
|
|
243
|
-
if (y) {
|
|
244
|
-
output.y = pixelToPercent(y, 'y');
|
|
245
|
-
}
|
|
246
|
-
if (width) {
|
|
247
|
-
output.width = width;
|
|
248
|
-
}
|
|
249
|
-
if (height) {
|
|
250
|
-
output.height = height;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
return output;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
function handleRemove() {
|
|
257
|
-
dispatch({
|
|
258
|
-
type: 'TOGGLE_RANGES_VIEW_PROPERTY',
|
|
259
|
-
payload: { key: 'showRanges', spectrumKey },
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
const actionButtons: ActionsButtonsPopoverProps['buttons'] = [
|
|
264
|
-
{
|
|
265
|
-
icon: <BsArrowsMove />,
|
|
266
|
-
|
|
267
|
-
intent: 'none',
|
|
268
|
-
title: 'Move ranges table',
|
|
269
|
-
style: { cursor: 'move' },
|
|
270
|
-
className: 'handle',
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
icon: <FaTimes />,
|
|
274
|
-
intent: 'danger',
|
|
275
|
-
title: 'Hide ranges table',
|
|
276
|
-
onClick: handleRemove,
|
|
277
|
-
},
|
|
278
|
-
];
|
|
279
|
-
if (!viewerRef || ranges.length === 0) return null;
|
|
280
|
-
|
|
281
|
-
const { x: xInPercent, y: yInPercent } = bounding;
|
|
282
|
-
|
|
283
|
-
const x = percentToPixel(xInPercent, 'x');
|
|
284
|
-
const y = percentToPixel(yInPercent, 'y');
|
|
285
|
-
|
|
286
|
-
if (isExportProcessStart) {
|
|
287
|
-
return (
|
|
288
|
-
<g transform={`translate(${x} ${y})`}>
|
|
289
|
-
<SVGRangesTable ranges={ranges} />
|
|
290
|
-
</g>
|
|
291
|
-
);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
return (
|
|
295
|
-
<ReactRnd
|
|
296
|
-
default={{ x, y, width: 'auto', height: 'auto' }}
|
|
297
|
-
position={{ x, y }}
|
|
298
|
-
enableResizing={false}
|
|
299
|
-
minWidth={100}
|
|
300
|
-
minHeight={50}
|
|
301
|
-
dragHandleClassName="handle"
|
|
302
|
-
enableUserSelectHack={false}
|
|
303
|
-
bounds={`#${viewerRef.id}`}
|
|
304
|
-
onDragStart={() => setIsMoveActive(true)}
|
|
305
|
-
onResize={(e, dir, eRef, size, position) =>
|
|
306
|
-
handleResize({ ...size, ...position })
|
|
307
|
-
}
|
|
308
|
-
onResizeStop={(e, dir, eRef, size, position) =>
|
|
309
|
-
handleChangeInsetBounding({ ...size, ...position })
|
|
310
|
-
}
|
|
311
|
-
onDrag={(e, { x, y }) => {
|
|
312
|
-
handleDrag({ x, y });
|
|
313
|
-
}}
|
|
314
|
-
onDragStop={(e, { x, y }) => {
|
|
315
|
-
handleChangeInsetBounding({ x, y });
|
|
316
|
-
setIsMoveActive(false);
|
|
317
|
-
}}
|
|
318
|
-
resizeHandleWrapperStyle={{ backgroundColor: 'white' }}
|
|
319
|
-
>
|
|
320
|
-
<ActionsButtonsPopover
|
|
321
|
-
buttons={actionButtons}
|
|
322
|
-
fill
|
|
323
|
-
positioningStrategy="fixed"
|
|
324
|
-
direction="row"
|
|
325
|
-
targetProps={{ style: { width: '100%', height: '100%' } }}
|
|
326
|
-
space={2}
|
|
327
|
-
{...(isMoveActive && { isOpen: true })}
|
|
328
|
-
x={x}
|
|
329
|
-
y={y}
|
|
330
|
-
>
|
|
331
|
-
<SVGRangesTable ranges={ranges} />
|
|
332
|
-
</ActionsButtonsPopover>
|
|
333
|
-
</ReactRnd>
|
|
334
|
-
);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
function useSpectraRanges() {
|
|
338
|
-
const spectra = useSpectraByActiveNucleus();
|
|
339
|
-
const output: Record<string, Ranges['values']> = {};
|
|
340
|
-
|
|
341
|
-
for (const spectrum of spectra) {
|
|
342
|
-
if (!isSpectrum1D(spectrum)) {
|
|
343
|
-
continue;
|
|
344
|
-
}
|
|
345
|
-
const { id: spectrumKey, ranges } = spectrum;
|
|
346
|
-
|
|
347
|
-
if (!Array.isArray(ranges?.values) || ranges.values.length === 0) {
|
|
348
|
-
continue;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
output[spectrumKey] = ranges.values;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
return output;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
export function FloatingRanges() {
|
|
358
|
-
const spectraRanges = useSpectraRanges();
|
|
359
|
-
const {
|
|
360
|
-
view: { ranges },
|
|
361
|
-
} = useChartData();
|
|
362
|
-
|
|
363
|
-
const options = Object.entries(ranges);
|
|
364
|
-
|
|
365
|
-
return options.map(([spectrumKey, viewOptions]) => {
|
|
366
|
-
const { showRanges, rangesBounding } = viewOptions;
|
|
367
|
-
if (!showRanges) return null;
|
|
368
|
-
|
|
369
|
-
return (
|
|
370
|
-
<DraggableRanges
|
|
371
|
-
key={spectrumKey}
|
|
372
|
-
spectrumKey={spectrumKey}
|
|
373
|
-
bonding={rangesBounding}
|
|
374
|
-
ranges={spectraRanges[spectrumKey]}
|
|
375
|
-
/>
|
|
376
|
-
);
|
|
377
|
-
});
|
|
378
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ExportSettings,
|
|
3
|
-
Layout,
|
|
4
|
-
PageSizeName,
|
|
5
|
-
Unit,
|
|
6
|
-
} from '@zakodium/nmrium-core';
|
|
7
|
-
import * as Yup from 'yup';
|
|
8
|
-
|
|
9
|
-
import { pageSizes } from '../../print/pageSize.js';
|
|
10
|
-
import { convertToPixels, units } from '../units.js';
|
|
11
|
-
|
|
12
|
-
const MAX_PIXEL = 16000;
|
|
13
|
-
|
|
14
|
-
const unitsKeys = units.map(({ unit }) => unit, []);
|
|
15
|
-
const pageSizesKeys = pageSizes.map(({ name }) => name, []);
|
|
16
|
-
|
|
17
|
-
function testSize(value: number, unit: Unit, dpi: number) {
|
|
18
|
-
const valueInPixel = convertToPixels(value, unit, dpi, {
|
|
19
|
-
precision: 2,
|
|
20
|
-
});
|
|
21
|
-
if (value) {
|
|
22
|
-
return valueInPixel <= MAX_PIXEL;
|
|
23
|
-
}
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// export const exportOptionValidationSchema = Yup.object().shape({
|
|
28
|
-
// width: Yup.number()
|
|
29
|
-
// .required()
|
|
30
|
-
// .test(
|
|
31
|
-
// 'width-test',
|
|
32
|
-
// `Width should be less or equal to ${MAX_PIXEL}`,
|
|
33
|
-
// // eslint-disable-next-line func-names
|
|
34
|
-
// function (value) {
|
|
35
|
-
// // eslint-disable-next-line no-invalid-this
|
|
36
|
-
// const { unit, dpi } = this.parent;
|
|
37
|
-
// return testSize(value, unit, dpi);
|
|
38
|
-
// },
|
|
39
|
-
// ),
|
|
40
|
-
|
|
41
|
-
// height: Yup.number()
|
|
42
|
-
// .required()
|
|
43
|
-
// .test(
|
|
44
|
-
// 'height-test',
|
|
45
|
-
// `Height should be less or equal to ${MAX_PIXEL}`,
|
|
46
|
-
// // eslint-disable-next-line func-names
|
|
47
|
-
// function (value) {
|
|
48
|
-
// // eslint-disable-next-line no-invalid-this
|
|
49
|
-
// const { unit, dpi } = this.parent;
|
|
50
|
-
// return testSize(value, unit, dpi);
|
|
51
|
-
// },
|
|
52
|
-
// ),
|
|
53
|
-
|
|
54
|
-
// dpi: Yup.number().required(),
|
|
55
|
-
// unit: Yup.mixed<Unit>().oneOf(unitsKeys, 'Unit is invalid').required(),
|
|
56
|
-
// useDefaultSettings: Yup.boolean().required(),
|
|
57
|
-
// });
|
|
58
|
-
|
|
59
|
-
const advanceExportOptionValidationSchema = Yup.object().shape({
|
|
60
|
-
mode: Yup.string().oneOf(['basic', 'advance']).required(),
|
|
61
|
-
width: Yup.number()
|
|
62
|
-
.required()
|
|
63
|
-
.test(
|
|
64
|
-
'width-test',
|
|
65
|
-
`Width should be less or equal to ${MAX_PIXEL}`,
|
|
66
|
-
(value, context) => {
|
|
67
|
-
const { unit, dpi } = context.parent;
|
|
68
|
-
return testSize(value, unit, dpi);
|
|
69
|
-
},
|
|
70
|
-
),
|
|
71
|
-
|
|
72
|
-
height: Yup.number()
|
|
73
|
-
.required()
|
|
74
|
-
.test(
|
|
75
|
-
'height-test',
|
|
76
|
-
`Height should be less or equal to ${MAX_PIXEL}`,
|
|
77
|
-
(value, context) => {
|
|
78
|
-
const { unit, dpi } = context.parent;
|
|
79
|
-
return testSize(value, unit, dpi);
|
|
80
|
-
},
|
|
81
|
-
),
|
|
82
|
-
|
|
83
|
-
dpi: Yup.number().required(),
|
|
84
|
-
unit: Yup.mixed<Unit>().oneOf(unitsKeys).required(),
|
|
85
|
-
useDefaultSettings: Yup.boolean().required(),
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
const basicExportOptionValidationSchema = Yup.object().shape({
|
|
89
|
-
mode: Yup.string().oneOf(['basic', 'advance']).required(),
|
|
90
|
-
size: Yup.mixed<PageSizeName>()
|
|
91
|
-
.oneOf(pageSizesKeys, 'Size is invalid')
|
|
92
|
-
.required(),
|
|
93
|
-
layout: Yup.mixed<Layout>()
|
|
94
|
-
.oneOf(['portrait', 'landscape'], 'Layout is invalid')
|
|
95
|
-
.required(),
|
|
96
|
-
dpi: Yup.number().required(),
|
|
97
|
-
useDefaultSettings: Yup.boolean().required(),
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
export const exportOptionValidationSchema = Yup.lazy(
|
|
101
|
-
(values: ExportSettings) => {
|
|
102
|
-
return values?.mode === 'advance'
|
|
103
|
-
? advanceExportOptionValidationSchema
|
|
104
|
-
: basicExportOptionValidationSchema;
|
|
105
|
-
},
|
|
106
|
-
);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { OptionProps } from '@blueprintjs/core';
|
|
2
|
-
|
|
3
|
-
export const MODES: Array<OptionProps<string>> = [
|
|
4
|
-
{
|
|
5
|
-
label: 'Basic',
|
|
6
|
-
value: 'basic',
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
label: 'Advanced',
|
|
10
|
-
value: 'advance',
|
|
11
|
-
},
|
|
12
|
-
];
|
|
13
|
-
|
|
14
|
-
export type Mode = (typeof MODES)[number]['value'];
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { NMRiumCore, SupportedUISlot } from '@zakodium/nmrium-core';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Render all components registered in the given slot.
|
|
6
|
-
*
|
|
7
|
-
* @param core
|
|
8
|
-
* @param slot
|
|
9
|
-
* @param fallback - return fallback if no component is registered in the slot
|
|
10
|
-
*/
|
|
11
|
-
export function renderCoreSlot(
|
|
12
|
-
core: NMRiumCore,
|
|
13
|
-
slot: SupportedUISlot,
|
|
14
|
-
fallback?: ReactNode,
|
|
15
|
-
): ReactNode {
|
|
16
|
-
const jsx = Array.from(core.slot(slot), ([key, Component]) => (
|
|
17
|
-
<Component key={key} slot={slot} />
|
|
18
|
-
));
|
|
19
|
-
|
|
20
|
-
return jsx.length > 0 ? jsx : fallback;
|
|
21
|
-
}
|
|
File without changes
|