nmrium 0.58.0 → 0.60.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/LinesSeries.js +17 -5
- package/lib/component/1d/Viewer1D.js +10 -4
- package/lib/component/1d/integral/IntegralResizable.js +2 -2
- package/lib/component/1d/matrix/useMatrix.d.ts +1 -1
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +1 -1
- package/lib/component/1d/ranges/Atoms.js +6 -4
- package/lib/component/1d/ranges/Range.js +4 -2
- package/lib/component/1d/tool/PivotIndicator.d.ts +1 -0
- package/lib/component/1d/tool/{VerticalIndicator.js → PivotIndicator.js} +8 -4
- package/lib/component/1d-2d/tools/BrushXY.js +0 -1
- package/lib/component/1d-2d/tools/CrossLinePointer.js +0 -1
- package/lib/component/2d/Viewer2D.js +7 -3
- package/lib/component/2d/tools/PivotIndicator.d.ts +1 -2
- package/lib/component/2d/tools/PivotIndicator.js +2 -3
- package/lib/component/2d/zones/Zone.js +2 -2
- package/lib/component/EventsTrackers/KeysListenerTracker.js +8 -8
- package/lib/component/context/ChartContext.js +12 -1
- package/lib/component/context/ShareDataContext.d.ts +1 -1
- package/lib/component/context/ShareDataContext.js +2 -4
- package/lib/component/context/ToasterContext.d.ts +1 -0
- package/lib/component/context/ToasterContext.js +12 -3
- package/lib/component/elements/ActionsButtonsPopover.js +1 -3
- package/lib/component/elements/Alert.d.ts +20 -0
- package/lib/component/elements/Alert.js +80 -0
- package/lib/component/elements/ContextMenuBluePrint.d.ts +7 -2
- package/lib/component/elements/ContextMenuBluePrint.js +9 -3
- package/lib/component/elements/DialogManager.d.ts +34 -0
- package/lib/component/elements/DialogManager.js +96 -0
- package/lib/component/elements/DraggableDialog.d.ts +13 -0
- package/lib/component/elements/DraggableDialog.js +156 -0
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +0 -3
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +1 -1
- package/lib/component/elements/Select2.d.ts +12 -7
- package/lib/component/elements/Select2.js +5 -4
- package/lib/component/elements/Select2Controller.d.ts +2 -2
- package/lib/component/elements/Select2Controller.js +5 -5
- package/lib/component/elements/TabTitle.d.ts +9 -0
- package/lib/component/elements/TabTitle.js +18 -0
- package/lib/component/elements/ToolbarPopoverItem.d.ts +7 -6
- package/lib/component/elements/ToolbarPopoverItem.js +13 -5
- package/lib/component/elements/print/PrintContent.d.ts +17 -0
- package/lib/component/elements/print/PrintContent.js +281 -0
- package/lib/component/elements/print/PrintProvider.d.ts +12 -0
- package/lib/component/elements/print/PrintProvider.js +28 -0
- package/lib/component/elements/print/index.d.ts +2 -0
- package/lib/component/elements/print/index.js +2 -0
- package/lib/component/header/ApodizationOptionsPanel.js +2 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +3 -0
- package/lib/component/hooks/useSaveSettings.d.ts +1 -1
- package/lib/component/hooks/useSaveSettings.js +18 -22
- package/lib/component/hooks/useToggleSpectraVisibility.d.ts +14 -9
- package/lib/component/hooks/useToggleSpectraVisibility.js +45 -16
- package/lib/component/loader/DropZone.js +3 -67
- package/lib/component/loader/useLoadFiles.d.ts +1 -0
- package/lib/component/loader/useLoadFiles.js +78 -0
- package/lib/component/main/InnerNMRium.d.ts +4 -3
- package/lib/component/main/InnerNMRium.js +5 -10
- package/lib/component/main/InnerNMRiumContents.d.ts +3 -2
- package/lib/component/main/InnerNMRiumContents.js +38 -29
- package/lib/component/main/NMRium.d.ts +2 -5
- package/lib/component/main/NMRium.js +1 -1
- package/lib/component/main/NMRiumRefAPI.d.ts +7 -0
- package/lib/component/main/NMRiumRefAPI.js +12 -0
- package/lib/component/main/NMRiumViewer.d.ts +10 -0
- package/lib/component/main/NMRiumViewer.js +35 -0
- package/lib/component/main/index.d.ts +1 -0
- package/lib/component/modal/CopyClipboardModal.d.ts +3 -2
- package/lib/component/modal/CopyClipboardModal.js +18 -32
- package/lib/component/modal/EditPeakShapeModal.d.ts +4 -6
- package/lib/component/modal/EditPeakShapeModal.js +45 -33
- package/lib/component/modal/ExportAsJcampModal.d.ts +6 -3
- package/lib/component/modal/ExportAsJcampModal.js +69 -35
- package/lib/component/modal/ImportPublicationStringModal.js +1 -1
- package/lib/component/modal/editRange/EditRangeModal.d.ts +2 -10
- package/lib/component/modal/editRange/EditRangeModal.js +26 -54
- package/lib/component/modal/editZone/EditZoneModal.d.ts +3 -8
- package/lib/component/modal/editZone/EditZoneModal.js +74 -91
- package/lib/component/modal/editZone/SignalsForm.d.ts +1 -2
- package/lib/component/modal/editZone/SignalsForm.js +33 -50
- package/lib/component/modal/editZone/validation/isDefaultPathLength.d.ts +1 -2
- package/lib/component/modal/editZone/validation/isDefaultPathLength.js +3 -5
- package/lib/component/modal/setting/GeneralSettings.js +4 -2
- package/lib/component/modal/setting/settings-tabs/ExternalAPIsTabContent.d.ts +1 -0
- package/lib/component/modal/setting/settings-tabs/ExternalAPIsTabContent.js +89 -0
- package/lib/component/modal/setting/settingsValidation.js +15 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +8 -5
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +5 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +13 -3
- package/lib/component/panels/Panels.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +8 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +7 -13
- package/lib/component/panels/RangesPanel/RangesHeader.js +52 -15
- package/lib/component/panels/RangesPanel/RangesTable.js +6 -3
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +21 -3
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +6 -5
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +41 -64
- package/lib/component/panels/SpectraPanel/SpectraPanelHeader.js +13 -6
- package/lib/component/panels/SpectraPanel/SpectraTable.js +63 -21
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.d.ts +1 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +33 -41
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +68 -53
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +70 -58
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.d.ts +13 -8
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +17 -81
- package/lib/component/panels/SummaryPanel/SummaryPanel.d.ts +3 -0
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +8 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +62 -43
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +16 -8
- package/lib/component/panels/ZonesPanel/ZonesTable.js +4 -1
- package/lib/component/panels/ZonesPanel/hooks/useZoneActions.d.ts +5 -0
- package/lib/component/panels/ZonesPanel/hooks/useZoneActions.js +40 -0
- package/lib/component/panels/databasePanel/DatabasePanel.js +7 -8
- package/lib/component/panels/filtersPanel/FilterPanel.js +9 -6
- package/lib/component/panels/filtersPanel/FiltersTable.js +12 -10
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +1 -0
- package/lib/component/panels/header/DefaultPanelHeader.js +2 -2
- package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js +10 -12
- package/lib/component/reducer/IgnoreActions.js +1 -0
- package/lib/component/reducer/Reducer.js +2 -4
- package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -13
- package/lib/component/reducer/actions/DatabaseActions.js +52 -34
- package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
- package/lib/component/reducer/actions/FiltersActions.js +9 -4
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -0
- package/lib/component/reducer/actions/RangesActions.js +9 -4
- package/lib/component/reducer/actions/SpectraActions.d.ts +2 -1
- package/lib/component/reducer/actions/SpectraActions.js +53 -43
- package/lib/component/reducer/actions/ToolsActions.js +0 -17
- package/lib/component/reducer/helper/removeSpectrumRelatedObjectsById.d.ts +3 -0
- package/lib/component/reducer/helper/removeSpectrumRelatedObjectsById.js +16 -0
- package/lib/component/reducer/preferences/actions/changePrintPageSettings.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/changePrintPageSettings.js +6 -0
- package/lib/component/reducer/preferences/actions/matrixGeneration.d.ts +0 -4
- package/lib/component/reducer/preferences/actions/matrixGeneration.js +1 -2
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -2
- package/lib/component/reducer/preferences/preferencesReducer.js +4 -1
- package/lib/component/toolbar/ToolBar.js +33 -14
- package/lib/component/toolbar/ToolTypes.d.ts +1 -1
- package/lib/component/toolbar/ToolTypes.js +0 -14
- package/lib/component/workspaces/workspaceDefaultProperties.js +2 -0
- package/lib/data/SpectraManager.d.ts +7 -10
- package/lib/data/SpectraManager.js +51 -30
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +0 -1
- package/lib/data/data1d/Spectrum1D/SumManager.js +2 -10
- package/lib/data/data1d/Spectrum1D/get1DColor.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/index.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/createRange.d.ts +10 -16
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +1 -7
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +10 -16
- package/lib/data/data1d/Spectrum1D/ranges/resizeRange.d.ts +10 -16
- package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.d.ts +13 -0
- package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.js +65 -0
- package/lib/data/molecules/MoleculeManager.d.ts +1 -1
- package/lib/data/molecules/MoleculeManager.js +21 -49
- package/lib/data/utilities/getCustomColor.d.ts +1 -1
- package/lib/data/utilities/removeByPaths.d.ts +3 -0
- package/lib/data/utilities/removeByPaths.js +33 -0
- package/lib/versionInfo.js +1 -1
- package/package.json +34 -34
- package/lib/component/1d/tool/VerticalIndicator.d.ts +0 -2
- package/lib/component/elements/ContextMenu.d.ts +0 -9
- package/lib/component/elements/ContextMenu.js +0 -116
- package/lib/component/elements/popup/Modal/ConfirmDialog.d.ts +0 -21
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +0 -68
- package/lib/component/elements/popup/Modal/Context.d.ts +0 -2
- package/lib/component/elements/popup/Modal/Context.js +0 -6
- package/lib/component/elements/popup/Modal/Modal.d.ts +0 -9
- package/lib/component/elements/popup/Modal/Modal.js +0 -42
- package/lib/component/elements/popup/Modal/ModalContent.d.ts +0 -6
- package/lib/component/elements/popup/Modal/ModalContent.js +0 -27
- package/lib/component/elements/popup/Modal/Provider.d.ts +0 -11
- package/lib/component/elements/popup/Modal/Provider.js +0 -172
- package/lib/component/elements/popup/Modal/index.d.ts +0 -4
- package/lib/component/elements/popup/Modal/index.js +0 -4
- package/lib/component/elements/popup/Transition.d.ts +0 -14
- package/lib/component/elements/popup/Transition.js +0 -35
- package/lib/component/elements/popup/Wrapper.d.ts +0 -8
- package/lib/component/elements/popup/Wrapper.js +0 -83
- package/lib/component/elements/popup/options.d.ts +0 -28
- package/lib/component/elements/popup/options.js +0 -25
- package/lib/component/elements/popup/utility.d.ts +0 -2
- package/lib/component/elements/popup/utility.js +0 -13
- package/lib/component/modal/editZone/EditPathLengthFormik.d.ts +0 -5
- package/lib/component/modal/editZone/EditPathLengthFormik.js +0 -67
- package/lib/component/modal/editZone/SignalFormTab.d.ts +0 -5
- package/lib/component/modal/editZone/SignalFormTab.js +0 -6
- package/lib/component/modal/editZone/validation/EditZoneValidation.d.ts +0 -14
- package/lib/component/modal/editZone/validation/EditZoneValidation.js +0 -14
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +0 -11
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +0 -29
|
@@ -4,7 +4,6 @@ import { contoursManager } from '../../../data/data2d/Spectrum2D/contours';
|
|
|
4
4
|
import { getYScale, getXScale } from '../../1d/utilities/scale';
|
|
5
5
|
import { LAYOUT } from '../../2d/utilities/DimensionLayout';
|
|
6
6
|
import { get2DXScale, get2DYScale } from '../../2d/utilities/scale';
|
|
7
|
-
import { defaultRangesViewState } from '../../hooks/useActiveSpectrumRangesViewState';
|
|
8
7
|
import { options as Tools } from '../../toolbar/ToolTypes';
|
|
9
8
|
import groupByInfoKey from '../../utility/GroupByInfoKey';
|
|
10
9
|
import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
|
|
@@ -64,22 +63,6 @@ function activateTool(draft, options) {
|
|
|
64
63
|
draft.toolOptions.selectedOptionPanel = toolId;
|
|
65
64
|
}
|
|
66
65
|
}
|
|
67
|
-
// start Range edit mode
|
|
68
|
-
if (toolId === Tools.editRange.id) {
|
|
69
|
-
const activeSpectrum = getActiveSpectrum(draft);
|
|
70
|
-
if (activeSpectrum) {
|
|
71
|
-
const range = draft.view.ranges?.[activeSpectrum?.id];
|
|
72
|
-
if (range) {
|
|
73
|
-
range.showMultiplicityTrees = true;
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
draft.view.ranges[activeSpectrum.id] = {
|
|
77
|
-
...defaultRangesViewState,
|
|
78
|
-
showMultiplicityTrees: true,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
66
|
setMargin(draft);
|
|
84
67
|
}
|
|
85
68
|
function setSelectedTool(draft, action) {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { removeByPaths } from '../../../data/utilities/removeByPaths';
|
|
2
|
+
export function removeSpectrumRelatedObjectsById(data, spectrumKey) {
|
|
3
|
+
const nucleus = data.view?.spectra.activeTab;
|
|
4
|
+
removeByPaths(data, [
|
|
5
|
+
['view.ranges', null],
|
|
6
|
+
['view.zones', null],
|
|
7
|
+
['view.peaks', null],
|
|
8
|
+
['view.integrals', null],
|
|
9
|
+
['view.zoom.levels', null],
|
|
10
|
+
[`view.spectra.activeSpectra.${nucleus}`, 'id'],
|
|
11
|
+
['xDomains', null],
|
|
12
|
+
['yDomains', null],
|
|
13
|
+
['originDomain.xDomains', null],
|
|
14
|
+
['originDomain.yDomains', null],
|
|
15
|
+
], spectrumKey);
|
|
16
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { getActiveWorkspace } from '../utilities/getActiveWorkspace';
|
|
2
|
+
export function changePrintPageSettings(draft, action) {
|
|
3
|
+
const currentWorkspacePreferences = getActiveWorkspace(draft);
|
|
4
|
+
const pageSettings = action.payload || {};
|
|
5
|
+
currentWorkspacePreferences.printPageOptions = pageSettings;
|
|
6
|
+
}
|
|
@@ -14,10 +14,6 @@ type addMatrixGenerationExclusionZoneAction = ActionType<'ADD_MATRIX_GENERATION_
|
|
|
14
14
|
from: number;
|
|
15
15
|
to: number;
|
|
16
16
|
};
|
|
17
|
-
range: {
|
|
18
|
-
from: number;
|
|
19
|
-
to: number;
|
|
20
|
-
};
|
|
21
17
|
nucleus: string;
|
|
22
18
|
}>;
|
|
23
19
|
type deleteMatrixGenerationExclusionZoneAction = ActionType<'DELETE_MATRIX_GENERATION_EXCLUSION_ZONE', {
|
|
@@ -22,7 +22,7 @@ function initMatrixGeneration(draft, nucleus) {
|
|
|
22
22
|
return panels.matrixGeneration;
|
|
23
23
|
}
|
|
24
24
|
function addExclusionZone(draft, action) {
|
|
25
|
-
const { zone,
|
|
25
|
+
const { zone, nucleus } = action.payload;
|
|
26
26
|
const matrixGeneration = getMatrixGenerationPanelOptions(draft, nucleus);
|
|
27
27
|
if (!matrixGeneration)
|
|
28
28
|
return;
|
|
@@ -30,7 +30,6 @@ function addExclusionZone(draft, action) {
|
|
|
30
30
|
id: v4(),
|
|
31
31
|
...zone,
|
|
32
32
|
};
|
|
33
|
-
matrixGeneration.matrixOptions.range = range;
|
|
34
33
|
matrixGeneration.matrixOptions.exclusionsZones.push(exclusionZone);
|
|
35
34
|
}
|
|
36
35
|
function deleteExclusionZone(draft, action) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MultipleSpectraAnalysisPreferences, Workspace, WorkSpaceSource } from 'nmr-load-save';
|
|
1
|
+
import { MultipleSpectraAnalysisPreferences, PrintPageOptions, Workspace, WorkSpaceSource } from 'nmr-load-save';
|
|
2
2
|
import { Reducer } from 'react';
|
|
3
3
|
import { SplitPaneSize } from 'react-science/ui';
|
|
4
4
|
import type { NMRiumWorkspace, NMRiumPreferences } from '../../main';
|
|
@@ -72,7 +72,8 @@ export type ChangeInformationBlockPosition = ActionType<'CHANGE_INFORMATION_BLOC
|
|
|
72
72
|
export type ToggleInformationBlock = ActionType<'TOGGLE_INFORMATION_BLOCK', {
|
|
73
73
|
visible?: boolean;
|
|
74
74
|
}>;
|
|
75
|
-
type
|
|
75
|
+
export type ChangePrintPageSettingsAction = ActionType<'CHANGE_PRINT_PAGE_SETTINGS', PrintPageOptions>;
|
|
76
|
+
type PreferencesActions = InitPreferencesAction | SetPreferencesAction | SetPanelsPreferencesAction | SetWorkspaceAction | WorkspaceAction | AddWorkspaceAction | ApplyGeneralPreferences | AnalyzeSpectraAction | ChangeAnalysisColumnValueKeyAction | DeleteAnalysisColumn | SetSpectraAnalysisPanelPreferencesAction | MatrixGenerationActions | SetVerticalSplitterPositionAction | ChangeInformationBlockPosition | ToggleInformationBlock | ChangePrintPageSettingsAction;
|
|
76
77
|
export declare const WORKSPACES: Array<{
|
|
77
78
|
key: NMRiumWorkspace;
|
|
78
79
|
label: string;
|
|
@@ -6,6 +6,7 @@ import { addWorkspace } from './actions/addWorkspace';
|
|
|
6
6
|
import { analyzeSpectra, changeAnalysisColumnValueKey, deleteAnalysisColumn, setSpectraAnalysisPanelsPreferences, } from './actions/analyzeSpectra';
|
|
7
7
|
import { applyGeneralPreferences } from './actions/applyGeneralPreferences';
|
|
8
8
|
import { changeInformationBlockPosition } from './actions/changeInformationBlockPosition';
|
|
9
|
+
import { changePrintPageSettings } from './actions/changePrintPageSettings';
|
|
9
10
|
import { initPreferences } from './actions/initPreferences';
|
|
10
11
|
import { setMatrixGenerationOptions, addExclusionZone, deleteExclusionZone, toggleMatrixGenerationViewProperty, changeMatrixGenerationScale, changeMatrixGenerationStocsyChemicalShift, } from './actions/matrixGeneration';
|
|
11
12
|
import { removeWorkspace } from './actions/removeWorkspace';
|
|
@@ -14,8 +15,8 @@ import { setPanelsPreferences } from './actions/setPanelsPreferences';
|
|
|
14
15
|
import { setPreferences } from './actions/setPreferences';
|
|
15
16
|
import { setVerticalSplitterPosition } from './actions/setVerticalSplitterPosition';
|
|
16
17
|
import { setWorkspace } from './actions/setWorkspace';
|
|
17
|
-
import { mapWorkspaces } from './utilities/mapWorkspaces';
|
|
18
18
|
import { toggleInformationBlock } from './actions/toggleInformationBlock';
|
|
19
|
+
import { mapWorkspaces } from './utilities/mapWorkspaces';
|
|
19
20
|
const LOCAL_STORAGE_SETTINGS_KEY = 'nmr-general-settings';
|
|
20
21
|
export const WORKSPACES_KEYS = {
|
|
21
22
|
componentKey: `nmrium-component-workspace`,
|
|
@@ -139,6 +140,8 @@ function innerPreferencesReducer(draft, action) {
|
|
|
139
140
|
return changeInformationBlockPosition(draft, action);
|
|
140
141
|
case 'TOGGLE_INFORMATION_BLOCK':
|
|
141
142
|
return toggleInformationBlock(draft, action);
|
|
143
|
+
case 'CHANGE_PRINT_PAGE_SETTINGS':
|
|
144
|
+
return changePrintPageSettings(draft, action);
|
|
142
145
|
default:
|
|
143
146
|
return draft;
|
|
144
147
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { SvgNmrAlignBottom, SvgNmrAlignCenter, SvgNmrApodization, SvgNmrBaselineCorrection, SvgNmrFourierTransform, SvgNmrIntegrate, SvgNmrMultipleAnalysis, SvgNmrOverlay3, SvgNmrOverlay3Aligned, SvgNmrPeakPicking, SvgNmrPhaseCorrection, SvgNmrRangePicking, SvgNmrRealImag, SvgNmrZeroFilling, } from 'cheminfo-font';
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
|
-
import { FaSearchPlus, FaExpand, FaDiceFour, FaFileImport, FaFileExport, } from 'react-icons/fa';
|
|
4
|
+
import { FaSearchPlus, FaExpand, FaDiceFour, FaFileImport, FaFileExport, FaDownload, } from 'react-icons/fa';
|
|
5
5
|
import { PiKnifeBold } from 'react-icons/pi';
|
|
6
6
|
import { Toolbar, TooltipHelpContent, } from 'react-science/ui';
|
|
7
7
|
import { useChartData } from '../context/ChartContext';
|
|
@@ -9,6 +9,7 @@ import { useDispatch } from '../context/DispatchContext';
|
|
|
9
9
|
import { useLoader } from '../context/LoaderContext';
|
|
10
10
|
import { usePreferences } from '../context/PreferencesContext';
|
|
11
11
|
import { ToolbarPopoverItem, } from '../elements/ToolbarPopoverItem';
|
|
12
|
+
import { useActiveSpectrum } from '../hooks/useActiveSpectrum';
|
|
12
13
|
import useCheckExperimentalFeature from '../hooks/useCheckExperimentalFeature';
|
|
13
14
|
import { useCheckToolsVisibility, } from '../hooks/useCheckToolsVisibility';
|
|
14
15
|
import useDatumWithSpectraStatistics from '../hooks/useDatumWithSpectraStatistics';
|
|
@@ -16,6 +17,7 @@ import { useDialogToggle } from '../hooks/useDialogToggle';
|
|
|
16
17
|
import useExport from '../hooks/useExport';
|
|
17
18
|
import useToolsFunctions from '../hooks/useToolsFunctions';
|
|
18
19
|
import { useVerticalAlign } from '../hooks/useVerticalAlign';
|
|
20
|
+
import ExportAsJcampModal from '../modal/ExportAsJcampModal';
|
|
19
21
|
import { ImportPublicationStringModal } from '../modal/ImportPublicationStringModal';
|
|
20
22
|
import { LoadJCAMPModal } from '../modal/LoadJCAMPModal';
|
|
21
23
|
import SaveAsModal from '../modal/SaveAsModal';
|
|
@@ -25,6 +27,21 @@ import { EXPORT_MENU, IMPORT_MENU } from './toolbarMenu';
|
|
|
25
27
|
function isPopoverToolItem(item) {
|
|
26
28
|
return !!item?.menuItems;
|
|
27
29
|
}
|
|
30
|
+
function useExportList() {
|
|
31
|
+
const isExperimentalFeature = useCheckExperimentalFeature();
|
|
32
|
+
const spectrum = useActiveSpectrum();
|
|
33
|
+
const exportMenu = isExperimentalFeature
|
|
34
|
+
? EXPORT_MENU
|
|
35
|
+
: EXPORT_MENU.filter((item) => item.id !== 'nmre');
|
|
36
|
+
if (spectrum) {
|
|
37
|
+
exportMenu.push({
|
|
38
|
+
icon: _jsx(FaDownload, {}),
|
|
39
|
+
text: 'Export as JCAMP-DX',
|
|
40
|
+
data: { id: 'exportAsJcamp' },
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return exportMenu;
|
|
44
|
+
}
|
|
28
45
|
export default function ToolBar() {
|
|
29
46
|
const { toolOptions: { selectedTool }, } = useChartData();
|
|
30
47
|
const isButtonVisible = useCheckToolsVisibility();
|
|
@@ -40,15 +57,14 @@ export default function ToolBar() {
|
|
|
40
57
|
importPublicationString: false,
|
|
41
58
|
metaImportation: false,
|
|
42
59
|
saveAs: false,
|
|
60
|
+
exportAsJcamp: false,
|
|
43
61
|
});
|
|
44
62
|
const verticalAlign = useVerticalAlign();
|
|
45
63
|
const { fidCounter, ftCounter } = useDatumWithSpectraStatistics();
|
|
46
64
|
const importMenu = isExperimentalFeature
|
|
47
65
|
? IMPORT_MENU
|
|
48
66
|
: IMPORT_MENU.filter((item) => item.id !== 'importPublicationString');
|
|
49
|
-
const exportMenu =
|
|
50
|
-
? EXPORT_MENU
|
|
51
|
-
: EXPORT_MENU.filter((item) => item.id !== 'nmre');
|
|
67
|
+
const exportMenu = useExportList();
|
|
52
68
|
const { current: { general: { invert }, }, } = usePreferences();
|
|
53
69
|
const handleOnFFTFilter = useCallback(() => {
|
|
54
70
|
dispatch({
|
|
@@ -100,6 +116,9 @@ export default function ToolBar() {
|
|
|
100
116
|
case 'copy':
|
|
101
117
|
void saveToClipboardHandler();
|
|
102
118
|
break;
|
|
119
|
+
case 'exportAsJcamp':
|
|
120
|
+
openDialog('exportAsJcamp');
|
|
121
|
+
break;
|
|
103
122
|
default:
|
|
104
123
|
break;
|
|
105
124
|
}
|
|
@@ -137,7 +156,7 @@ export default function ToolBar() {
|
|
|
137
156
|
title: options.peakPicking.label,
|
|
138
157
|
shortcuts: ['p'],
|
|
139
158
|
description: 'Detect peaks manually or automatically in the spectrum.',
|
|
140
|
-
link: 'https://docs.nmrium.org/20_1d-spectra/peaks
|
|
159
|
+
link: 'https://docs.nmrium.org/20_1d-spectra/peaks',
|
|
141
160
|
},
|
|
142
161
|
icon: _jsx(SvgNmrPeakPicking, {}),
|
|
143
162
|
},
|
|
@@ -157,7 +176,7 @@ export default function ToolBar() {
|
|
|
157
176
|
title: options.zonePicking.label,
|
|
158
177
|
shortcuts: ['r'],
|
|
159
178
|
description: `Draw 2D zones by clicking, dragging, and releasing${!invert ? 'while holding SHIFT' : ''}. Alternatively, detect zones automatically.`,
|
|
160
|
-
link: 'https://docs.nmrium.org/30_2d-spectra/zones
|
|
179
|
+
link: 'https://docs.nmrium.org/30_2d-spectra/zones',
|
|
161
180
|
},
|
|
162
181
|
icon: _jsx(FaDiceFour, {}),
|
|
163
182
|
},
|
|
@@ -166,7 +185,7 @@ export default function ToolBar() {
|
|
|
166
185
|
tooltip: {
|
|
167
186
|
title: options.slicing.label,
|
|
168
187
|
description: 'Display the horizontal and vertical slices of the selected 2D spectrum at the level of the pointer.',
|
|
169
|
-
link: 'https://docs.nmrium.org/30_2d-spectra/slicing
|
|
188
|
+
link: 'https://docs.nmrium.org/30_2d-spectra/slicing',
|
|
170
189
|
},
|
|
171
190
|
icon: _jsx(PiKnifeBold, {}),
|
|
172
191
|
},
|
|
@@ -176,7 +195,7 @@ export default function ToolBar() {
|
|
|
176
195
|
title: options.rangePicking.label,
|
|
177
196
|
shortcuts: ['r'],
|
|
178
197
|
description: `Define ranges and analyse multiplet automatically or manually. Click, drag, and release ${!invert ? 'while holding SHIFT' : ''} to draw the range. Ranges can be resized by moving the edges.`,
|
|
179
|
-
link: 'https://docs.nmrium.org/20_1d-spectra/ranges
|
|
198
|
+
link: 'https://docs.nmrium.org/20_1d-spectra/ranges',
|
|
180
199
|
},
|
|
181
200
|
icon: _jsx(SvgNmrRangePicking, {}),
|
|
182
201
|
},
|
|
@@ -202,7 +221,7 @@ export default function ToolBar() {
|
|
|
202
221
|
title: options.zeroFilling.label,
|
|
203
222
|
shortcuts: ['z'],
|
|
204
223
|
description: 'Improve spectrum quality by increasing the number of points. By default, the number of points is twice as many as in the original FID.',
|
|
205
|
-
link: 'https://docs.nmrium.org/20_1d-spectra/preprocessing
|
|
224
|
+
link: 'https://docs.nmrium.org/20_1d-spectra/preprocessing#zero-filling',
|
|
206
225
|
},
|
|
207
226
|
icon: _jsx(SvgNmrZeroFilling, {}),
|
|
208
227
|
},
|
|
@@ -212,7 +231,7 @@ export default function ToolBar() {
|
|
|
212
231
|
title: options.phaseCorrection.label,
|
|
213
232
|
shortcuts: ['a'],
|
|
214
233
|
description: `Correct the spectrum phase manually or automatically. For manual phase correction, define the pivot${!invert ? ' using SHIFT +' : ''} click, then press the PH0 and PH1 button, and move the mouse horizontally.`,
|
|
215
|
-
link: 'https://docs.nmrium.org/20_1d-spectra/phase
|
|
234
|
+
link: 'https://docs.nmrium.org/20_1d-spectra/phase',
|
|
216
235
|
},
|
|
217
236
|
icon: _jsx(SvgNmrPhaseCorrection, {}),
|
|
218
237
|
},
|
|
@@ -231,7 +250,7 @@ export default function ToolBar() {
|
|
|
231
250
|
title: options.baselineCorrection.label,
|
|
232
251
|
shortcuts: ['b'],
|
|
233
252
|
description: `Correct the baseline of the spectrum. You should draw zones corresponding to the noise using click, drag, release${!invert ? 'while holding SHIFT' : ''}.`,
|
|
234
|
-
link: 'https://docs.nmrium.org/20_1d-spectra/baseline
|
|
253
|
+
link: 'https://docs.nmrium.org/20_1d-spectra/baseline',
|
|
235
254
|
},
|
|
236
255
|
icon: _jsx(SvgNmrBaselineCorrection, {}),
|
|
237
256
|
},
|
|
@@ -252,7 +271,7 @@ export default function ToolBar() {
|
|
|
252
271
|
title: options.fft.label,
|
|
253
272
|
shortcuts: ['t'],
|
|
254
273
|
description: 'Perform a Fourier transform on the FID.',
|
|
255
|
-
link: 'https://docs.nmrium.org/20_1d-spectra/ft
|
|
274
|
+
link: 'https://docs.nmrium.org/20_1d-spectra/ft',
|
|
256
275
|
},
|
|
257
276
|
onClick: handleOnFFTFilter,
|
|
258
277
|
icon: _jsx(SvgNmrFourierTransform, {}),
|
|
@@ -299,7 +318,7 @@ export default function ToolBar() {
|
|
|
299
318
|
tooltip: {
|
|
300
319
|
title: `Display ${isRealSpectrumShown ? 'real' : 'imaginary'}`,
|
|
301
320
|
description: 'Toggle between the imaginary and real parts of the spectrum.',
|
|
302
|
-
link: 'https://docs.nmrium.org/20_1d-spectra/views
|
|
321
|
+
link: 'https://docs.nmrium.org/20_1d-spectra/views',
|
|
303
322
|
},
|
|
304
323
|
icon: _jsx(SvgNmrRealImag, {}),
|
|
305
324
|
onClick: changeSpectrumViewHandler,
|
|
@@ -316,7 +335,7 @@ export default function ToolBar() {
|
|
|
316
335
|
onClick: alignSpectraVerticallyHandler,
|
|
317
336
|
},
|
|
318
337
|
];
|
|
319
|
-
return (_jsxs(_Fragment, { children: [_jsx(LoadJCAMPModal, { isOpen: dialog.loadJCAMP, onCloseDialog: closeDialog }), _jsx(ImportPublicationStringModal, { isOpen: dialog.importPublicationString, onClose: closeDialog }), _jsx(MetaImportationModal, { isOpen: dialog.metaImportation, onCloseDialog: closeDialog }), _jsx(SaveAsModal, { isOpen: dialog.saveAs, onCloseDialog: closeDialog }), _jsx(Toolbar, { vertical: true, children: toolItems.map((item) => {
|
|
338
|
+
return (_jsxs(_Fragment, { children: [_jsx(LoadJCAMPModal, { isOpen: dialog.loadJCAMP, onCloseDialog: closeDialog }), _jsx(ImportPublicationStringModal, { isOpen: dialog.importPublicationString, onClose: closeDialog }), _jsx(MetaImportationModal, { isOpen: dialog.metaImportation, onCloseDialog: closeDialog }), dialog.exportAsJcamp && (_jsx(ExportAsJcampModal, { exportActiveSpectrum: true, closeDialog: closeDialog })), _jsx(SaveAsModal, { isOpen: dialog.saveAs, onCloseDialog: closeDialog }), _jsx(Toolbar, { vertical: true, children: toolItems.map((item) => {
|
|
320
339
|
const { id, icon, tooltip, checkOptions, condition } = item;
|
|
321
340
|
const show = isButtonVisible(id, checkOptions) &&
|
|
322
341
|
(condition === undefined || condition);
|
|
@@ -20,7 +20,7 @@ export interface ToolOptionItem {
|
|
|
20
20
|
isFilter: boolean;
|
|
21
21
|
isExperimental?: true;
|
|
22
22
|
}
|
|
23
|
-
export type Tool = keyof NMRiumToolBarPreferences | 'HMove' | 'equalizer' | 'generalSelector' | '
|
|
23
|
+
export type Tool = keyof NMRiumToolBarPreferences | 'HMove' | 'equalizer' | 'generalSelector' | 'databaseRangesSelection' | 'matrixGenerationExclusionZones';
|
|
24
24
|
type RecordOptions = Record<Tool, ToolOptionItem>;
|
|
25
25
|
export declare const options: RecordOptions;
|
|
26
26
|
export {};
|
|
@@ -184,20 +184,6 @@ export const options = {
|
|
|
184
184
|
],
|
|
185
185
|
isToggle: true,
|
|
186
186
|
},
|
|
187
|
-
editRange: {
|
|
188
|
-
id: 'editRange',
|
|
189
|
-
label: 'edit range',
|
|
190
|
-
hasOptionPanel: false,
|
|
191
|
-
isFilter: false,
|
|
192
|
-
mode: '1D',
|
|
193
|
-
spectraOptions: [
|
|
194
|
-
{
|
|
195
|
-
info: [{ key: 'isFt', value: true }],
|
|
196
|
-
active: true,
|
|
197
|
-
},
|
|
198
|
-
],
|
|
199
|
-
isToggle: true,
|
|
200
|
-
},
|
|
201
187
|
multipleSpectraAnalysis: {
|
|
202
188
|
id: 'multipleSpectraAnalysis',
|
|
203
189
|
label: 'Multiple spectra analysis',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Spectrum, Workspace } from 'nmr-load-save';
|
|
1
|
+
import { Spectrum, Workspace, StateMolecule } from 'nmr-load-save';
|
|
2
2
|
import { State } from '../component/reducer/Reducer';
|
|
3
3
|
export declare enum DataExportOptions {
|
|
4
4
|
ROW_DATA = "ROW_DATA",
|
|
@@ -22,14 +22,11 @@ export declare function addJcamp(output: any, jcamp: any, options: any, usedColo
|
|
|
22
22
|
export declare function toJSON(state: Partial<State>, preferencesState: Partial<{
|
|
23
23
|
current: Workspace;
|
|
24
24
|
}>, options?: ExportOptions): any;
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export interface ExportAsJcampOptions {
|
|
31
|
-
onlyReal?: boolean;
|
|
32
|
-
dataExportStage?: DataExportStageStrings;
|
|
25
|
+
export type DataExportStage = 'originalFid' | 'originalFtReal' | 'originalFtRealImaginary' | 'processedReal' | 'processedRealImaginary';
|
|
26
|
+
export declare function exportAsJcamp(spectrum: Spectrum, dataExportStage: DataExportStage): void;
|
|
27
|
+
interface ExportForCTOptions {
|
|
28
|
+
spectrum: Spectrum;
|
|
29
|
+
molecules: StateMolecule[];
|
|
33
30
|
}
|
|
34
|
-
export declare function
|
|
31
|
+
export declare function exportForCT(options: ExportForCTOptions): Promise<void>;
|
|
35
32
|
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { saveAs } from 'file-saver';
|
|
2
|
+
import JSZip from 'jszip';
|
|
2
3
|
import { processJcamp, serializeNmriumState, CURRENT_EXPORT_VERSION, spectrum1DToJcamp, } from 'nmr-load-save';
|
|
4
|
+
import OCL from 'openchemlib/full';
|
|
3
5
|
import { isSpectrum1D, initiateDatum1D } from './data1d/Spectrum1D';
|
|
4
6
|
import { initiateDatum2D } from './data2d/Spectrum2D';
|
|
5
7
|
import * as Molecule from './molecules/Molecule';
|
|
@@ -75,44 +77,63 @@ export function toJSON(state, preferencesState, options = {}) {
|
|
|
75
77
|
});
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
|
-
export
|
|
79
|
-
Original: 'ORIGINAL',
|
|
80
|
-
Processed: 'PROCESSED',
|
|
81
|
-
};
|
|
82
|
-
export function exportAsJcamp(spectrum, options = {}) {
|
|
80
|
+
export function exportAsJcamp(spectrum, dataExportStage) {
|
|
83
81
|
let jcamp = null;
|
|
84
|
-
if (isSpectrum1D(spectrum)) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
if (!isSpectrum1D(spectrum)) {
|
|
83
|
+
throw new Error('convert 2D spectrum to JCAMP is not supported');
|
|
84
|
+
}
|
|
85
|
+
const { originalData, originalInfo, ...otherSpectrum } = spectrum;
|
|
86
|
+
const exportedSpectrum = { ...otherSpectrum };
|
|
87
|
+
if (!['processedReal', 'processedRealImaginary'].includes(dataExportStage)) {
|
|
90
88
|
if (!originalData || !originalInfo) {
|
|
91
89
|
throw new Error('original data should exists');
|
|
92
90
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
data,
|
|
97
|
-
info,
|
|
98
|
-
filters,
|
|
99
|
-
}, { onlyReal });
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
jcamp = spectrum1DToJcamp({
|
|
103
|
-
...spectrum,
|
|
104
|
-
data: originalData,
|
|
105
|
-
info: originalInfo,
|
|
106
|
-
filters: [],
|
|
107
|
-
}, { onlyReal });
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
throw new Error('convert 2D spectrum to JCAMP is not supported');
|
|
91
|
+
exportedSpectrum.filters = [];
|
|
92
|
+
exportedSpectrum.data = originalData;
|
|
93
|
+
exportedSpectrum.info = originalInfo;
|
|
112
94
|
}
|
|
95
|
+
const onlyReal = dataExportStage === 'processedReal' || dataExportStage === 'originalFtReal';
|
|
96
|
+
jcamp = spectrum1DToJcamp(exportedSpectrum, {
|
|
97
|
+
onlyReal,
|
|
98
|
+
});
|
|
113
99
|
if (!jcamp) {
|
|
114
100
|
throw new Error('convert spectrum to JCAMP failed');
|
|
115
101
|
}
|
|
116
102
|
const blob = new Blob([jcamp], { type: 'text/plain' });
|
|
117
103
|
saveAs(blob, `${spectrum.info.name}.jdx`);
|
|
118
104
|
}
|
|
105
|
+
export async function exportForCT(options) {
|
|
106
|
+
const { spectrum, molecules } = options;
|
|
107
|
+
if (!isSpectrum1D(spectrum)) {
|
|
108
|
+
throw new Error('2D spectrum is not supported');
|
|
109
|
+
}
|
|
110
|
+
if (!spectrum.info.isFt) {
|
|
111
|
+
throw new Error('The spectrum must be a Fourier Transform (FT) spectrum.');
|
|
112
|
+
}
|
|
113
|
+
if (!(Array.isArray(molecules) && molecules.length > 0)) {
|
|
114
|
+
throw new Error('Molecule file is required. Please add a molecule');
|
|
115
|
+
}
|
|
116
|
+
const jcamp = spectrum1DToJcamp(spectrum, {
|
|
117
|
+
onlyReal: true,
|
|
118
|
+
});
|
|
119
|
+
if (!jcamp) {
|
|
120
|
+
throw new Error('Failed to convert the 1D spectrum to JCAMP');
|
|
121
|
+
}
|
|
122
|
+
const name = spectrum.info.name;
|
|
123
|
+
const zip = new JSZip();
|
|
124
|
+
//add jcamp file
|
|
125
|
+
zip.file(`${name}.dx`, jcamp);
|
|
126
|
+
//add mol file
|
|
127
|
+
const { molfile } = molecules[0];
|
|
128
|
+
const molecule = OCL.Molecule.fromMolfile(molfile);
|
|
129
|
+
const molFileName = molecule.getMolecularFormula().formula;
|
|
130
|
+
zip.file(`${molFileName}.mol`, molecule.toMolfile());
|
|
131
|
+
const blob = await zip.generateAsync({
|
|
132
|
+
type: 'blob',
|
|
133
|
+
compression: 'DEFLATE',
|
|
134
|
+
compressionOptions: {
|
|
135
|
+
level: 9,
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
saveAs(blob, name);
|
|
139
|
+
}
|
|
@@ -13,7 +13,6 @@ export declare function setSumOptions(data: Ranges | Integrals, params: {
|
|
|
13
13
|
options: SetSumOptions;
|
|
14
14
|
nucleus: string;
|
|
15
15
|
}): void;
|
|
16
|
-
export declare function getAtoms(mf: string): Record<string, number>;
|
|
17
16
|
/**
|
|
18
17
|
* change the sum for ranges and integrals in all spectra based on molecule
|
|
19
18
|
* it handle three cases
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MF } from 'mf-parser';
|
|
1
2
|
import getAtom from '../../utilities/getAtom';
|
|
2
3
|
import { isSpectrum1D, updateRangesRelativeValues, updateIntegralsRelativeValues, } from '.';
|
|
3
4
|
export function initSumOptions(options, params) {
|
|
@@ -26,7 +27,7 @@ export function getSum(mf, nucleus) {
|
|
|
26
27
|
if (!mf || !nucleus)
|
|
27
28
|
return defaultSum;
|
|
28
29
|
const atom = getAtom(nucleus);
|
|
29
|
-
const atoms =
|
|
30
|
+
const atoms = new MF(mf).getInfo().atoms;
|
|
30
31
|
return atoms[atom] || defaultSum;
|
|
31
32
|
}
|
|
32
33
|
export function setSumOptions(data, params) {
|
|
@@ -47,15 +48,6 @@ export function setSumOptions(data, params) {
|
|
|
47
48
|
data.options = { ...resOptions, sumAuto: false, sum: options.sum };
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
export function getAtoms(mf) {
|
|
51
|
-
const result = {};
|
|
52
|
-
// eslint-disable-next-line prefer-named-capture-group
|
|
53
|
-
const data = mf.split(/(\d+)/);
|
|
54
|
-
for (let i = 0; i < data.length - 1; i = i + 2) {
|
|
55
|
-
result[data[i]] = Number(data[i + 1]);
|
|
56
|
-
}
|
|
57
|
-
return result;
|
|
58
|
-
}
|
|
59
51
|
/**
|
|
60
52
|
* change the sum for ranges and integrals in all spectra based on molecule
|
|
61
53
|
* it handle three cases
|
|
@@ -11,7 +11,7 @@ interface RandomColorOptions extends BaseColorOptions {
|
|
|
11
11
|
regenerate: true;
|
|
12
12
|
random?: boolean;
|
|
13
13
|
}
|
|
14
|
-
export declare const COLORS:
|
|
14
|
+
export declare const COLORS: readonly string[];
|
|
15
15
|
export declare function get1DColor(spectrum: any, options: ColorOptions | RandomColorOptions): {
|
|
16
16
|
color: string;
|
|
17
17
|
};
|
|
@@ -12,6 +12,6 @@ export { changeRangeSignal } from './ranges/changeRangeSignal';
|
|
|
12
12
|
export { checkRangeKind } from './ranges/checkRangeKind';
|
|
13
13
|
export { detectRange } from './ranges/detectRange';
|
|
14
14
|
export { detectRanges } from './ranges/detectRanges';
|
|
15
|
-
export {
|
|
15
|
+
export { resurrectSpectrumFromRanges, resurrectSpectrumFromSignals, } from './ranges/resurrectSpectrum';
|
|
16
16
|
export { mapRanges, getShiftX, checkIntegralKind, updateRangesRelativeValues, updateIntegralsRelativeValues, } from 'nmr-processing';
|
|
17
17
|
export { get1DColor } from './get1DColor';
|
|
@@ -12,6 +12,6 @@ export { changeRangeSignal } from './ranges/changeRangeSignal';
|
|
|
12
12
|
export { checkRangeKind } from './ranges/checkRangeKind';
|
|
13
13
|
export { detectRange } from './ranges/detectRange';
|
|
14
14
|
export { detectRanges } from './ranges/detectRanges';
|
|
15
|
-
export {
|
|
15
|
+
export { resurrectSpectrumFromRanges, resurrectSpectrumFromSignals, } from './ranges/resurrectSpectrum';
|
|
16
16
|
export { mapRanges, getShiftX, checkIntegralKind, updateRangesRelativeValues, updateIntegralsRelativeValues, } from 'nmr-processing';
|
|
17
17
|
export { get1DColor } from './get1DColor';
|
|
@@ -11,18 +11,12 @@ export declare function createRange(spectrum: Spectrum1D, options: Pick<Range, '
|
|
|
11
11
|
delta: number;
|
|
12
12
|
multiplicity: string;
|
|
13
13
|
js: import("nmr-processing").Jcoupling[];
|
|
14
|
-
atoms?: number[];
|
|
15
|
-
assignment?: string;
|
|
16
|
-
diaIDs?: string[];
|
|
17
|
-
nbAtoms?: number;
|
|
18
|
-
integration?: number;
|
|
19
|
-
|
|
20
|
-
mean: number;
|
|
21
|
-
sd: number;
|
|
22
|
-
min: number;
|
|
23
|
-
max: number;
|
|
24
|
-
nb: number;
|
|
25
|
-
};
|
|
14
|
+
atoms?: number[] | undefined;
|
|
15
|
+
assignment?: string | undefined;
|
|
16
|
+
diaIDs?: string[] | undefined;
|
|
17
|
+
nbAtoms?: number | undefined;
|
|
18
|
+
integration?: number | undefined;
|
|
19
|
+
statistics?: import("nmr-processing").NMRSignalStatistics | undefined;
|
|
26
20
|
kind: string;
|
|
27
21
|
id: string;
|
|
28
22
|
peaks: {
|
|
@@ -43,8 +37,8 @@ export declare function createRange(spectrum: Spectrum1D, options: Pick<Range, '
|
|
|
43
37
|
kind: string;
|
|
44
38
|
integration: number;
|
|
45
39
|
nbAtoms?: number;
|
|
46
|
-
multiplicity?: string;
|
|
47
|
-
assignment?: string;
|
|
48
|
-
diaIDs?: string[];
|
|
49
|
-
pubIntegral?: number;
|
|
40
|
+
multiplicity?: string | undefined;
|
|
41
|
+
assignment?: string | undefined;
|
|
42
|
+
diaIDs?: string[] | undefined;
|
|
43
|
+
pubIntegral?: number | undefined;
|
|
50
44
|
} | undefined;
|
|
@@ -34,11 +34,5 @@ export default function detectSignals(data: DataXY<Float64Array>, options: {
|
|
|
34
34
|
nbAtoms?: number;
|
|
35
35
|
integration?: number;
|
|
36
36
|
peaks?: import("nmr-processing").NMRPeak1D[];
|
|
37
|
-
|
|
38
|
-
mean: number;
|
|
39
|
-
sd: number;
|
|
40
|
-
min: number;
|
|
41
|
-
max: number;
|
|
42
|
-
nb: number;
|
|
43
|
-
};
|
|
37
|
+
statistics?: import("nmr-processing").NMRSignalStatistics;
|
|
44
38
|
}[];
|
|
@@ -7,6 +7,7 @@ export default function detectSignals(data, options) {
|
|
|
7
7
|
const { fromIndex, toIndex } = xGetFromToIndex(data.x, { from, to });
|
|
8
8
|
const size = toIndex - fromIndex;
|
|
9
9
|
if (size <= 16 || size >= MAX_LENGTH) {
|
|
10
|
+
const frequencyCluster = (to - from) * frequency;
|
|
10
11
|
const ranges = xyAutoRangesPicking(data, {
|
|
11
12
|
logger,
|
|
12
13
|
peakPicking: {
|
|
@@ -25,7 +26,7 @@ export default function detectSignals(data, options) {
|
|
|
25
26
|
frequency,
|
|
26
27
|
nucleus,
|
|
27
28
|
compile: true,
|
|
28
|
-
frequencyCluster
|
|
29
|
+
frequencyCluster,
|
|
29
30
|
keepPeaks: true,
|
|
30
31
|
clean: 0.3,
|
|
31
32
|
},
|