nmrium 2.2.0 → 2.3.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/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/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/EventsTrackers/BrushTracker.d.ts.map +1 -1
- 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.map +1 -1
- 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/Sections.d.ts.map +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 +31 -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/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/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/SaveAsModal.d.ts +2 -2
- package/lib/component/modal/SaveAsModal.d.ts.map +1 -1
- package/lib/component/modal/SaveAsModal.js +43 -35
- package/lib/component/modal/SaveAsModal.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.js +2 -2
- package/lib/component/modal/editRange/forms/components/NewSignalTab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/errors/context.d.ts +5 -5
- 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 +5 -5
- 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_dialog_body.d.ts +5 -5
- 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_header.d.ts +5 -5
- 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/tabs/auto_processing_tab.d.ts +5 -5
- 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/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/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.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/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/PeaksPreferences.js +18 -18
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +11 -11
- 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.map +1 -1
- 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/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/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/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/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 +30 -31
- 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/2d/zones/SignalsGuideLines.tsx +1 -1
- package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +1 -1
- package/src/component/EventsTrackers/BrushTracker.tsx +1 -2
- package/src/component/SVGTable.tsx +35 -33
- package/src/component/context/KeyModifierContext.tsx +1 -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/Sections.tsx +5 -3
- 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 +56 -276
- 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/hooks/useExport.tsx +1 -3
- package/src/component/hooks/usePanelPreferences.ts +4 -4
- 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/SaveAsModal.tsx +89 -82
- package/src/component/modal/editRange/EditRangeModal.tsx +6 -4
- package/src/component/modal/editRange/forms/components/NewSignalTab.tsx +3 -3
- 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_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/PeaksPreferences.tsx +18 -18
- package/src/component/panels/PeaksPanel/PeaksTable.tsx +11 -11
- 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 +1 -5
- 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/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/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/utility/export.ts +1 -0
- package/src/data/PredictionManager.ts +4 -6
- package/src/data/constants/signalsKinds.ts +1 -1
- 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/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/lib/component/1d/{FloatingRanges.d.ts → ranges/FloatingRanges.d.ts} +0 -0
|
@@ -20,7 +20,7 @@ import type { PeakRecord } from './PeaksPanel.js';
|
|
|
20
20
|
|
|
21
21
|
export function usePeaksTableColumns(activeTab: string) {
|
|
22
22
|
const dispatch = useDispatch();
|
|
23
|
-
const
|
|
23
|
+
const { tablePreferences } = usePanelPreferences('peaks', activeTab);
|
|
24
24
|
const [peak, setEditedPeak] = useState<Peak1D | undefined>();
|
|
25
25
|
|
|
26
26
|
const deletePeakHandler = useCallback(
|
|
@@ -64,7 +64,7 @@ export function usePeaksTableColumns(activeTab: string) {
|
|
|
64
64
|
<EditableColumn
|
|
65
65
|
value={formatNumber(
|
|
66
66
|
row.original.x,
|
|
67
|
-
|
|
67
|
+
tablePreferences.deltaPPM.format,
|
|
68
68
|
)}
|
|
69
69
|
onSave={(value) => saveDeltaPPMRefsHandler(value, row.original)}
|
|
70
70
|
type="number"
|
|
@@ -78,7 +78,7 @@ export function usePeaksTableColumns(activeTab: string) {
|
|
|
78
78
|
Header: 'δ (Hz)',
|
|
79
79
|
accessor: 'xHz',
|
|
80
80
|
Cell: ({ row }: CellProps<PeakRecord>) =>
|
|
81
|
-
formatNumber(row.original.xHz,
|
|
81
|
+
formatNumber(row.original.xHz, tablePreferences.deltaHz.format),
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
showWhen: 'intensity.show',
|
|
@@ -87,7 +87,7 @@ export function usePeaksTableColumns(activeTab: string) {
|
|
|
87
87
|
style: { maxWidth: '80px' },
|
|
88
88
|
accessor: 'y',
|
|
89
89
|
Cell: ({ row }: CellProps<PeakRecord>) =>
|
|
90
|
-
formatNumber(row.original.y,
|
|
90
|
+
formatNumber(row.original.y, tablePreferences.intensity.format),
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
showWhen: 'peakWidth.show',
|
|
@@ -95,7 +95,7 @@ export function usePeaksTableColumns(activeTab: string) {
|
|
|
95
95
|
Header: 'Width (Hz)',
|
|
96
96
|
accessor: 'width',
|
|
97
97
|
Cell: ({ row }: CellProps<PeakRecord>) =>
|
|
98
|
-
formatNumber(row.original.width,
|
|
98
|
+
formatNumber(row.original.width, tablePreferences.peakWidth.format),
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
showWhen: 'showKind',
|
|
@@ -111,7 +111,7 @@ export function usePeaksTableColumns(activeTab: string) {
|
|
|
111
111
|
Cell: ({ row }: CellProps<PeakRecord>) => {
|
|
112
112
|
const fwhm = row.original?.shape?.fwhm;
|
|
113
113
|
if (fwhm) {
|
|
114
|
-
return formatNumber(fwhm,
|
|
114
|
+
return formatNumber(fwhm, tablePreferences.fwhm.format);
|
|
115
115
|
}
|
|
116
116
|
return '';
|
|
117
117
|
},
|
|
@@ -127,7 +127,7 @@ export function usePeaksTableColumns(activeTab: string) {
|
|
|
127
127
|
row.original?.shape?.kind === 'pseudoVoigt' &&
|
|
128
128
|
row.original?.shape?.mu;
|
|
129
129
|
if (mu) {
|
|
130
|
-
return formatNumber(mu,
|
|
130
|
+
return formatNumber(mu, tablePreferences.mu.format);
|
|
131
131
|
}
|
|
132
132
|
return '';
|
|
133
133
|
},
|
|
@@ -144,7 +144,7 @@ export function usePeaksTableColumns(activeTab: string) {
|
|
|
144
144
|
row.original?.shape?.kind === 'generalizedLorentzian' &&
|
|
145
145
|
row.original?.shape?.gamma;
|
|
146
146
|
if (gamma) {
|
|
147
|
-
return formatNumber(gamma,
|
|
147
|
+
return formatNumber(gamma, tablePreferences.gamma.format);
|
|
148
148
|
}
|
|
149
149
|
return '';
|
|
150
150
|
},
|
|
@@ -170,7 +170,7 @@ export function usePeaksTableColumns(activeTab: string) {
|
|
|
170
170
|
},
|
|
171
171
|
],
|
|
172
172
|
[
|
|
173
|
-
|
|
173
|
+
tablePreferences,
|
|
174
174
|
saveDeltaPPMRefsHandler,
|
|
175
175
|
deletePeakHandler,
|
|
176
176
|
editPeakHandler,
|
|
@@ -181,14 +181,14 @@ export function usePeaksTableColumns(activeTab: string) {
|
|
|
181
181
|
const columns: Array<ControlCustomColumn<PeakRecord>> = [];
|
|
182
182
|
for (const col of COLUMNS) {
|
|
183
183
|
const { showWhen, ...colParams } = col;
|
|
184
|
-
if (dlv(
|
|
184
|
+
if (dlv(tablePreferences, showWhen)) {
|
|
185
185
|
addCustomColumn(columns, colParams);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
columns.sort((object1, object2) => object1.index - object2.index);
|
|
190
190
|
return columns;
|
|
191
|
-
}, [COLUMNS,
|
|
191
|
+
}, [COLUMNS, tablePreferences]);
|
|
192
192
|
|
|
193
193
|
return { tableColumns, peak, setEditedPeak };
|
|
194
194
|
}
|
|
@@ -40,8 +40,7 @@ interface ExportData {
|
|
|
40
40
|
id: ExportRangesType;
|
|
41
41
|
}
|
|
42
42
|
type ExportItem =
|
|
43
|
-
|
|
44
|
-
| ToolbarPopoverMenuDivider;
|
|
43
|
+
ToolbarPopoverMenuItem<ExportData> | ToolbarPopoverMenuDivider;
|
|
45
44
|
|
|
46
45
|
const EXPORT_MENU: ExportItem[] = [
|
|
47
46
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Info1D, Range, Ranges } from '@zakodium/nmr-types';
|
|
2
2
|
import type {
|
|
3
3
|
Spectrum1D,
|
|
4
|
-
|
|
4
|
+
WorkspacePanelPreferences,
|
|
5
5
|
} from '@zakodium/nmrium-core';
|
|
6
6
|
import type { NmrData1D } from 'cheminfo-types';
|
|
7
7
|
import { xGetFromToIndex } from 'ml-spectra-processing';
|
|
@@ -37,7 +37,7 @@ interface RangesTablePanelInnerProps {
|
|
|
37
37
|
info: Info1D;
|
|
38
38
|
xDomain: number[];
|
|
39
39
|
activeTab: string;
|
|
40
|
-
preferences:
|
|
40
|
+
preferences: WorkspacePanelPreferences['ranges'];
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export interface RangesTableDataMetaInfo {
|
|
@@ -18,91 +18,91 @@ const formatFields: NucleusPreferenceField[] = [
|
|
|
18
18
|
{
|
|
19
19
|
id: 1,
|
|
20
20
|
label: 'Serial number :',
|
|
21
|
-
checkFieldName: 'showSerialNumber',
|
|
21
|
+
checkFieldName: 'tablePreferences.showSerialNumber',
|
|
22
22
|
hideFormatField: true,
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
id: 2,
|
|
26
26
|
label: 'Assignment label :',
|
|
27
|
-
checkFieldName: 'showAssignmentLabel',
|
|
27
|
+
checkFieldName: 'tablePreferences.showAssignmentLabel',
|
|
28
28
|
hideFormatField: true,
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
id: 3,
|
|
32
32
|
label: 'From (ppm) :',
|
|
33
|
-
checkFieldName: 'from.show',
|
|
34
|
-
formatFieldName: 'from.format',
|
|
33
|
+
checkFieldName: 'tablePreferences.from.show',
|
|
34
|
+
formatFieldName: 'tablePreferences.from.format',
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
id: 4,
|
|
38
38
|
label: 'To (ppm) :',
|
|
39
|
-
checkFieldName: 'to.show',
|
|
40
|
-
formatFieldName: 'to.format',
|
|
39
|
+
checkFieldName: 'tablePreferences.to.show',
|
|
40
|
+
formatFieldName: 'tablePreferences.to.format',
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
id: 5,
|
|
44
44
|
label: 'Absolute integration :',
|
|
45
|
-
checkFieldName: 'absolute.show',
|
|
46
|
-
formatFieldName: 'absolute.format',
|
|
45
|
+
checkFieldName: 'tablePreferences.absolute.show',
|
|
46
|
+
formatFieldName: 'tablePreferences.absolute.format',
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
id: 6,
|
|
50
50
|
label: 'Relative integration :',
|
|
51
|
-
checkFieldName: 'relative.show',
|
|
52
|
-
formatFieldName: 'relative.format',
|
|
51
|
+
checkFieldName: 'tablePreferences.relative.show',
|
|
52
|
+
formatFieldName: 'tablePreferences.relative.format',
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
id: 7,
|
|
56
56
|
label: 'δ (ppm) :',
|
|
57
|
-
checkFieldName: 'deltaPPM.show',
|
|
58
|
-
formatFieldName: 'deltaPPM.format',
|
|
57
|
+
checkFieldName: 'tablePreferences.deltaPPM.show',
|
|
58
|
+
formatFieldName: 'tablePreferences.deltaPPM.format',
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
id: 8,
|
|
62
62
|
label: 'δ (Hz) :',
|
|
63
|
-
checkFieldName: 'deltaHz.show',
|
|
64
|
-
formatFieldName: 'deltaHz.format',
|
|
63
|
+
checkFieldName: 'tablePreferences.deltaHz.show',
|
|
64
|
+
formatFieldName: 'tablePreferences.deltaHz.format',
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
id: 9,
|
|
68
68
|
label: 'Coupling (Hz) :',
|
|
69
|
-
checkFieldName: 'coupling.show',
|
|
70
|
-
formatFieldName: 'coupling.format',
|
|
69
|
+
checkFieldName: 'tablePreferences.coupling.show',
|
|
70
|
+
formatFieldName: 'tablePreferences.coupling.format',
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
id: 10,
|
|
74
74
|
label: 'Kind :',
|
|
75
|
-
checkFieldName: 'showKind',
|
|
75
|
+
checkFieldName: 'tablePreferences.showKind',
|
|
76
76
|
hideFormatField: true,
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
id: 11,
|
|
80
80
|
label: 'Multiplicity :',
|
|
81
|
-
checkFieldName: 'showMultiplicity',
|
|
81
|
+
checkFieldName: 'tablePreferences.showMultiplicity',
|
|
82
82
|
hideFormatField: true,
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
85
|
id: 12,
|
|
86
86
|
label: 'Assignment links :',
|
|
87
|
-
checkFieldName: 'showAssignment',
|
|
87
|
+
checkFieldName: 'tablePreferences.showAssignment',
|
|
88
88
|
hideFormatField: true,
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
id: 13,
|
|
92
92
|
label: 'Delete action :',
|
|
93
|
-
checkFieldName: 'showDeleteAction',
|
|
93
|
+
checkFieldName: 'tablePreferences.showDeleteAction',
|
|
94
94
|
hideFormatField: true,
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
id: 14,
|
|
98
98
|
label: 'Zoom action :',
|
|
99
|
-
checkFieldName: 'showZoomAction',
|
|
99
|
+
checkFieldName: 'tablePreferences.showZoomAction',
|
|
100
100
|
hideFormatField: true,
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
id: 15,
|
|
104
104
|
label: 'Edit action :',
|
|
105
|
-
checkFieldName: 'showEditAction',
|
|
105
|
+
checkFieldName: 'tablePreferences.showEditAction',
|
|
106
106
|
hideFormatField: true,
|
|
107
107
|
},
|
|
108
108
|
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import type { Info1D } from '@zakodium/nmr-types';
|
|
3
|
-
import type {
|
|
3
|
+
import type { WorkspacePanelPreferences } from '@zakodium/nmrium-core';
|
|
4
4
|
import { FaLink } from 'react-icons/fa';
|
|
5
5
|
|
|
6
6
|
import { withDialog } from '../../elements/DialogManager.js';
|
|
@@ -61,7 +61,7 @@ const Table = styled.table`
|
|
|
61
61
|
`;
|
|
62
62
|
|
|
63
63
|
interface RangesTableProps extends TableContextMenuProps {
|
|
64
|
-
preferences:
|
|
64
|
+
preferences: WorkspacePanelPreferences['ranges'];
|
|
65
65
|
tableData: RangesTableDataRow[];
|
|
66
66
|
activeTab: string;
|
|
67
67
|
info: Info1D;
|
|
@@ -79,6 +79,8 @@ export default function RangesTable(props: RangesTableProps) {
|
|
|
79
79
|
info,
|
|
80
80
|
} = props;
|
|
81
81
|
|
|
82
|
+
const { tablePreferences } = preferences;
|
|
83
|
+
|
|
82
84
|
const element = extractChemicalElement(activeTab);
|
|
83
85
|
const { items: sortedData, isSortedDesc, onSort } = useTableSortBy(tableData);
|
|
84
86
|
const data = useMapRanges(sortedData);
|
|
@@ -92,9 +94,9 @@ export default function RangesTable(props: RangesTableProps) {
|
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
const showActions =
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
tablePreferences.showDeleteAction ||
|
|
98
|
+
tablePreferences.showEditAction ||
|
|
99
|
+
tablePreferences.showZoomAction;
|
|
98
100
|
|
|
99
101
|
return (
|
|
100
102
|
<>
|
|
@@ -102,43 +104,43 @@ export default function RangesTable(props: RangesTableProps) {
|
|
|
102
104
|
<Table>
|
|
103
105
|
<thead>
|
|
104
106
|
<tr>
|
|
105
|
-
{
|
|
106
|
-
{
|
|
107
|
+
{tablePreferences.showSerialNumber && <th>#</th>}
|
|
108
|
+
{tablePreferences.showAssignmentLabel && (
|
|
107
109
|
<th title="Assignment">Assignment</th>
|
|
108
110
|
)}
|
|
109
|
-
{
|
|
111
|
+
{tablePreferences.from.show && (
|
|
110
112
|
<th id="from" {...onSort}>
|
|
111
113
|
From
|
|
112
114
|
{isSortedDesc('from').content}
|
|
113
115
|
</th>
|
|
114
116
|
)}
|
|
115
|
-
{
|
|
117
|
+
{tablePreferences.to.show && (
|
|
116
118
|
<th id="to" {...onSort}>
|
|
117
119
|
To {isSortedDesc('to').content}
|
|
118
120
|
</th>
|
|
119
121
|
)}
|
|
120
|
-
{
|
|
122
|
+
{tablePreferences.deltaPPM.show && (
|
|
121
123
|
<th id="from" {...onSort}>
|
|
122
124
|
δ (ppm) {isSortedDesc('from').content}
|
|
123
125
|
</th>
|
|
124
126
|
)}
|
|
125
|
-
{
|
|
127
|
+
{tablePreferences.deltaHz.show && <th>δ (Hz) </th>}
|
|
126
128
|
|
|
127
|
-
{
|
|
129
|
+
{tablePreferences.relative.show && (
|
|
128
130
|
<th id="integration" {...onSort}>
|
|
129
131
|
Rel. {element} {isSortedDesc('integration').content}
|
|
130
132
|
</th>
|
|
131
133
|
)}
|
|
132
|
-
{
|
|
133
|
-
{
|
|
134
|
-
{
|
|
134
|
+
{tablePreferences.absolute.show && <th>Absolute</th>}
|
|
135
|
+
{tablePreferences.showMultiplicity && <th>Mult.</th>}
|
|
136
|
+
{tablePreferences.coupling.show && <th>J (Hz)</th>}
|
|
135
137
|
|
|
136
|
-
{
|
|
138
|
+
{tablePreferences.showAssignment && (
|
|
137
139
|
<th title="Assign multiplets">
|
|
138
140
|
<FaLink style={{ fontSize: 10, margin: 'auto' }} />
|
|
139
141
|
</th>
|
|
140
142
|
)}
|
|
141
|
-
{
|
|
143
|
+
{tablePreferences.showKind && <th>Kind</th>}
|
|
142
144
|
{showActions && <th>{''}</th>}
|
|
143
145
|
</tr>
|
|
144
146
|
</thead>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Info1D } from '@zakodium/nmr-types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { WorkspacePanelPreferences } from '@zakodium/nmrium-core';
|
|
3
3
|
import type { CSSProperties, MouseEvent } from 'react';
|
|
4
4
|
import { useCallback, useMemo } from 'react';
|
|
5
5
|
|
|
@@ -35,7 +35,7 @@ const ConstantlyHighlightedRowStyle = {
|
|
|
35
35
|
|
|
36
36
|
interface RangesTableRowProps extends TableContextMenuProps {
|
|
37
37
|
rowData: RangeData;
|
|
38
|
-
preferences:
|
|
38
|
+
preferences: WorkspacePanelPreferences['ranges'];
|
|
39
39
|
info: Info1D;
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -67,7 +67,7 @@ export default function RangesTableRow(props: RangesTableRowProps) {
|
|
|
67
67
|
rowData,
|
|
68
68
|
onContextMenuSelect,
|
|
69
69
|
contextMenu = [],
|
|
70
|
-
preferences,
|
|
70
|
+
preferences: { tablePreferences },
|
|
71
71
|
info,
|
|
72
72
|
} = props;
|
|
73
73
|
const dispatch = useDispatch();
|
|
@@ -181,12 +181,12 @@ export default function RangesTableRow(props: RangesTableRowProps) {
|
|
|
181
181
|
as="tr"
|
|
182
182
|
style={trStyle}
|
|
183
183
|
>
|
|
184
|
-
{
|
|
184
|
+
{tablePreferences.showSerialNumber && (
|
|
185
185
|
<td {...rowSpanTags} {...onHoverRange}>
|
|
186
186
|
{rowData.tableMetaInfo.rowIndex + 1}
|
|
187
187
|
</td>
|
|
188
188
|
)}
|
|
189
|
-
{
|
|
189
|
+
{tablePreferences.showAssignmentLabel && (
|
|
190
190
|
<SignalAssignmentColumn
|
|
191
191
|
row={rowData}
|
|
192
192
|
highlight={highlightSignal}
|
|
@@ -194,72 +194,72 @@ export default function RangesTableRow(props: RangesTableRowProps) {
|
|
|
194
194
|
/>
|
|
195
195
|
)}
|
|
196
196
|
|
|
197
|
-
{
|
|
197
|
+
{tablePreferences.from.show && (
|
|
198
198
|
<RangeColumn
|
|
199
199
|
value={rowData.from}
|
|
200
200
|
rowSpanTags={rowSpanTags}
|
|
201
201
|
onHover={onHoverRange}
|
|
202
|
-
format={
|
|
202
|
+
format={tablePreferences.from.format}
|
|
203
203
|
/>
|
|
204
204
|
)}
|
|
205
|
-
{
|
|
205
|
+
{tablePreferences.to.show && (
|
|
206
206
|
<RangeColumn
|
|
207
207
|
value={rowData.to}
|
|
208
208
|
rowSpanTags={rowSpanTags}
|
|
209
209
|
onHover={onHoverRange}
|
|
210
|
-
format={
|
|
210
|
+
format={tablePreferences.to.format}
|
|
211
211
|
/>
|
|
212
212
|
)}
|
|
213
213
|
|
|
214
|
-
{
|
|
214
|
+
{tablePreferences.deltaPPM.show && (
|
|
215
215
|
<SignalDeltaColumn
|
|
216
216
|
row={rowData}
|
|
217
217
|
rowSpanTags={rowSpanTags}
|
|
218
218
|
onHover={onHoverSignal}
|
|
219
|
-
format={
|
|
219
|
+
format={tablePreferences.deltaPPM.format}
|
|
220
220
|
/>
|
|
221
221
|
)}
|
|
222
|
-
{
|
|
222
|
+
{tablePreferences.deltaHz.show && (
|
|
223
223
|
<SignalDeltaHzColumn
|
|
224
224
|
row={rowData}
|
|
225
225
|
rowSpanTags={rowSpanTags}
|
|
226
226
|
onHover={onHoverSignal}
|
|
227
|
-
format={
|
|
227
|
+
format={tablePreferences.deltaHz.format}
|
|
228
228
|
info={info}
|
|
229
229
|
/>
|
|
230
230
|
)}
|
|
231
231
|
|
|
232
|
-
{
|
|
232
|
+
{tablePreferences.relative.show && (
|
|
233
233
|
<RelativeColumn
|
|
234
234
|
row={rowData}
|
|
235
235
|
rowSpanTags={rowSpanTags}
|
|
236
236
|
onHover={onHoverRange}
|
|
237
|
-
format={
|
|
237
|
+
format={tablePreferences.relative.format}
|
|
238
238
|
/>
|
|
239
239
|
)}
|
|
240
240
|
|
|
241
|
-
{
|
|
241
|
+
{tablePreferences.absolute.show && (
|
|
242
242
|
<AbsoluteColumn
|
|
243
243
|
row={rowData}
|
|
244
244
|
rowSpanTags={rowSpanTags}
|
|
245
245
|
onHover={onHoverRange}
|
|
246
|
-
format={
|
|
246
|
+
format={tablePreferences.absolute.format}
|
|
247
247
|
/>
|
|
248
248
|
)}
|
|
249
|
-
{
|
|
249
|
+
{tablePreferences.showMultiplicity && (
|
|
250
250
|
<td {...onHoverSignal}>
|
|
251
251
|
{rowData.tableMetaInfo.signal?.multiplicity ?? 'm'}
|
|
252
252
|
</td>
|
|
253
253
|
)}
|
|
254
254
|
|
|
255
|
-
{
|
|
255
|
+
{tablePreferences.coupling.show && (
|
|
256
256
|
<CouplingColumn
|
|
257
257
|
row={rowData}
|
|
258
258
|
onHover={onHoverSignal}
|
|
259
|
-
format={
|
|
259
|
+
format={tablePreferences.coupling.format}
|
|
260
260
|
/>
|
|
261
261
|
)}
|
|
262
|
-
{
|
|
262
|
+
{tablePreferences.showAssignment && (
|
|
263
263
|
<SignalAssignmentsColumn
|
|
264
264
|
row={rowData}
|
|
265
265
|
assignment={assignmentSignal}
|
|
@@ -274,10 +274,10 @@ export default function RangesTableRow(props: RangesTableRowProps) {
|
|
|
274
274
|
onHoverSignal={onHoverSignal}
|
|
275
275
|
onHoverRange={onHoverRange}
|
|
276
276
|
rowSpanTags={rowSpanTags}
|
|
277
|
-
showKind={
|
|
278
|
-
showDeleteAction={
|
|
279
|
-
showEditAction={
|
|
280
|
-
showZoomAction={
|
|
277
|
+
showKind={tablePreferences.showKind}
|
|
278
|
+
showDeleteAction={tablePreferences.showDeleteAction}
|
|
279
|
+
showEditAction={tablePreferences.showEditAction}
|
|
280
|
+
showZoomAction={tablePreferences.showZoomAction}
|
|
281
281
|
/>
|
|
282
282
|
</ContextMenu>
|
|
283
283
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Tooltip } from '@blueprintjs/core';
|
|
1
2
|
import type {
|
|
2
3
|
ActiveSpectrum,
|
|
3
4
|
JpathTableColumn,
|
|
@@ -328,7 +329,17 @@ export function SpectraTable(props: SpectraTableProps) {
|
|
|
328
329
|
|
|
329
330
|
const cell: Column<Spectrum> = {
|
|
330
331
|
Header: () => <ColumnHeader label={col.label} col={col} />,
|
|
331
|
-
|
|
332
|
+
Cell: ({ row }: CellProps<Spectrum>) => {
|
|
333
|
+
const val = getValueByPath(row.original, jpath, format);
|
|
334
|
+
return (
|
|
335
|
+
<Tooltip
|
|
336
|
+
content={val}
|
|
337
|
+
renderTarget={({ isOpen, ...targetProps }) => (
|
|
338
|
+
<div {...targetProps}>{val}</div>
|
|
339
|
+
)}
|
|
340
|
+
/>
|
|
341
|
+
);
|
|
342
|
+
},
|
|
332
343
|
...(cellRender && { Cell: cellRender }),
|
|
333
344
|
id: `${index}`,
|
|
334
345
|
style,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Tooltip } from '@blueprintjs/core';
|
|
1
2
|
import type { Spectrum } from '@zakodium/nmrium-core';
|
|
2
3
|
import dlv from 'dlv';
|
|
3
4
|
|
|
@@ -6,6 +7,17 @@ interface RenderAsHTMLProps {
|
|
|
6
7
|
jpath: string | string[];
|
|
7
8
|
}
|
|
8
9
|
|
|
10
|
+
interface HTMLContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
html: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function HTMLContent({ html }: HTMLContentProps) {
|
|
15
|
+
return (
|
|
16
|
+
// eslint-disable-next-line react/no-danger
|
|
17
|
+
<div dangerouslySetInnerHTML={{ __html: html }} />
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
9
21
|
export function RenderAsHTML(props: RenderAsHTMLProps) {
|
|
10
22
|
const { data, jpath } = props;
|
|
11
23
|
|
|
@@ -15,11 +27,17 @@ export function RenderAsHTML(props: RenderAsHTMLProps) {
|
|
|
15
27
|
return value;
|
|
16
28
|
}
|
|
17
29
|
|
|
30
|
+
const formattedHTML = formatValueAsHTML(value);
|
|
31
|
+
|
|
18
32
|
return (
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
<Tooltip
|
|
34
|
+
content={<HTMLContent html={formattedHTML} />}
|
|
35
|
+
renderTarget={({ isOpen, ...targetProps }) => {
|
|
36
|
+
return (
|
|
37
|
+
<div {...targetProps}>
|
|
38
|
+
<HTMLContent html={formattedHTML} />
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
23
41
|
}}
|
|
24
42
|
/>
|
|
25
43
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Tooltip } from '@blueprintjs/core';
|
|
1
2
|
import type { Spectrum } from '@zakodium/nmrium-core';
|
|
2
3
|
import { SvgNmr2D, SvgNmrFid, SvgNmrFt } from 'cheminfo-font';
|
|
3
4
|
import type { CSSProperties } from 'react';
|
|
@@ -24,13 +25,21 @@ const styles: Record<'info' | 'icon', CSSProperties> = {
|
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
export function SpectrumName(props: SpectrumNameProps) {
|
|
28
|
+
const name = props.data.info.name;
|
|
27
29
|
return (
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
<Tooltip
|
|
31
|
+
content={name}
|
|
32
|
+
renderTarget={({ isOpen, ...targetProps }) => {
|
|
33
|
+
return (
|
|
34
|
+
<div style={styles.info} {...targetProps}>
|
|
35
|
+
<div style={styles.icon}>
|
|
36
|
+
<SpectraIcon {...props} />
|
|
37
|
+
</div>
|
|
38
|
+
<span>{props.data.info.name}</span>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}}
|
|
42
|
+
/>
|
|
34
43
|
);
|
|
35
44
|
}
|
|
36
45
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PopoverNext } from '@blueprintjs/core';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
import type { Display1D, Display2D } from '@zakodium/nmrium-core';
|
|
4
4
|
|
|
@@ -42,7 +42,8 @@ export function SpectrumSetting({
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
|
-
<
|
|
45
|
+
<PopoverNext
|
|
46
|
+
lazy
|
|
46
47
|
interactionKind="click"
|
|
47
48
|
placement="left-start"
|
|
48
49
|
canEscapeKeyClose
|
|
@@ -36,11 +36,7 @@ import {
|
|
|
36
36
|
} from './utilities/Utilities.js';
|
|
37
37
|
|
|
38
38
|
type EditCorrelationAction =
|
|
39
|
-
| '
|
|
40
|
-
| 'move'
|
|
41
|
-
| 'remove'
|
|
42
|
-
| 'unmove'
|
|
43
|
-
| 'setPathLength';
|
|
39
|
+
'add' | 'move' | 'remove' | 'unmove' | 'setPathLength';
|
|
44
40
|
|
|
45
41
|
export type OnEditCorrelationCallback = (
|
|
46
42
|
editedCorrelations: Correlation[],
|
|
@@ -9,19 +9,26 @@ export function useMoleculeAnnotationCore(
|
|
|
9
9
|
moleculeView: MoleculeView,
|
|
10
10
|
) {
|
|
11
11
|
const dispatch = useDispatch();
|
|
12
|
-
const { atomAnnotation:
|
|
13
|
-
function
|
|
14
|
-
return
|
|
12
|
+
const { atomAnnotation: activeAnnotation } = moleculeView || {};
|
|
13
|
+
function isActiveAnnotation(annotation: Annotation) {
|
|
14
|
+
return activeAnnotation === annotation;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
function setAtomAnnotation(annotation: Annotation) {
|
|
18
|
+
if (activeAnnotation === annotation) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
20
22
|
dispatch({
|
|
21
23
|
type: 'CHANGE_MOLECULE_ANNOTATION',
|
|
22
|
-
payload: { id, atomAnnotation },
|
|
24
|
+
payload: { id, atomAnnotation: annotation },
|
|
23
25
|
});
|
|
24
26
|
}
|
|
27
|
+
|
|
28
|
+
function toggleAtomAnnotation(annotation: Annotation) {
|
|
29
|
+
setAtomAnnotation(activeAnnotation === annotation ? 'none' : annotation);
|
|
30
|
+
}
|
|
31
|
+
|
|
25
32
|
function handleToggleMoleculeLabel() {
|
|
26
33
|
dispatch({
|
|
27
34
|
type: 'TOGGLE_MOLECULE_LABEL',
|
|
@@ -30,7 +37,8 @@ export function useMoleculeAnnotationCore(
|
|
|
30
37
|
}
|
|
31
38
|
return {
|
|
32
39
|
handleToggleMoleculeLabel,
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
isActiveAnnotation,
|
|
41
|
+
setAtomAnnotation,
|
|
42
|
+
toggleAtomAnnotation,
|
|
35
43
|
};
|
|
36
44
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Icon,
|
|
1
|
+
import { Icon, PopoverNext } from '@blueprintjs/core';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
|
|
4
4
|
const MixedBadge = styled.div`
|
|
@@ -52,7 +52,8 @@ export function MixedValuesBadge({ values }: MixedValuesBadgeProps) {
|
|
|
52
52
|
if (!values) return null;
|
|
53
53
|
|
|
54
54
|
return (
|
|
55
|
-
<
|
|
55
|
+
<PopoverNext
|
|
56
|
+
lazy
|
|
56
57
|
placement="bottom"
|
|
57
58
|
interactionKind="hover"
|
|
58
59
|
renderTarget={({ ref, ...targetProps }) => (
|