nmrium 0.42.0 → 0.43.1-pre.1692874523
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/ApodizationLine.js +1 -1
- package/lib/component/1d/Chart1D.js +3 -2
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib/component/1d/Line.js +1 -1
- package/lib/component/1d/Viewer1D.js +15 -3
- package/lib/component/1d/integral/IntegralResizable.js +4 -3
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +3 -1
- package/lib/component/1d/peaks/PeakAnnotations.js +20 -25
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts +2 -0
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js +59 -0
- package/lib/component/1d/peaks/PeakEditionManager.d.ts +18 -0
- package/lib/component/1d/peaks/PeakEditionManager.js +98 -0
- package/lib/component/1d/peaks/Peaks.d.ts +1 -0
- package/lib/component/1d/peaks/Peaks.js +22 -0
- package/lib/component/1d/ranges/Range.js +3 -1
- package/lib/component/1d/tool/BaseLineZones.d.ts +1 -1
- package/lib/component/1d/tool/BaseLineZones.js +11 -31
- package/lib/component/1d/utilities/intersectionResolver.d.ts +25 -0
- package/lib/component/1d/utilities/intersectionResolver.js +71 -0
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +2 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +17 -16
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +2 -2
- package/lib/component/2d/SlicingView.js +1 -1
- package/lib/component/2d/Viewer2D.js +1 -3
- package/lib/component/2d/ft/Contours.js +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.d.ts +5 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.js +48 -8
- package/lib/component/assignment/index.d.ts +6 -1
- package/lib/component/assignment/index.js +5 -1
- package/lib/component/context/DispatchContext.d.ts +3 -2
- package/lib/component/context/KeyModifierContext.d.ts +13 -0
- package/lib/component/context/KeyModifierContext.js +39 -0
- package/lib/component/context/PreferencesContext.d.ts +39 -39
- package/lib/component/elements/Button.js +2 -0
- package/lib/component/elements/CounterLabel.d.ts +7 -0
- package/lib/component/elements/CounterLabel.js +12 -0
- package/lib/component/elements/EditableColumn.js +12 -6
- package/lib/component/elements/Input.d.ts +3 -12
- package/lib/component/elements/Input.js +24 -76
- package/lib/component/elements/Message.js +0 -1
- package/lib/component/elements/NumberInput.d.ts +1 -0
- package/lib/component/elements/NumberInput.js +10 -3
- package/lib/component/elements/PreferencesButton.d.ts +4 -0
- package/lib/component/elements/PreferencesButton.js +6 -0
- package/lib/component/elements/formik/FormikInput.d.ts +2 -2
- package/lib/component/elements/formik/FormikInput.js +3 -6
- package/lib/component/elements/formik/FormikOnChange.js +1 -1
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib/component/header/ApodizationOptionsPanel.js +23 -14
- package/lib/component/header/BaseLineCorrectionPanel.js +31 -10
- package/lib/component/header/Header.d.ts +10 -3
- package/lib/component/header/Header.js +6 -6
- package/lib/component/header/ZeroFillingOptionsPanel.js +37 -31
- package/lib/component/highlight/index.d.ts +1 -0
- package/lib/component/highlight/index.js +1 -0
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.js +1 -0
- package/lib/component/hooks/useCheckToolsVisibility.js +7 -3
- package/lib/component/hooks/useResizerStatus.d.ts +2 -0
- package/lib/component/hooks/useResizerStatus.js +7 -0
- package/lib/component/hooks/useSpectrum.js +1 -1
- package/lib/component/main/ErrorOverlay.js +20 -0
- package/lib/component/main/InnerNMRium.d.ts +7 -0
- package/lib/component/main/InnerNMRium.js +52 -0
- package/lib/component/main/InnerNMRiumContents.d.ts +14 -0
- package/lib/component/main/InnerNMRiumContents.js +88 -0
- package/lib/component/main/NMRium.d.ts +23 -0
- package/lib/component/main/NMRium.js +13 -0
- package/lib/component/main/NMRiumStateProvider.d.ts +9 -0
- package/lib/component/main/NMRiumStateProvider.js +74 -0
- package/lib/component/{SplitPaneWrapper.js → main/SplitPaneWrapper.js} +1 -1
- package/lib/component/main/StateError.d.ts +4 -0
- package/lib/component/main/StateError.js +16 -0
- package/lib/component/main/index.d.ts +3 -0
- package/lib/component/main/index.js +3 -0
- package/lib/component/main/types.d.ts +18 -0
- package/lib/component/main/types.js +2 -0
- package/lib/component/modal/AlignSpectraModal.js +78 -29
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +5 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +12 -15
- package/lib/component/modal/MultipletAnalysisModal.js +1 -1
- package/lib/component/modal/PredictSpectraModal.js +1 -1
- package/lib/component/modal/{AboutUsModal.js → aboutUs/AboutUsModal.js} +4 -3
- package/lib/component/modal/aboutUs/AboutUsZakodium.d.ts +1 -0
- package/lib/component/modal/aboutUs/AboutUsZakodium.js +33 -0
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +5 -16
- package/lib/component/modal/changeSum/ChangeSumModal.js +6 -115
- package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts +18 -0
- package/lib/component/modal/changeSum/ChangeSumModalContents.js +94 -0
- package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +2 -2
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
- package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +1 -1
- package/lib/component/modal/setting/settingsValidation.js +5 -1
- package/lib/component/panels/InformationPanel.js +9 -100
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +6 -11
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +2 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +3 -9
- package/lib/component/panels/MoleculesPanel/Utilities.js +14 -10
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +13 -9
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +5 -5
- package/lib/component/panels/Panels.js +6 -7
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +11 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +6 -10
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -2
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -6
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +2 -3
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +8 -9
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +3 -2
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +18 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +3 -40
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.d.ts +18 -0
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +53 -0
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +3 -4
- package/lib/component/panels/header/DefaultPanelHeader.js +11 -13
- package/lib/component/panels/predictionPanel/PredictionPanel.js +3 -3
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +0 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +1 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -2
- package/lib/component/reducer/IgnoreActions.js +1 -1
- package/lib/component/reducer/Reducer.d.ts +3 -8
- package/lib/component/reducer/Reducer.js +34 -8
- package/lib/component/reducer/actions/DomainActions.js +2 -3
- package/lib/component/reducer/actions/FiltersActions.d.ts +32 -11
- package/lib/component/reducer/actions/FiltersActions.js +96 -28
- package/lib/component/reducer/actions/IntegralsActions.d.ts +6 -2
- package/lib/component/reducer/actions/IntegralsActions.js +44 -20
- package/lib/component/reducer/actions/MoleculeActions.js +4 -4
- package/lib/component/reducer/actions/PeaksActions.d.ts +6 -4
- package/lib/component/reducer/actions/PeaksActions.js +19 -1
- package/lib/component/reducer/actions/PreferencesActions.js +1 -2
- package/lib/component/reducer/actions/RangesActions.d.ts +6 -2
- package/lib/component/reducer/actions/RangesActions.js +31 -3
- package/lib/component/reducer/actions/ToolsActions.js +10 -10
- package/lib/component/reducer/core/Constants.d.ts +0 -4
- package/lib/component/reducer/core/Constants.js +0 -5
- package/lib/component/reducer/helper/ZoomHistoryManager.js +1 -2
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +1 -1
- package/lib/component/toolbar/FunctionToolBar.js +13 -3
- package/lib/component/toolbar/ToolTypes.d.ts +3 -2
- package/lib/component/toolbar/ToolTypes.js +57 -22
- package/lib/component/utility/export.js +7 -4
- package/lib/component/utility/filterType.d.ts +3 -0
- package/lib/component/utility/filterType.js +1 -0
- package/lib/component/workspaces/basic.js +2 -0
- package/lib/component/workspaces/embedded.js +2 -0
- package/lib/component/workspaces/exercise.js +2 -0
- package/lib/component/workspaces/prediction.js +9 -0
- package/lib/component/workspaces/process1D.js +2 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js +2 -0
- package/lib/data/PredictionManager.d.ts +3 -3
- package/lib/data/PredictionManager.js +10 -10
- package/lib/data/constants/References.d.ts +5 -3
- package/lib/data/data1d/Spectrum1D/getReferenceShift.d.ts +10 -1
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +2 -8
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -1
- package/lib/data/molecules/Molecule.js +2 -2
- package/lib/data/utilities/checkModifierKeyActivated.d.ts +1 -1
- package/lib/data/utilities/checkModifierKeyActivated.js +8 -13
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +3 -2
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib-cjs/component/1d/Line.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +15 -3
- package/lib-cjs/component/1d/integral/IntegralResizable.js +4 -3
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +3 -1
- package/lib-cjs/component/1d/peaks/PeakAnnotations.js +19 -24
- package/lib-cjs/component/1d/peaks/PeakAnnotationsSpreadMode.js +64 -0
- package/lib-cjs/component/1d/peaks/PeakEditionManager.js +129 -0
- package/lib-cjs/component/1d/peaks/Peaks.js +29 -0
- package/lib-cjs/component/1d/ranges/Range.js +3 -1
- package/lib-cjs/component/1d/tool/BaseLineZones.js +11 -34
- package/lib-cjs/component/1d/utilities/intersectionResolver.js +75 -0
- package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +17 -16
- package/lib-cjs/component/2d/SlicingView.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +1 -3
- package/lib-cjs/component/2d/ft/Contours.js +1 -1
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +47 -7
- package/lib-cjs/component/assignment/index.js +5 -1
- package/lib-cjs/component/context/KeyModifierContext.js +44 -0
- package/lib-cjs/component/elements/Button.js +2 -0
- package/lib-cjs/component/elements/CounterLabel.js +16 -0
- package/lib-cjs/component/elements/EditableColumn.js +12 -6
- package/lib-cjs/component/elements/Input.js +23 -75
- package/lib-cjs/component/elements/Message.js +0 -1
- package/lib-cjs/component/elements/NumberInput.js +12 -2
- package/lib-cjs/component/elements/PreferencesButton.js +13 -0
- package/lib-cjs/component/elements/formik/FormikInput.js +3 -6
- package/lib-cjs/component/elements/formik/FormikOnChange.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +23 -14
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +30 -9
- package/lib-cjs/component/header/Header.js +6 -6
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +35 -29
- package/lib-cjs/component/highlight/index.js +1 -0
- package/lib-cjs/component/hooks/useActiveSpectrumPeaksViewState.js +1 -0
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +7 -3
- package/lib-cjs/component/hooks/useResizerStatus.js +11 -0
- package/lib-cjs/component/hooks/useSpectrum.js +1 -1
- package/lib-cjs/component/main/ErrorOverlay.js +26 -0
- package/lib-cjs/component/main/InnerNMRium.js +82 -0
- package/lib-cjs/component/main/InnerNMRiumContents.js +95 -0
- package/lib-cjs/component/main/NMRium.js +19 -0
- package/lib-cjs/component/main/NMRiumStateProvider.js +80 -0
- package/lib-cjs/component/{SplitPaneWrapper.js → main/SplitPaneWrapper.js} +1 -1
- package/lib-cjs/component/main/StateError.js +20 -0
- package/lib-cjs/component/main/index.js +21 -0
- package/lib-cjs/component/main/types.js +3 -0
- package/lib-cjs/component/modal/AlignSpectraModal.js +100 -28
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +11 -17
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +1 -1
- package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
- package/lib-cjs/component/modal/{AboutUsModal.js → aboutUs/AboutUsModal.js} +4 -3
- package/lib-cjs/component/modal/aboutUs/AboutUsZakodium.js +39 -0
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +6 -141
- package/lib-cjs/component/modal/changeSum/ChangeSumModalContents.js +124 -0
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -2
- package/lib-cjs/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +4 -0
- package/lib-cjs/component/panels/InformationPanel.js +7 -98
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +29 -11
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +14 -10
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +4 -4
- package/lib-cjs/component/panels/Panels.js +6 -7
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +32 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +29 -10
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +29 -6
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +4 -5
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +7 -8
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +26 -2
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +3 -40
- package/lib-cjs/component/panels/databasePanel/DatabaseSearchOptions.js +60 -0
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +12 -12
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +3 -3
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +0 -1
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulation.js +1 -1
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -2
- package/lib-cjs/component/reducer/IgnoreActions.js +1 -1
- package/lib-cjs/component/reducer/Reducer.js +33 -7
- package/lib-cjs/component/reducer/actions/DomainActions.js +2 -3
- package/lib-cjs/component/reducer/actions/FiltersActions.js +98 -28
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +45 -20
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +3 -3
- package/lib-cjs/component/reducer/actions/PeaksActions.js +20 -1
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +1 -2
- package/lib-cjs/component/reducer/actions/RangesActions.js +31 -2
- package/lib-cjs/component/reducer/actions/ToolsActions.js +9 -9
- package/lib-cjs/component/reducer/core/Constants.js +1 -6
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +1 -2
- package/lib-cjs/component/toolbar/FunctionToolBar.js +13 -3
- package/lib-cjs/component/toolbar/ToolTypes.js +57 -22
- package/lib-cjs/component/utility/export.js +7 -4
- package/lib-cjs/component/utility/filterType.js +2 -0
- package/lib-cjs/component/workspaces/basic.js +2 -0
- package/lib-cjs/component/workspaces/embedded.js +2 -0
- package/lib-cjs/component/workspaces/exercise.js +2 -0
- package/lib-cjs/component/workspaces/prediction.js +9 -0
- package/lib-cjs/component/workspaces/process1D.js +2 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +2 -0
- package/lib-cjs/data/PredictionManager.js +9 -9
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +1 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -1
- package/lib-cjs/data/molecules/Molecule.js +2 -2
- package/lib-cjs/data/utilities/checkModifierKeyActivated.js +8 -13
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +26 -25
- package/lib/component/1d/peaks/PeakAnnotation.d.ts +0 -12
- package/lib/component/1d/peaks/PeakAnnotation.js +0 -116
- package/lib/component/ErrorOverlay.js +0 -27
- package/lib/component/NMRium.d.ts +0 -42
- package/lib/component/NMRium.js +0 -237
- package/lib/component/reducer/actions/GlobalActions.d.ts +0 -9
- package/lib/component/reducer/actions/GlobalActions.js +0 -4
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +0 -118
- package/lib-cjs/component/ErrorOverlay.js +0 -30
- package/lib-cjs/component/NMRium.js +0 -267
- package/lib-cjs/component/reducer/actions/GlobalActions.js +0 -7
- /package/lib/component/{ErrorOverlay.d.ts → main/ErrorOverlay.d.ts} +0 -0
- /package/lib/component/{SplitPaneWrapper.d.ts → main/SplitPaneWrapper.d.ts} +0 -0
- /package/lib/component/modal/{AboutUsModal.d.ts → aboutUs/AboutUsModal.d.ts} +0 -0
|
@@ -10,31 +10,35 @@ function getElements(activeTab) {
|
|
|
10
10
|
* In case of an heavy atom with bonded hydrogens the OCL id(s)
|
|
11
11
|
* and number of these hydrogens are added as well.
|
|
12
12
|
*
|
|
13
|
-
* @param {
|
|
13
|
+
* @param {DiaIDAndInfo} diaIDAndInfo - atom returned by OCLnmr component
|
|
14
14
|
* @param {string} activeTab - active tab
|
|
15
15
|
* @param {Axis} axis - current axis
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
|
-
export function extractFromAtom(
|
|
18
|
+
export function extractFromAtom(diaIDAndInfo, activeTab, axis) {
|
|
19
19
|
const elements = getElements(activeTab);
|
|
20
|
-
if (elements && elements.length > 0 &&
|
|
20
|
+
if (elements && elements.length > 0 && diaIDAndInfo) {
|
|
21
21
|
const dim = axis === 'x' ? 0 : axis === 'y' ? 1 : null;
|
|
22
22
|
switch (dim !== null && elements[dim]) {
|
|
23
|
-
case
|
|
23
|
+
case diaIDAndInfo.atomLabel: {
|
|
24
24
|
// take always oclID if atom type is same as element of activeTab)
|
|
25
|
-
return {
|
|
25
|
+
return {
|
|
26
|
+
oclIDs: [diaIDAndInfo.idCode],
|
|
27
|
+
nbAtoms: diaIDAndInfo.nbEquivalentAtoms,
|
|
28
|
+
};
|
|
26
29
|
}
|
|
27
30
|
case 'H': {
|
|
28
31
|
// if we are in proton spectrum and use then the IDs of attached hydrogens of an atom
|
|
29
32
|
return {
|
|
30
|
-
oclIDs:
|
|
31
|
-
nbAtoms:
|
|
33
|
+
oclIDs: diaIDAndInfo.attachedHydrogensIDCodes,
|
|
34
|
+
nbAtoms: diaIDAndInfo.nbEquivalentAtoms * diaIDAndInfo.nbAttachedHydrogens,
|
|
32
35
|
};
|
|
33
36
|
}
|
|
34
37
|
default:
|
|
35
38
|
return {
|
|
36
|
-
oclIDs: [
|
|
37
|
-
nbAtoms:
|
|
39
|
+
oclIDs: [diaIDAndInfo.idCode].concat(diaIDAndInfo.attachedHydrogensIDCodes),
|
|
40
|
+
nbAtoms: diaIDAndInfo.nbEquivalentAtoms +
|
|
41
|
+
diaIDAndInfo.nbEquivalentAtoms * diaIDAndInfo.nbAttachedHydrogens,
|
|
38
42
|
};
|
|
39
43
|
}
|
|
40
44
|
}
|
|
@@ -81,7 +85,7 @@ export function getCurrentDiaIDsToHighlight(assignmentData) {
|
|
|
81
85
|
const { highlighted, assignments } = assignmentData.data;
|
|
82
86
|
const assignment = highlighted ? assignments[highlighted.id] : null;
|
|
83
87
|
const axisHover = highlighted ? highlighted.axis : null;
|
|
84
|
-
if (axisHover && assignment
|
|
88
|
+
if (axisHover && assignment?.[axisHover]) {
|
|
85
89
|
return assignment[axisHover];
|
|
86
90
|
}
|
|
87
91
|
else {
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import { Ranges, Zones } from 'nmr-processing';
|
|
2
|
+
import { DiaIDAndInfo } from 'openchemlib-utils';
|
|
1
3
|
import { MouseEvent } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
displayerMode:
|
|
5
|
-
activeTab:
|
|
6
|
-
zones:
|
|
7
|
-
ranges:
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { DisplayerMode } from '../../reducer/Reducer';
|
|
5
|
+
interface UseAtomAssignmentProps {
|
|
6
|
+
displayerMode: DisplayerMode;
|
|
7
|
+
activeTab: string;
|
|
8
|
+
zones: Zones;
|
|
9
|
+
ranges: Ranges;
|
|
10
|
+
}
|
|
11
|
+
export default function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }: UseAtomAssignmentProps): {
|
|
12
|
+
handleOnAtomHover: (diaIDAndInfo: DiaIDAndInfo | undefined) => void;
|
|
13
|
+
handleOnClickAtom: (diaIDAndInfo: DiaIDAndInfo | undefined, event: MouseEvent) => void;
|
|
11
14
|
currentDiaIDsToHighlight: string[];
|
|
12
15
|
assignedDiaIDsMerged: string[];
|
|
13
16
|
};
|
|
17
|
+
export {};
|
|
@@ -6,7 +6,6 @@ import { filterForIDsWithAssignment } from '../../assignment/utilities/filterFor
|
|
|
6
6
|
import { useDispatch } from '../../context/DispatchContext';
|
|
7
7
|
import { useAlert } from '../../elements/popup/Alert';
|
|
8
8
|
import { HighlightEventSource, useHighlightData } from '../../highlight';
|
|
9
|
-
import { DISPLAYER_MODE } from '../../reducer/core/Constants';
|
|
10
9
|
import { extractFromAtom, findDatumAndSignalIndex, getCurrentDiaIDsToHighlight, getHighlightsOnHover, toggleDiaIDs, } from './Utilities';
|
|
11
10
|
export default function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }) {
|
|
12
11
|
const alert = useAlert();
|
|
@@ -41,10 +40,10 @@ export default function useAtomAssignment({ displayerMode, activeTab: nucleus, z
|
|
|
41
40
|
}, [onAtomHoverAction, onAtomHoverHighlights, highlightData]);
|
|
42
41
|
const data = useMemo(() => {
|
|
43
42
|
if (zones || ranges) {
|
|
44
|
-
if (displayerMode ===
|
|
43
|
+
if (displayerMode === '1D' && ranges?.values) {
|
|
45
44
|
return ranges.values;
|
|
46
45
|
}
|
|
47
|
-
else if (displayerMode ===
|
|
46
|
+
else if (displayerMode === '2D' && zones?.values) {
|
|
48
47
|
return zones.values;
|
|
49
48
|
}
|
|
50
49
|
}
|
|
@@ -100,14 +99,14 @@ export default function useAtomAssignment({ displayerMode, activeTab: nucleus, z
|
|
|
100
99
|
// see revision cc13abc18f77b6787b923e3c4edaef51750d9e90
|
|
101
100
|
return toggleDiaIDs(diaID, atomInformation);
|
|
102
101
|
}, []);
|
|
103
|
-
const handleOnClickAtom = useCallback((
|
|
102
|
+
const handleOnClickAtom = useCallback((diaIDAndInfo, event) => {
|
|
104
103
|
if (!checkModifierKeyActivated(event) && activeAssignment.activated) {
|
|
105
104
|
const { axis, id } = activeAssignment.activated;
|
|
106
105
|
if (id && axis) {
|
|
107
|
-
const atomInformation = extractFromAtom(
|
|
106
|
+
const atomInformation = extractFromAtom(diaIDAndInfo, nucleus, axis);
|
|
108
107
|
if (atomInformation.nbAtoms > 0) {
|
|
109
108
|
// save assignment in assignment hook
|
|
110
|
-
const dimension = displayerMode ===
|
|
109
|
+
const dimension = displayerMode === '1D' ? '1D' : '2D';
|
|
111
110
|
activeAssignment.toggle(atomInformation.oclIDs, dimension);
|
|
112
111
|
// save assignment (diaIDs) in range/zone data
|
|
113
112
|
const { datum, signalIndex } = findDatumAndSignalIndex(data, activeAssignment.id);
|
|
@@ -115,7 +114,7 @@ export default function useAtomAssignment({ displayerMode, activeTab: nucleus, z
|
|
|
115
114
|
// determine the level of setting the diaIDs array (range vs. signal level) and save there
|
|
116
115
|
// let nbAtoms = 0;
|
|
117
116
|
// on range/zone level
|
|
118
|
-
if (displayerMode ===
|
|
117
|
+
if (displayerMode === '1D') {
|
|
119
118
|
const range = datum;
|
|
120
119
|
let _diaIDs = [];
|
|
121
120
|
if (signalIndex === undefined) {
|
|
@@ -173,8 +172,8 @@ export default function useAtomAssignment({ displayerMode, activeTab: nucleus, z
|
|
|
173
172
|
nucleus,
|
|
174
173
|
toggleAssignment,
|
|
175
174
|
]);
|
|
176
|
-
const handleOnAtomHover = useCallback((
|
|
177
|
-
const { oclIDs } = extractFromAtom(
|
|
175
|
+
const handleOnAtomHover = useCallback((diaIDAndInfo) => {
|
|
176
|
+
const { oclIDs } = extractFromAtom(diaIDAndInfo, nucleus);
|
|
178
177
|
// on enter the atom
|
|
179
178
|
if (oclIDs.length > 0) {
|
|
180
179
|
// set all IDs to highlight when hovering over an atom from assignment data
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { SvgNmrOverlay } from 'cheminfo-font';
|
|
@@ -22,7 +22,7 @@ import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
|
22
22
|
import PreferencesHeader from '../header/PreferencesHeader';
|
|
23
23
|
import MultipleSpectraAnalysisTable from './MultipleSpectraAnalysisTable';
|
|
24
24
|
import MultipleSpectraAnalysisPreferences from './preferences';
|
|
25
|
-
function MultipleSpectraAnalysisPanelInner({ activeTab, spectra, showLegend, }) {
|
|
25
|
+
function MultipleSpectraAnalysisPanelInner({ activeTab, spectra, showLegend, displayerMode, }) {
|
|
26
26
|
const [isFlipped, setFlipStatus] = useState(false);
|
|
27
27
|
const spectraPreferences = usePanelPreferences('spectra', activeTab);
|
|
28
28
|
const preferences = usePanelPreferences('multipleSpectraAnalysis', activeTab);
|
|
@@ -66,14 +66,14 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectra, showLegend, })
|
|
|
66
66
|
position: relative;
|
|
67
67
|
}
|
|
68
68
|
`,
|
|
69
|
-
], children: [!isFlipped && (_jsxs(DefaultPanelHeader, { deleteToolTip: "Delete All Peaks", showSettingButton: true, canDelete: false, onSettingClick: settingsPanelHandler, children: [_jsx(Button, { popupTitle: "Copy To Clipboard", onClick: copyToClipboardHandler, children: _jsx(FaFileExport, {}) }), _jsx(Button, { popupTitle: "Spectra calibration", onClick: openAlignSpectra, children: _jsx(SvgNmrOverlay, { style: { fontSize: '18px' } }) }), _jsx(ToggleButton, { popupTitle: "Y spectra tracker", popupPlacement: "right", onClick: showTrackerHandler, defaultValue: showLegend, children: _jsx(IoPulseOutline, {}) }, `${showLegend}`)] })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(MultipleSpectraAnalysisTable, { data: spectraAnalysis, resortSpectra: preferences.analysisOptions.resortSpectra, activeTab: activeTab })) : (_jsx(MultipleSpectraAnalysisPreferences, { data: spectraAnalysis, activeTab: activeTab, onAfterSave: afterSaveHandler, ref: settingRef })) }), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, text: text, label: "Spectra Analysis" })] }));
|
|
69
|
+
], children: [!isFlipped && (_jsxs(DefaultPanelHeader, { deleteToolTip: "Delete All Peaks", showSettingButton: true, canDelete: false, onSettingClick: settingsPanelHandler, children: [_jsx(Button, { popupTitle: "Copy To Clipboard", onClick: copyToClipboardHandler, children: _jsx(FaFileExport, {}) }), displayerMode === '1D' && (_jsxs(_Fragment, { children: [_jsx(Button, { popupTitle: "Spectra calibration", onClick: openAlignSpectra, children: _jsx(SvgNmrOverlay, { style: { fontSize: '18px' } }) }), _jsx(ToggleButton, { popupTitle: "Y spectra tracker", popupPlacement: "right", onClick: showTrackerHandler, defaultValue: showLegend, children: _jsx(IoPulseOutline, {}) }, `${showLegend}`)] }))] })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(MultipleSpectraAnalysisTable, { data: spectraAnalysis, resortSpectra: preferences.analysisOptions.resortSpectra, activeTab: activeTab })) : (_jsx(MultipleSpectraAnalysisPreferences, { data: spectraAnalysis, activeTab: activeTab, onAfterSave: afterSaveHandler, ref: settingRef })) }), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, text: text, label: "Spectra Analysis" })] }));
|
|
70
70
|
}
|
|
71
71
|
const MemoizedMultipleSpectraAnalysisPanel = memo(MultipleSpectraAnalysisPanelInner);
|
|
72
72
|
export default function MultipleSpectraAnalysisPanel() {
|
|
73
|
-
const { data, view: { spectra: { activeTab, showLegend }, }, displayerKey, } = useChartData();
|
|
73
|
+
const { data, view: { spectra: { activeTab, showLegend }, }, displayerKey, displayerMode, } = useChartData();
|
|
74
74
|
const spectra = getSpectraByNucleus(activeTab, data);
|
|
75
75
|
if (!activeTab) {
|
|
76
76
|
return _jsx("div", {});
|
|
77
77
|
}
|
|
78
|
-
return (_jsx(MemoizedMultipleSpectraAnalysisPanel, { activeTab, displayerKey, spectra, showLegend }));
|
|
78
|
+
return (_jsx(MemoizedMultipleSpectraAnalysisPanel, { activeTab, displayerMode, displayerKey, spectra, showLegend }));
|
|
79
79
|
}
|
|
@@ -5,7 +5,6 @@ import { Accordion } from 'react-science/ui';
|
|
|
5
5
|
import { useChartData } from '../context/ChartContext';
|
|
6
6
|
import { usePreferences } from '../context/PreferencesContext';
|
|
7
7
|
import useCheckExperimentalFeature from '../hooks/useCheckExperimentalFeature';
|
|
8
|
-
import { DISPLAYER_MODE } from '../reducer/core/Constants';
|
|
9
8
|
import AutomaticAssignment from './AutomaticAssignment/AutomaticAssignment';
|
|
10
9
|
import InformationPanel from './InformationPanel';
|
|
11
10
|
import IntegralPanel from './IntegralsPanel/IntegralPanel';
|
|
@@ -39,7 +38,7 @@ const accordionItems = [
|
|
|
39
38
|
title: 'Peaks',
|
|
40
39
|
component: _jsx(PeaksPanel, {}),
|
|
41
40
|
hidePreferenceKey: 'peaksPanel',
|
|
42
|
-
mode:
|
|
41
|
+
mode: '1D',
|
|
43
42
|
},
|
|
44
43
|
{
|
|
45
44
|
title: 'Processings',
|
|
@@ -51,13 +50,13 @@ const accordionItems = [
|
|
|
51
50
|
title: 'Integrals',
|
|
52
51
|
component: _jsx(IntegralPanel, {}),
|
|
53
52
|
hidePreferenceKey: 'integralsPanel',
|
|
54
|
-
mode:
|
|
53
|
+
mode: '1D',
|
|
55
54
|
},
|
|
56
55
|
{
|
|
57
56
|
title: 'Ranges',
|
|
58
57
|
component: _jsx(RangesPanel, {}),
|
|
59
58
|
hidePreferenceKey: 'rangesPanel',
|
|
60
|
-
mode:
|
|
59
|
+
mode: '1D',
|
|
61
60
|
},
|
|
62
61
|
{
|
|
63
62
|
title: 'Multiple Spectra Analysis',
|
|
@@ -69,13 +68,13 @@ const accordionItems = [
|
|
|
69
68
|
title: 'Matrix Generation',
|
|
70
69
|
component: _jsx(MatrixGenerationPanel, {}),
|
|
71
70
|
hidePreferenceKey: 'matrixGenerationPanel',
|
|
72
|
-
mode:
|
|
71
|
+
mode: '1D',
|
|
73
72
|
},
|
|
74
73
|
{
|
|
75
74
|
title: 'Zones',
|
|
76
75
|
component: _jsx(ZonesPanel, {}),
|
|
77
76
|
hidePreferenceKey: 'zonesPanel',
|
|
78
|
-
mode:
|
|
77
|
+
mode: '2D',
|
|
79
78
|
},
|
|
80
79
|
{
|
|
81
80
|
title: 'Summary',
|
|
@@ -111,7 +110,7 @@ const accordionItems = [
|
|
|
111
110
|
title: 'Spectrum Simulation',
|
|
112
111
|
component: _jsx(SpectrumSimulation, {}),
|
|
113
112
|
hidePreferenceKey: 'simulationPanel',
|
|
114
|
-
mode:
|
|
113
|
+
mode: '1D',
|
|
115
114
|
},
|
|
116
115
|
];
|
|
117
116
|
export const TOOLS_PANELS_ACCORDION = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { SvgNmrFt, SvgNmrPeaks } from 'cheminfo-font';
|
|
4
|
+
import { SvgNmrFt, SvgNmrPeaks, SvgNmrPeaksTopLabels } from 'cheminfo-font';
|
|
5
5
|
import SvgPeaks from 'cheminfo-font/lib-react-cjs/lib-react-tsx/nmr/Peaks';
|
|
6
6
|
import { useCallback, useMemo, useState, useRef, memo } from 'react';
|
|
7
7
|
import { FaThinkPeaks } from 'react-icons/fa';
|
|
@@ -13,12 +13,12 @@ import ActiveButton from '../../elements/ActiveButton';
|
|
|
13
13
|
import Button from '../../elements/Button';
|
|
14
14
|
import { useAlert } from '../../elements/popup/Alert';
|
|
15
15
|
import { useModal } from '../../elements/popup/Modal';
|
|
16
|
-
import { useActiveSpectrumPeaksViewState
|
|
16
|
+
import { useActiveSpectrumPeaksViewState } from '../../hooks/useActiveSpectrumPeaksViewState';
|
|
17
17
|
import useCheckExperimentalFeature from '../../hooks/useCheckExperimentalFeature';
|
|
18
18
|
import { useFormatNumberByNucleus } from '../../hooks/useFormatNumberByNucleus';
|
|
19
19
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
20
20
|
import { tablePanelStyle } from '../extra/BasicPanelStyle';
|
|
21
|
-
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
21
|
+
import DefaultPanelHeader, { createFilterLabel, } from '../header/DefaultPanelHeader';
|
|
22
22
|
import PreferencesHeader from '../header/PreferencesHeader';
|
|
23
23
|
import PeaksPreferences from './PeaksPreferences';
|
|
24
24
|
import PeaksTable from './PeaksTable';
|
|
@@ -86,6 +86,10 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksViewState, }) {
|
|
|
86
86
|
function toggleViewProperty(key) {
|
|
87
87
|
dispatch({ type: 'TOGGLE_PEAKS_VIEW_PROPERTY', payload: { key } });
|
|
88
88
|
}
|
|
89
|
+
function toggleDisplayingMode() {
|
|
90
|
+
dispatch({ type: 'TOGGLE_PEAKS_DISPLAYING_MODE' });
|
|
91
|
+
}
|
|
92
|
+
const counter = peaks?.values?.length || 0;
|
|
89
93
|
return (_jsxs("div", { css: [
|
|
90
94
|
tablePanelStyle,
|
|
91
95
|
isFlipped &&
|
|
@@ -97,11 +101,13 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksViewState, }) {
|
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
103
|
`,
|
|
100
|
-
], children: [!isFlipped && (_jsxs(DefaultPanelHeader, { counter:
|
|
104
|
+
], children: [!isFlipped && (_jsxs(DefaultPanelHeader, { counter: counter, counterLabel: createFilterLabel(counter, filterIsActive && filteredPeaks?.length), onDelete: handleDeleteAll, deleteToolTip: "Delete All Peaks", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all peaks' : 'Hide peaks out of view', showSettingButton: true, onSettingClick: settingsPanelHandler, children: [isExperimental && (_jsxs(_Fragment, { children: [_jsx(ActiveButton, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksViewState.showPeaksShapes
|
|
101
105
|
? 'Hide peaks shapes'
|
|
102
106
|
: 'Show peaks shapes', popupPlacement: "right", onClick: () => toggleViewProperty('showPeaksShapes'), disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.showPeaksShapes, children: _jsx(SvgPeaks, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ActiveButton, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksViewState.showPeaksSum
|
|
103
107
|
? 'Hide peaks sum'
|
|
104
|
-
: 'Show peaks sum', popupPlacement: "right", onClick: () => toggleViewProperty('showPeaksSum'), disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.showPeaksSum, children: _jsx(SvgNmrFt, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(Button.BarButton, { onClick: optimizePeaksHandler, toolTip: "Optimize peaks", tooltipOrientation: "horizontal", children: _jsx(FaThinkPeaks, {}) })] })), _jsx(ActiveButton, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksViewState.isPeaksVisible ? 'Hide peaks' : 'Show peaks', popupPlacement: "right", onClick: () => toggleViewProperty('isPeaksVisible'), disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.isPeaksVisible, children: _jsx(SvgNmrPeaks, { style: { pointerEvents: 'none', fontSize: '12px' } }) })
|
|
108
|
+
: 'Show peaks sum', popupPlacement: "right", onClick: () => toggleViewProperty('showPeaksSum'), disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.showPeaksSum, children: _jsx(SvgNmrFt, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(Button.BarButton, { onClick: optimizePeaksHandler, toolTip: "Optimize peaks", tooltipOrientation: "horizontal", children: _jsx(FaThinkPeaks, {}) })] })), _jsx(ActiveButton, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksViewState.isPeaksVisible ? 'Hide peaks' : 'Show peaks', popupPlacement: "right", onClick: () => toggleViewProperty('isPeaksVisible'), disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.isPeaksVisible, children: _jsx(SvgNmrPeaks, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ActiveButton, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksViewState.displayingMode === 'spread'
|
|
109
|
+
? 'Single Mode'
|
|
110
|
+
: 'Spread mode', popupPlacement: "right", onClick: toggleDisplayingMode, disabled: !peaks?.values || peaks.values.length === 0, value: peaksViewState.displayingMode === 'spread', children: _jsx(SvgNmrPeaksTopLabels, { style: { pointerEvents: 'none', fontSize: '12px' } }) })] })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(PeaksTable, { data: filteredPeaks, activeTab: activeTab })) : (_jsx(PeaksPreferences, { ref: settingRef })) })] }));
|
|
105
111
|
}
|
|
106
112
|
const MemoizedPeaksPanel = memo(PeaksPanelInner);
|
|
107
113
|
const emptyData = { peaks: null, info: {} };
|
|
@@ -54,7 +54,7 @@ function PeaksTable({ activeTab, data }) {
|
|
|
54
54
|
index: 3,
|
|
55
55
|
Header: 'δ (ppm)',
|
|
56
56
|
accessor: 'x',
|
|
57
|
-
Cell: ({ row }) => (_jsx(EditableColumn, { value: formatNumber(row.original.x, peaksPreferences.deltaPPM.format), onSave: (event) => saveDeltaPPMRefsHandler(event, row.original), type: "number" })),
|
|
57
|
+
Cell: ({ row }) => (_jsx(EditableColumn, { value: formatNumber(row.original.x, peaksPreferences.deltaPPM.format), onSave: (event) => saveDeltaPPMRefsHandler(event, row.original), type: "number", validate: (val) => val !== '' })),
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
showWhen: 'deltaHz.show',
|
|
@@ -18,7 +18,7 @@ import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
|
18
18
|
import CopyClipboardModal from '../../modal/CopyClipboardModal';
|
|
19
19
|
import ChangeSumModal from '../../modal/changeSum/ChangeSumModal';
|
|
20
20
|
import { getNumberOfDecimals } from '../../utility/formatNumber';
|
|
21
|
-
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
21
|
+
import DefaultPanelHeader, { createFilterLabel, } from '../header/DefaultPanelHeader';
|
|
22
22
|
const style = css `
|
|
23
23
|
.btn {
|
|
24
24
|
background-color: transparent;
|
|
@@ -48,11 +48,6 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
|
|
|
48
48
|
dispatch({ type: 'CHANGE_RANGE_SUM', payload: { options } });
|
|
49
49
|
modal.close();
|
|
50
50
|
}
|
|
51
|
-
function showChangeRangesSumModal() {
|
|
52
|
-
modal.show(_jsx(ChangeSumModal, { onClose: () => modal.close(), onSave: changeRangesSumHandler, header: currentSum
|
|
53
|
-
? `Set new Ranges Sum (Current: ${Number(currentSum).toFixed(2)})`
|
|
54
|
-
: 'Set new Ranges Sum', sumOptions: ranges?.options }));
|
|
55
|
-
}
|
|
56
51
|
function removeAssignments() {
|
|
57
52
|
onUnlink();
|
|
58
53
|
}
|
|
@@ -112,10 +107,11 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
|
|
|
112
107
|
});
|
|
113
108
|
}
|
|
114
109
|
const hasRanges = Array.isArray(ranges?.values) && ranges.values.length > 0;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
const counter = ranges?.values?.length || 0;
|
|
111
|
+
return (_jsxs("div", { css: style, children: [_jsxs(DefaultPanelHeader, { counter: counter, counterLabel: createFilterLabel(counter, isFilterActive && filterCounter), onDelete: handleDeleteAll, deleteToolTip: "Delete All Ranges", onFilter: onFilterActivated, filterToolTip: isFilterActive ? 'Show all ranges' : 'Hide ranges out of view', showSettingButton: true, onSettingClick: onSettingClick, children: [_jsx(Button, { popupTitle: "Preview publication string", popupPlacement: "right", onClick: saveAsHTMLHandler, className: "btn preview-publication-icon", disabled: !hasRanges, children: _jsx(FaFileExport, {}) }), _jsx(ChangeSumModal, { onSave: changeRangesSumHandler, sumType: "ranges", currentSum: currentSum, sumOptions: ranges?.options, renderButton: (onClick) => (_jsx(Button, { popupTitle: currentSum
|
|
112
|
+
? `Change ranges sum (${currentSum.toFixed(2)})`
|
|
113
|
+
: 'Change ranges sum', popupPlacement: "right", className: "btn icon", onClick: onClick, children: _jsx(SvgNmrSum, {}) })) }), _jsx(Button, { popupTitle: "Remove all assignments", popupPlacement: "right", onClick: handleOnRemoveAssignments, disabled: !hasRanges, className: "btn icon", children: _jsx(FaUnlink, {}) }), _jsx(ActiveButton, { popupTitle: showMultiplicityTrees
|
|
118
114
|
? 'Hide multiplicity trees in spectrum'
|
|
119
|
-
: 'Show multiplicity trees in spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, value: showMultiplicityTrees, disabled: !hasRanges, children: _jsx(FaSitemap, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ActiveButton, { popupTitle: showJGraph ? 'Hide J Graph' : 'Show J Graph', popupPlacement: "right", onClick: handleShowJGraph, value: showJGraph, disabled: !hasRanges, children: _jsx(FaChartBar, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ActiveButton, { popupTitle: showRangesIntegrals ? 'Hide integrals' : 'Show integrals', popupPlacement: "right", onClick: handleShowIntegrals, value: showRangesIntegrals, disabled: !hasRanges, children: _jsx(SvgNmrIntegrate, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ActiveButton, { className: "icon", popupTitle: "
|
|
115
|
+
: 'Show multiplicity trees in spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, value: showMultiplicityTrees, disabled: !hasRanges, children: _jsx(FaSitemap, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ActiveButton, { popupTitle: showJGraph ? 'Hide J Graph' : 'Show J Graph', popupPlacement: "right", onClick: handleShowJGraph, value: showJGraph, disabled: !hasRanges, children: _jsx(FaChartBar, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ActiveButton, { popupTitle: showRangesIntegrals ? 'Hide integrals' : 'Show integrals', popupPlacement: "right", onClick: handleShowIntegrals, value: showRangesIntegrals, disabled: !hasRanges, children: _jsx(SvgNmrIntegrate, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ActiveButton, { className: "icon", popupTitle: "Fixed integration sum", popupPlacement: "right", onClick: changeSumConstantFlagHandler, value: ranges?.options?.isSumConstant, children: _jsx(ImLink, {}) })] }), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, text: text, label: "Preview publication string" })] }));
|
|
120
116
|
}
|
|
121
117
|
export default RangesHeader;
|
|
@@ -17,6 +17,6 @@ function RelativeColumn({ row, rowSpanTags, onHover, format, }) {
|
|
|
17
17
|
},
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
return (_jsx("td", { ...rowSpanTags, ...onHover, children: _jsx(EditableColumn, { value: integralVal, onSave: saveHandler, type: "number", style: { padding: '0.1rem 0.4rem' } }) }));
|
|
20
|
+
return (_jsx("td", { ...rowSpanTags, ...onHover, children: _jsx(EditableColumn, { value: integralVal, onSave: saveHandler, validate: (val) => val !== '', type: "number", style: { padding: '0.1rem 0.4rem' } }) }));
|
|
21
21
|
}
|
|
22
22
|
export default RelativeColumn;
|
|
@@ -18,6 +18,6 @@ function SignalDeltaColumn({ row, onHover, format, rowSpanTags, }) {
|
|
|
18
18
|
}
|
|
19
19
|
if (!signal)
|
|
20
20
|
return _jsx("td", { children: '' });
|
|
21
|
-
return (_jsx("td", { ...rowSpanTags, ...onHover, children: !checkMultiplicity(signal.multiplicity, ['m']) ? (`${formatNumber(row.from, format)} - ${formatNumber(row.to, format)}`) : (_jsx(EditableColumn, { value: formatNumber(signal.delta, format), onSave: saveHandler, type: "number", style: { padding: '0.1rem 0.4rem' } })) }));
|
|
21
|
+
return (_jsx("td", { ...rowSpanTags, ...onHover, children: !checkMultiplicity(signal.multiplicity, ['m']) ? (`${formatNumber(row.from, format)} - ${formatNumber(row.to, format)}`) : (_jsx(EditableColumn, { value: formatNumber(signal.delta, format), onSave: saveHandler, type: "number", style: { padding: '0.1rem 0.4rem' }, validate: (val) => val !== '' })) }));
|
|
22
22
|
}
|
|
23
23
|
export default SignalDeltaColumn;
|
|
@@ -10,7 +10,6 @@ import { useAlert } from '../../elements/popup/Alert';
|
|
|
10
10
|
import { useModal } from '../../elements/popup/Modal';
|
|
11
11
|
import { useActiveSpectra } from '../../hooks/useActiveSpectra';
|
|
12
12
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
13
|
-
import { DISPLAYER_MODE } from '../../reducer/core/Constants';
|
|
14
13
|
import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
|
|
15
14
|
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
16
15
|
import { SpectraAutomaticPickingButton } from '../header/SpectraAutomaticPickingButton';
|
|
@@ -82,7 +81,7 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
|
|
|
82
81
|
});
|
|
83
82
|
}
|
|
84
83
|
const hasActiveSpectra = activeSpectra && activeSpectra?.length > 0;
|
|
85
|
-
return (_jsxs(DefaultPanelHeader, { onDelete: handleDelete, counter: spectra?.length, deleteToolTip: "Delete selected spectra", disableDelete: !hasActiveSpectra, showSettingButton: true, onSettingClick: onSettingClick, children: [_jsx(Button.BarButton, { toolTip: "Hide selected spectra", onClick: hideAllSpectrumsHandler, tooltipOrientation: "horizontal", disabled: !hasActiveSpectra, children: _jsx(FaEyeSlash, {}) }), _jsx(Button.BarButton, { onClick: showAllSpectrumsHandler, toolTip: "Show selected spectra", tooltipOrientation: "horizontal", disabled: !hasActiveSpectra, children: _jsx(FaEye, {}) }), displayerMode ===
|
|
84
|
+
return (_jsxs(DefaultPanelHeader, { onDelete: handleDelete, counter: spectra?.length, deleteToolTip: "Delete selected spectra", disableDelete: !hasActiveSpectra, showSettingButton: true, onSettingClick: onSettingClick, children: [_jsx(Button.BarButton, { toolTip: "Hide selected spectra", onClick: hideAllSpectrumsHandler, tooltipOrientation: "horizontal", disabled: !hasActiveSpectra, children: _jsx(FaEyeSlash, {}) }), _jsx(Button.BarButton, { onClick: showAllSpectrumsHandler, toolTip: "Show selected spectra", tooltipOrientation: "horizontal", disabled: !hasActiveSpectra, children: _jsx(FaEye, {}) }), displayerMode === '2D' && activeSpectrum?.info.isFt && (_jsx(Button.BarButton, { toolTip: "Add missing projection", tooltipOrientation: "horizontal", onClick: addMissingProjectionHandler, children: _jsx(FaCreativeCommonsSamplingPlus, {}) })), displayerMode === '1D' && spectra.length > 1 && (_jsxs(_Fragment, { children: [_jsx(Button.BarButton, { tooltipOrientation: "horizontal", toolTip: "Reset scale", onClick: resetScaleHandler, children: _jsx(SvgNmrResetScale, {}) }), _jsx(Button.BarButton, { tooltipOrientation: "horizontal", toolTip: "Same top", onClick: setSameTopHandler, children: _jsx(SvgNmrSameTop, {}) })] })), _jsx(SpectraAutomaticPickingButton, {}), _jsx(Button.BarButton, { tooltipOrientation: "horizontal", toolTip: "Recolor spectra", onClick: recolorSpectraHandler, children: _jsx(IoColorPaletteOutline, {}) })] }));
|
|
86
85
|
}
|
|
87
86
|
const MemoizedSpectraPanelHeader = memo(SpectraPanelHeaderInner);
|
|
88
87
|
export default function SpectrumsTabs({ onSettingClick, }) {
|
|
@@ -28,7 +28,7 @@ function DisplayButtons1D(props) {
|
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
30
|
const display = data.display;
|
|
31
|
-
return (_jsx("button", { "data-
|
|
31
|
+
return (_jsx("button", { "data-testid": "hide-show-spectrum-button", style: buttonStyle, type: "button", onClick: (e) => {
|
|
32
32
|
e.stopPropagation();
|
|
33
33
|
onChangeVisibility(data, 'isVisible');
|
|
34
34
|
}, children: _jsx(FaEye, { style: {
|
|
@@ -178,9 +178,9 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
178
178
|
}
|
|
179
179
|
}, children: [getLabel(correlations, correlation), _jsx(ContextMenu, { ref: contextRef, context: contextMenu })] }), _jsx("td", { title: t, ...otherTableDataProps, children: getCorrelationDelta(correlation)
|
|
180
180
|
? getCorrelationDelta(correlation)?.toFixed(2)
|
|
181
|
-
: '' }), _jsx("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? (_jsx(EditableColumn, { type: "number", value: correlation.equivalence, style: equivalenceCellStyle, onSave: onSaveEquivalencesHandler })) : (_jsx("span", { style: equivalenceCellStyle, children: correlation.equivalence })) }), _jsx("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? (_jsx(EditableColumn, { type: "text", value: correlation.protonsCount.join(','), style: correlation.edited.protonsCount ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'protonsCount') })) : ('') }), _jsx("td", { title: t, ...otherTableDataProps,
|
|
181
|
+
: '' }), _jsx("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? (_jsx(EditableColumn, { type: "number", value: correlation.equivalence, style: equivalenceCellStyle, onSave: onSaveEquivalencesHandler, validate: (val) => val !== '' })) : (_jsx("span", { style: equivalenceCellStyle, children: correlation.equivalence })) }), _jsx("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? (_jsx(EditableColumn, { type: "text", value: correlation.protonsCount.join(','), style: correlation.edited.protonsCount ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'protonsCount'), validate: (val) => val !== '' })) : ('') }), _jsx("td", { title: t, ...otherTableDataProps,
|
|
182
182
|
style: { ...tableDataProps.style, borderRight: '1px solid' }, children: correlation.atomType !== 'H' ? (_jsx(EditableColumn, { type: "text", value: correlation.hybridization
|
|
183
183
|
.map((hybrid) => `sp${hybrid}`)
|
|
184
|
-
.join(','), style: correlation.edited.hybridization ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'hybridization') })) : ('') }), additionalColumnFields] }));
|
|
184
|
+
.join(','), style: correlation.edited.hybridization ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'hybridization'), validate: (val) => val !== '' })) : ('') }), additionalColumnFields] }));
|
|
185
185
|
}
|
|
186
186
|
export default CorrelationTableRow;
|
|
@@ -11,8 +11,7 @@ import { useDispatch } from '../../context/DispatchContext';
|
|
|
11
11
|
import Select from '../../elements/Select';
|
|
12
12
|
import ToolTip from '../../elements/ToolTip/ToolTip';
|
|
13
13
|
import { useModal } from '../../elements/popup/Modal';
|
|
14
|
-
import {
|
|
15
|
-
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
14
|
+
import DefaultPanelHeader, { createFilterLabel, } from '../header/DefaultPanelHeader';
|
|
16
15
|
import CorrelationTable from './CorrelationTable/CorrelationTable';
|
|
17
16
|
import Overview from './Overview';
|
|
18
17
|
import SetMolecularFormulaModal from './SetMolecularFormulaModal';
|
|
@@ -72,7 +71,7 @@ function SummaryPanel() {
|
|
|
72
71
|
const xDomain1 = xDomain[1] * factor;
|
|
73
72
|
const yDomain0 = yDomain[0] * factor;
|
|
74
73
|
const yDomain1 = yDomain[1] * factor;
|
|
75
|
-
if (displayerMode ===
|
|
74
|
+
if (displayerMode === '1D') {
|
|
76
75
|
const firstLink1D = correlation.link.find((link) => getLinkDim(link) === 1);
|
|
77
76
|
if (!firstLink1D) {
|
|
78
77
|
return false;
|
|
@@ -97,7 +96,7 @@ function SummaryPanel() {
|
|
|
97
96
|
return true;
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
|
-
else if (displayerMode ===
|
|
99
|
+
else if (displayerMode === '2D') {
|
|
101
100
|
if (!atomTypesInView.includes(correlation.atomType)) {
|
|
102
101
|
return false;
|
|
103
102
|
}
|
|
@@ -309,9 +308,10 @@ function SummaryPanel() {
|
|
|
309
308
|
const handleOnFilter = useCallback(() => {
|
|
310
309
|
setFilterIsActive(!filterIsActive);
|
|
311
310
|
}, [filterIsActive]);
|
|
312
|
-
|
|
311
|
+
const counter = correlationsData ? correlationsData.values.length : 0;
|
|
312
|
+
return (_jsxs("div", { css: panelStyle, children: [_jsxs(DefaultPanelHeader, { canDelete: false, counter: counter, counterLabel: createFilterLabel(counter, filterIsActive && filteredCorrelationsData?.values.length), onFilter: handleOnFilter, filterToolTip: filterIsActive
|
|
313
313
|
? 'Show all correlations'
|
|
314
|
-
: 'Hide correlations out of view',
|
|
314
|
+
: 'Hide correlations out of view', children: [_jsx(ToolTip, { title: `Set molecular formula (${correlationsData.options.mf})`, popupPlacement: "right", children: _jsx("button", { type: "button", onClick: showSetMolecularFormulaModal, children: _jsx(FaFlask, {}) }) }), _jsx(ToolTip, { title: `Set shift tolerance`, popupPlacement: "right", children: _jsx("button", { type: "button", onClick: showSetShiftToleranceModal, children: _jsx(FaSlidersH, {}) }) }), _jsxs("div", { className: "extra-header-content", children: [_jsx("div", { className: "overview-container", children: _jsx(Overview, { correlationsData: correlationsData }) }), _jsx("div", { className: "table-view-selection", children: _jsxs("span", { children: [_jsx("label", { children: "View:" }), _jsx(Select, { onChange: (selection) => {
|
|
315
315
|
setSelectedAdditionalColumnsAtomType(selection);
|
|
316
316
|
if (selection === 'H-H') {
|
|
317
317
|
setShowProtonsAsRows(true);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Correlation, Link } from 'nmr-correlation';
|
|
2
2
|
import { Spectrum2D, Spectrum } from 'nmr-load-save';
|
|
3
|
-
import { ActiveSpectrum } from '../../../reducer/Reducer';
|
|
4
|
-
import { DISPLAYER_MODE } from '../../../reducer/core/Constants';
|
|
3
|
+
import { ActiveSpectrum, DisplayerMode } from '../../../reducer/Reducer';
|
|
5
4
|
declare function getAtomType(nucleus: string): string;
|
|
6
5
|
declare function getLabelColor(correlationData: any, correlation: any): string | null;
|
|
7
6
|
declare function findSignalMatch1D(spectrum: Spectrum2D, link: Link, factor: number, xDomain0: number, xDomain1: number): boolean;
|
|
@@ -25,5 +24,5 @@ declare function getEditedCorrelations({ correlationDim1, correlationDim2, selec
|
|
|
25
24
|
};
|
|
26
25
|
};
|
|
27
26
|
declare function convertValuesString(valuesString: string, key: 'protonsCount' | 'hybridization'): number[];
|
|
28
|
-
declare function isInView(spectraData: Spectrum[], activeTab: string, activeSpectrum: ActiveSpectrum | null, xDomain: number[], yDomain: number[], displayerMode:
|
|
27
|
+
declare function isInView(spectraData: Spectrum[], activeTab: string, activeSpectrum: ActiveSpectrum | null, xDomain: number[], yDomain: number[], displayerMode: DisplayerMode, correlation: Correlation): boolean;
|
|
29
28
|
export { buildNewLink1D, buildNewLink2D, cloneCorrelationAndEditLink, convertValuesString, findSignalMatch1D, findSignalMatch2D, getAbbreviation, getAtomType, getEditedCorrelations, getLabelColor, isInView, };
|
|
@@ -4,7 +4,6 @@ import { addLink, buildCorrelation, buildLink, getLinkDelta, getLinkDim, removeL
|
|
|
4
4
|
import DefaultPathLengths from '../../../../data/constants/DefaultPathLengths';
|
|
5
5
|
import { findSignal2D, findSpectrum, } from '../../../../data/utilities/FindUtilities';
|
|
6
6
|
import isDefaultPathLength from '../../../modal/editZone/validation/isDefaultPathLength';
|
|
7
|
-
import { DISPLAYER_MODE } from '../../../reducer/core/Constants';
|
|
8
7
|
import { ErrorColors } from '../CorrelationTable/Constants';
|
|
9
8
|
function getAtomType(nucleus) {
|
|
10
9
|
return nucleus.split(/\d+/)[1];
|
|
@@ -287,7 +286,7 @@ function isInView(spectraData, activeTab, activeSpectrum, xDomain, yDomain, disp
|
|
|
287
286
|
const xDomain1 = xDomain[1] * factor;
|
|
288
287
|
const yDomain0 = yDomain[0] * factor;
|
|
289
288
|
const yDomain1 = yDomain[1] * factor;
|
|
290
|
-
if (displayerMode ===
|
|
289
|
+
if (displayerMode === '1D') {
|
|
291
290
|
const firstLink1D = correlation.link.find((link) => getLinkDim(link) === 1);
|
|
292
291
|
if (!firstLink1D) {
|
|
293
292
|
return false;
|
|
@@ -312,7 +311,7 @@ function isInView(spectraData, activeTab, activeSpectrum, xDomain, yDomain, disp
|
|
|
312
311
|
return true;
|
|
313
312
|
}
|
|
314
313
|
}
|
|
315
|
-
else if (displayerMode ===
|
|
314
|
+
else if (displayerMode === '2D') {
|
|
316
315
|
if (!atomTypesInView.includes(correlation.atomType)) {
|
|
317
316
|
return false;
|
|
318
317
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import lodashGet from 'lodash/get';
|
|
3
|
-
import { Fragment, useCallback } from 'react';
|
|
4
3
|
import { useDispatch } from '../../../context/DispatchContext';
|
|
5
4
|
import EditableColumn from '../../../elements/EditableColumn';
|
|
6
5
|
import { formatNumber } from '../../../utility/formatNumber';
|
|
@@ -9,8 +8,8 @@ function SignalDeltaColumn({ rowData, onHoverSignalX, onHoverSignalY, format, })
|
|
|
9
8
|
const signalDeltaX = lodashGet(rowData, 'tableMetaInfo.signal.x.delta', null);
|
|
10
9
|
const signalDeltaY = lodashGet(rowData, 'tableMetaInfo.signal.y.delta', null);
|
|
11
10
|
const id = lodashGet(rowData, 'tableMetaInfo.signal.id', undefined);
|
|
12
|
-
|
|
13
|
-
const value = event.target.value;
|
|
11
|
+
function saveXHandler(event) {
|
|
12
|
+
const value = Number(event.target.value);
|
|
14
13
|
dispatch({
|
|
15
14
|
type: 'CHANGE_ZONE_SIGNAL_VALUE',
|
|
16
15
|
payload: {
|
|
@@ -18,9 +17,9 @@ function SignalDeltaColumn({ rowData, onHoverSignalX, onHoverSignalY, format, })
|
|
|
18
17
|
signal: { id, deltaX: value },
|
|
19
18
|
},
|
|
20
19
|
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const value = event.target.value;
|
|
20
|
+
}
|
|
21
|
+
function saveYHandler(event) {
|
|
22
|
+
const value = Number(event.target.value);
|
|
24
23
|
dispatch({
|
|
25
24
|
type: 'CHANGE_ZONE_SIGNAL_VALUE',
|
|
26
25
|
payload: {
|
|
@@ -28,7 +27,7 @@ function SignalDeltaColumn({ rowData, onHoverSignalX, onHoverSignalY, format, })
|
|
|
28
27
|
signal: { id, deltaY: value },
|
|
29
28
|
},
|
|
30
29
|
});
|
|
31
|
-
}
|
|
32
|
-
return (_jsxs(
|
|
30
|
+
}
|
|
31
|
+
return (_jsxs(_Fragment, { children: [_jsx("td", { ...onHoverSignalX, children: signalDeltaX !== null ? (_jsx(EditableColumn, { value: formatNumber(signalDeltaX, format.x), onSave: saveXHandler, type: "number", style: { padding: '0.1rem 0.4rem' }, validate: (val) => val !== '' })) : ('') }), _jsx("td", { ...onHoverSignalY, children: signalDeltaY !== null ? (_jsx(EditableColumn, { value: formatNumber(signalDeltaY, format.y), onSave: saveYHandler, type: "number", style: { padding: '0.1rem 0.4rem' }, validate: (val) => val !== '' })) : ('') })] }));
|
|
33
32
|
}
|
|
34
33
|
export default SignalDeltaColumn;
|
|
@@ -13,7 +13,7 @@ import useSpectrum from '../../hooks/useSpectrum';
|
|
|
13
13
|
import { zoneStateInit } from '../../reducer/Reducer';
|
|
14
14
|
import { tablePanelStyle } from '../extra/BasicPanelStyle';
|
|
15
15
|
import NoTableData from '../extra/placeholder/NoTableData';
|
|
16
|
-
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
16
|
+
import DefaultPanelHeader, { createFilterLabel, } from '../header/DefaultPanelHeader';
|
|
17
17
|
import PreferencesHeader from '../header/PreferencesHeader';
|
|
18
18
|
import ZonesPreferences from './ZonesPreferences';
|
|
19
19
|
import ZonesTable from './ZonesTable';
|
|
@@ -131,6 +131,7 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, experiment, showZ
|
|
|
131
131
|
const handleSetShowPeaks = () => {
|
|
132
132
|
dispatch({ type: 'SHOW_ZONES_PEAKS', payload: { id } });
|
|
133
133
|
};
|
|
134
|
+
const counter = zones?.values?.length || 0;
|
|
134
135
|
return (_jsxs("div", { css: [
|
|
135
136
|
tablePanelStyle,
|
|
136
137
|
style,
|
|
@@ -140,7 +141,7 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, experiment, showZ
|
|
|
140
141
|
position: relative;
|
|
141
142
|
}
|
|
142
143
|
`,
|
|
143
|
-
], children: [!isFlipped && (_jsxs(DefaultPanelHeader, { counter:
|
|
144
|
+
], children: [!isFlipped && (_jsxs(DefaultPanelHeader, { counter: counter, counterLabel: createFilterLabel(counter, filterIsActive && tableData?.length), onDelete: handleDeleteAll, deleteToolTip: "Delete All Zones", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all zones' : 'Hide zones out of view', showSettingButton: true, onSettingClick: settingsPanelHandler, children: [_jsx(ToolTip, { title: `Remove all assignments`, popupPlacement: "right", children: _jsx("button", { className: "remove-assignments-btn", type: "button", onClick: handleOnRemoveAssignments, disabled: !zones.values || zones.values.length === 0, children: _jsx(FaUnlink, {}) }) }), _jsx(ActiveButton, { popupTitle: "Show/Hide zones", popupPlacement: "right", value: showZones, onClick: handleSetShowZones, children: _jsx("span", { style: { fontSize: '12px', pointerEvents: 'none' }, children: "z" }) }), _jsx(ActiveButton, { popupTitle: "Show/Hide signals", popupPlacement: "right", value: showSignals, onClick: handleSetShowSignals, children: _jsx("span", { style: { fontSize: '12px', pointerEvents: 'none' }, children: "s" }) }), _jsx(ActiveButton, { popupTitle: "Show/Hide peaks", popupPlacement: "right", value: showPeaks, onClick: handleSetShowPeaks, children: _jsx("span", { style: { fontSize: '12px', pointerEvents: 'none' }, children: "p" }) })] })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx("div", { className: "table-container", children: tableData && tableData.length > 0 ? (_jsx(ZonesTable, { tableData: tableData, onUnlink: unlinkZoneHandler, nuclei: activeTab && activeTab.split(',').length === 2
|
|
144
145
|
? activeTab.split(',')
|
|
145
146
|
: ['?', '?'], experiment: experiment })) : (_jsx(NoTableData, {})) })) : (_jsx(ZonesPreferences, { ref: settingRef })) })] }));
|
|
146
147
|
}
|
|
@@ -23,7 +23,7 @@ function ZonesPreferences(props, ref) {
|
|
|
23
23
|
const nuclei = useMemo(() => getUniqueNuclei(nucleus), [nucleus]);
|
|
24
24
|
const zonesPreferences = usePanelPreferencesByNuclei('zones', nuclei);
|
|
25
25
|
useEffect(() => {
|
|
26
|
-
formRef.current?.setValues(zonesPreferences);
|
|
26
|
+
void formRef.current?.setValues(zonesPreferences);
|
|
27
27
|
}, [zonesPreferences]);
|
|
28
28
|
const saveHandler = useCallback((values) => {
|
|
29
29
|
preferences.dispatch({
|