nmrium 0.42.0 → 0.43.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/ApodizationLine.js +1 -1
- package/lib/component/1d/Chart1D.js +3 -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.js +3 -2
- package/lib/component/2d/SlicingView.js +1 -1
- package/lib/component/2d/ft/Contours.js +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.d.ts +5 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.js +47 -6
- package/lib/component/assignment/index.d.ts +6 -1
- package/lib/component/assignment/index.js +5 -1
- package/lib/component/context/DispatchContext.d.ts +1 -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/NumberInput.d.ts +1 -0
- package/lib/component/elements/NumberInput.js +10 -3
- 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 +5 -5
- 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 +89 -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/PredictSpectraModal.js +1 -1
- 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/setting/GeneralSettings.js +2 -2
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +6 -11
- 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 +3 -3
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +4 -4
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +11 -5
- package/lib/component/panels/RangesPanel/RangesHeader.js +6 -10
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +4 -3
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +3 -2
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +3 -4
- package/lib/component/panels/header/DefaultPanelHeader.js +9 -5
- package/lib/component/panels/predictionPanel/PredictionPanel.js +1 -1
- 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 +0 -1
- package/lib/component/reducer/Reducer.d.ts +1 -6
- package/lib/component/reducer/Reducer.js +30 -6
- 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 +1 -1
- package/lib/component/reducer/actions/PeaksActions.d.ts +6 -4
- package/lib/component/reducer/actions/PeaksActions.js +19 -1
- package/lib/component/reducer/actions/RangesActions.d.ts +6 -2
- package/lib/component/reducer/actions/RangesActions.js +31 -3
- 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 +1 -0
- package/lib/component/toolbar/ToolTypes.js +36 -0
- 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/data1d/Spectrum1D/ranges/addRange.d.ts +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +2 -8
- 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/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 +3 -2
- package/lib-cjs/component/2d/SlicingView.js +1 -1
- package/lib-cjs/component/2d/ft/Contours.js +1 -1
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +46 -5
- 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/NumberInput.js +12 -2
- 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 +5 -5
- 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 +96 -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/PredictSpectraModal.js +1 -1
- 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/setting/GeneralSettings.js +2 -2
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +29 -11
- 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 +4 -4
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +32 -3
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +29 -10
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +27 -3
- 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/header/DefaultPanelHeader.js +11 -5
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +1 -1
- 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 +0 -1
- package/lib-cjs/component/reducer/Reducer.js +29 -5
- 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 +1 -1
- package/lib-cjs/component/reducer/actions/PeaksActions.js +20 -1
- package/lib-cjs/component/reducer/actions/RangesActions.js +31 -2
- package/lib-cjs/component/toolbar/FunctionToolBar.js +13 -3
- package/lib-cjs/component/toolbar/ToolTypes.js +36 -0
- 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/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
|
@@ -4,6 +4,13 @@ exports.prediction = void 0;
|
|
|
4
4
|
exports.prediction = {
|
|
5
5
|
version: 1,
|
|
6
6
|
label: 'Prediction',
|
|
7
|
+
general: {
|
|
8
|
+
dimmedSpectraOpacity: 0.5,
|
|
9
|
+
verticalSplitterPosition: '440px',
|
|
10
|
+
verticalSplitterCloseThreshold: 600,
|
|
11
|
+
spectraRendering: 'auto',
|
|
12
|
+
loggingLevel: 'info',
|
|
13
|
+
},
|
|
7
14
|
display: {
|
|
8
15
|
panels: {
|
|
9
16
|
spectraPanel: { display: true },
|
|
@@ -31,6 +38,8 @@ exports.prediction = {
|
|
|
31
38
|
zoomOut: true,
|
|
32
39
|
zoom: true,
|
|
33
40
|
autoRangeAndZonePicking: true,
|
|
41
|
+
fftDimension1: true,
|
|
42
|
+
fftDimension2: true,
|
|
34
43
|
},
|
|
35
44
|
},
|
|
36
45
|
formatting: {
|
|
@@ -49,16 +49,16 @@ exports.FREQUENCIES = [
|
|
|
49
49
|
{ value: 1000, label: '1000 MHz' },
|
|
50
50
|
{ value: 1200, label: '1200 MHz' },
|
|
51
51
|
];
|
|
52
|
-
|
|
53
|
-
async function predictSpectra(molfile) {
|
|
52
|
+
async function predictSpectra(molfile, options) {
|
|
54
53
|
const molecule = full_1.default.Molecule.fromMolfile(molfile);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
}
|
|
54
|
+
const predictOptions = {};
|
|
55
|
+
for (const key in options) {
|
|
56
|
+
if (!options[key])
|
|
57
|
+
continue;
|
|
58
|
+
const experiment = key === 'proton' ? 'H' : key === 'carbon' ? 'C' : key;
|
|
59
|
+
predictOptions[experiment] = {};
|
|
60
|
+
}
|
|
61
|
+
return (0, nmr_processing_1.predict)(molecule, { predictOptions });
|
|
62
62
|
}
|
|
63
63
|
exports.predictSpectra = predictSpectra;
|
|
64
64
|
function generateName(name, options) {
|
|
@@ -8,7 +8,6 @@ const uuid_1 = require("@lukeed/uuid");
|
|
|
8
8
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
9
9
|
const nmr_processing_1 = require("nmr-processing");
|
|
10
10
|
const SignalsKinds_1 = require("../../../constants/SignalsKinds");
|
|
11
|
-
const SumManager_1 = require("../SumManager");
|
|
12
11
|
const detectSignal_1 = __importDefault(require("./detectSignal"));
|
|
13
12
|
function createRangeObj({ from, to, absolute, signal, }) {
|
|
14
13
|
return {
|
|
@@ -23,7 +22,7 @@ function createRangeObj({ from, to, absolute, signal, }) {
|
|
|
23
22
|
}
|
|
24
23
|
exports.createRangeObj = createRangeObj;
|
|
25
24
|
function addRange(spectrum, options) {
|
|
26
|
-
const { from, to
|
|
25
|
+
const { from, to } = options;
|
|
27
26
|
const { x, re } = spectrum.data;
|
|
28
27
|
const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from, to, reverse: true });
|
|
29
28
|
// detectSignal use the advance multiplet-analysis that can crash if too many points
|
|
@@ -43,12 +42,7 @@ function addRange(spectrum, options) {
|
|
|
43
42
|
}
|
|
44
43
|
try {
|
|
45
44
|
if (range) {
|
|
46
|
-
spectrum.ranges.options = (0, SumManager_1.initSumOptions)(spectrum.ranges.options, {
|
|
47
|
-
molecules,
|
|
48
|
-
nucleus,
|
|
49
|
-
});
|
|
50
45
|
spectrum.ranges.values = spectrum.ranges.values.concat((0, nmr_processing_1.mapRanges)([range], spectrum));
|
|
51
|
-
(0, nmr_processing_1.updateRangesRelativeValues)(spectrum);
|
|
52
46
|
}
|
|
53
47
|
}
|
|
54
48
|
catch (error) {
|
|
@@ -10,8 +10,8 @@ const getAtomsFromMF_1 = __importDefault(require("../utilities/getAtomsFromMF"))
|
|
|
10
10
|
exports.DRAGGABLE_STRUCTURE_INITIAL_BOUNDING_REACT = {
|
|
11
11
|
x: 100,
|
|
12
12
|
y: 50,
|
|
13
|
-
width:
|
|
14
|
-
height:
|
|
13
|
+
width: 190,
|
|
14
|
+
height: 200,
|
|
15
15
|
};
|
|
16
16
|
function initMolecule(options = {}) {
|
|
17
17
|
const id = options.id || (0, uuid_1.v4)();
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const modifiersKeys = [
|
|
4
|
+
'Alt',
|
|
5
|
+
'AltGraph',
|
|
6
|
+
'Control',
|
|
7
|
+
'Meta',
|
|
8
|
+
'Shift',
|
|
9
|
+
];
|
|
3
10
|
function checkModifierKeyActivated(event) {
|
|
4
|
-
|
|
5
|
-
'Alt',
|
|
6
|
-
'AltGraph',
|
|
7
|
-
'Control',
|
|
8
|
-
'Meta',
|
|
9
|
-
'Shift',
|
|
10
|
-
];
|
|
11
|
-
for (const key of modifiersKeys) {
|
|
12
|
-
if (event.getModifierState(key)) {
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return false;
|
|
11
|
+
return modifiersKeys.some((key) => event.getModifierState(key));
|
|
17
12
|
}
|
|
18
13
|
exports.default = checkModifierKeyActivated;
|
package/lib-cjs/versionInfo.js
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nmrium",
|
|
3
3
|
"description": "React component to display and process nuclear magnetic resonance (NMR) spectra.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.43.0",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"main": "lib-cjs/component/
|
|
7
|
-
"module": "lib/component/
|
|
8
|
-
"types": "lib/component/
|
|
6
|
+
"main": "lib-cjs/component/main/index.js",
|
|
7
|
+
"module": "lib/component/main/index.js",
|
|
8
|
+
"types": "lib/component/main/index.d.ts",
|
|
9
9
|
"files": [
|
|
10
10
|
"lib",
|
|
11
11
|
"lib-cjs"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"url": "git+https://github.com/cheminfo/nmrium.git"
|
|
48
48
|
},
|
|
49
49
|
"volta": {
|
|
50
|
-
"node": "18.
|
|
50
|
+
"node": "18.17.0"
|
|
51
51
|
},
|
|
52
52
|
"overrides": {
|
|
53
53
|
"react": "$react",
|
|
@@ -59,8 +59,9 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@emotion/react": "^11.11.1",
|
|
62
|
+
"@emotion/styled": "^11.11.0",
|
|
62
63
|
"@lukeed/uuid": "^2.0.1",
|
|
63
|
-
"cheminfo-font": "^1.
|
|
64
|
+
"cheminfo-font": "^1.11.0",
|
|
64
65
|
"cheminfo-types": "^1.7.2",
|
|
65
66
|
"clipboard-polyfill": "^4.0.0",
|
|
66
67
|
"convert-to-jcamp": "^5.4.7",
|
|
@@ -68,8 +69,8 @@
|
|
|
68
69
|
"eventemitter3": "^5.0.1",
|
|
69
70
|
"fifo-logger": "^0.6.1",
|
|
70
71
|
"file-saver": "^2.0.5",
|
|
71
|
-
"filelist-utils": "^1.10.
|
|
72
|
-
"formik": "^2.4.
|
|
72
|
+
"filelist-utils": "^1.10.2",
|
|
73
|
+
"formik": "^2.4.3",
|
|
73
74
|
"immer": "^10.0.2",
|
|
74
75
|
"jszip": "^3.10.1",
|
|
75
76
|
"lodash": "^4.17.21",
|
|
@@ -86,25 +87,25 @@
|
|
|
86
87
|
"ml-stat": "^1.3.3",
|
|
87
88
|
"multiplet-analysis": "^2.1.2",
|
|
88
89
|
"nmr-correlation": "^2.3.3",
|
|
89
|
-
"nmr-load-save": "^0.
|
|
90
|
-
"nmr-processing": "^
|
|
90
|
+
"nmr-load-save": "^0.17.2",
|
|
91
|
+
"nmr-processing": "^10.0.5",
|
|
91
92
|
"nmredata": "^0.9.2",
|
|
92
93
|
"numeral": "^2.0.6",
|
|
93
94
|
"openchemlib": "^8.3.0",
|
|
94
|
-
"openchemlib-utils": "^
|
|
95
|
+
"openchemlib-utils": "^4.3.2",
|
|
95
96
|
"papaparse": "^5.4.1",
|
|
96
|
-
"re-resizable": "
|
|
97
|
+
"re-resizable": "6.9.6",
|
|
97
98
|
"react-d3-utils": "^1.0.0",
|
|
98
99
|
"react-dropzone": "^14.2.3",
|
|
99
100
|
"react-error-boundary": "^4.0.10",
|
|
100
101
|
"react-icons": "^4.10.1",
|
|
101
102
|
"react-inspector": "^6.0.2",
|
|
102
103
|
"react-mf": "^2.0.2",
|
|
103
|
-
"react-ocl": "^
|
|
104
|
-
"react-ocl-nmr": "^
|
|
104
|
+
"react-ocl": "^6.1.0",
|
|
105
|
+
"react-ocl-nmr": "^3.0.0",
|
|
105
106
|
"react-plot": "^1.4.2",
|
|
106
107
|
"react-rnd": "^10.4.1",
|
|
107
|
-
"react-science": "^0.
|
|
108
|
+
"react-science": "^0.25.0",
|
|
108
109
|
"react-slider": "^2.0.6",
|
|
109
110
|
"react-table": "^7.8.0",
|
|
110
111
|
"react-transition-group": "^4.4.5",
|
|
@@ -116,25 +117,25 @@
|
|
|
116
117
|
"@babel/plugin-transform-modules-commonjs": "^7.22.5",
|
|
117
118
|
"@babel/preset-react": "^7.22.5",
|
|
118
119
|
"@babel/preset-typescript": "^7.22.5",
|
|
119
|
-
"@playwright/test": "^1.36.
|
|
120
|
+
"@playwright/test": "^1.36.2",
|
|
120
121
|
"@simbathesailor/use-what-changed": "^2.0.0",
|
|
121
122
|
"@types/d3": "^7.4.0",
|
|
122
|
-
"@types/node": "^20.4.
|
|
123
|
+
"@types/node": "^20.4.8",
|
|
123
124
|
"@types/papaparse": "^5.3.7",
|
|
124
|
-
"@types/react": "^18.2.
|
|
125
|
+
"@types/react": "^18.2.19",
|
|
125
126
|
"@types/react-dom": "^18.2.7",
|
|
126
127
|
"@types/react-table": "^7.7.14",
|
|
127
128
|
"@vitejs/plugin-react-swc": "^3.3.2",
|
|
128
|
-
"@vitest/coverage-v8": "^0.
|
|
129
|
+
"@vitest/coverage-v8": "^0.34.1",
|
|
129
130
|
"cross-env": "^7.0.3",
|
|
130
131
|
"cspell": "^6.31.2",
|
|
131
|
-
"eslint": "^8.
|
|
132
|
+
"eslint": "^8.46.0",
|
|
132
133
|
"eslint-config-cheminfo-react": "^10.0.0",
|
|
133
|
-
"eslint-config-cheminfo-typescript": "^12.0.
|
|
134
|
+
"eslint-config-cheminfo-typescript": "^12.0.4",
|
|
134
135
|
"modern-normalize": "^2.0.0",
|
|
135
136
|
"postcss-styled-syntax": "^0.4.0",
|
|
136
|
-
"prettier": "^3.0.
|
|
137
|
-
"rc-menu": "^9.11.
|
|
137
|
+
"prettier": "^3.0.1",
|
|
138
|
+
"rc-menu": "^9.11.1",
|
|
138
139
|
"react": "^18.2.0",
|
|
139
140
|
"react-dom": "^18.2.0",
|
|
140
141
|
"react-router-dom": "^6.14.2",
|
|
@@ -144,7 +145,7 @@
|
|
|
144
145
|
"stylelint": "^15.10.2",
|
|
145
146
|
"stylelint-config-standard": "^34.0.0",
|
|
146
147
|
"typescript": "~5.1.6",
|
|
147
|
-
"vite": "^4.4.
|
|
148
|
-
"vitest": "^0.
|
|
148
|
+
"vite": "^4.4.9",
|
|
149
|
+
"vitest": "^0.34.1"
|
|
149
150
|
}
|
|
150
151
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
interface PeakAnnotationProps {
|
|
2
|
-
id: string;
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
sign: number;
|
|
6
|
-
color: string;
|
|
7
|
-
value: number;
|
|
8
|
-
nucleus: string;
|
|
9
|
-
}
|
|
10
|
-
declare function PeakAnnotation({ id, x, y, sign, // 1 positive -1 negative
|
|
11
|
-
value, color, nucleus, }: PeakAnnotationProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
|
-
export default PeakAnnotation;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
/** @jsxImportSource @emotion/react */
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
-
import { useRef, useState, useCallback, useLayoutEffect, useEffect, useMemo, } from 'react';
|
|
5
|
-
import { useDispatch } from '../../context/DispatchContext';
|
|
6
|
-
import { HighlightEventSource, useHighlight } from '../../highlight';
|
|
7
|
-
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
8
|
-
import { formatNumber } from '../../utility/formatNumber';
|
|
9
|
-
const styles = css `
|
|
10
|
-
input {
|
|
11
|
-
user-select: text;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
input[type='number']::-webkit-outer-spin-button,
|
|
15
|
-
input[type='number']::-webkit-inner-spin-button {
|
|
16
|
-
appearance: none;
|
|
17
|
-
margin: 0;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
input[type='number'] {
|
|
21
|
-
appearance: textfield;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.notification-input-normal {
|
|
25
|
-
opacity: 1;
|
|
26
|
-
left: 4px;
|
|
27
|
-
position: fixed;
|
|
28
|
-
font-size: 10px;
|
|
29
|
-
outline: none;
|
|
30
|
-
background-color: transparent;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.notification-input-normal input:focus {
|
|
34
|
-
outline: none;
|
|
35
|
-
background-color: white;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.input-over {
|
|
39
|
-
background-color: white;
|
|
40
|
-
outline: none;
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
43
|
-
function PeakAnnotation({ id, x, y, sign, // 1 positive -1 negative
|
|
44
|
-
value, color, nucleus, }) {
|
|
45
|
-
const refText = useRef(null);
|
|
46
|
-
const [isSelected, setIsSelected] = useState(false);
|
|
47
|
-
const [_value, setValue] = useState(value);
|
|
48
|
-
const [containerSize, setContainerSize] = useState({ width: 0, height: 0 });
|
|
49
|
-
const { deltaPPM } = usePanelPreferences('peaks', nucleus);
|
|
50
|
-
const highlight = useHighlight([id], {
|
|
51
|
-
type: HighlightEventSource.PEAK,
|
|
52
|
-
extra: { id },
|
|
53
|
-
});
|
|
54
|
-
const dispatch = useDispatch();
|
|
55
|
-
const handleOnPeakChange = useCallback((e) => dispatch({ type: 'SHIFT_SPECTRUM', payload: { shift: e.shiftValue } }), [dispatch]);
|
|
56
|
-
useLayoutEffect(() => {
|
|
57
|
-
const textBox = refText.current?.getBBox();
|
|
58
|
-
setContainerSize({
|
|
59
|
-
width: textBox?.width || 0,
|
|
60
|
-
height: textBox?.height || 0,
|
|
61
|
-
});
|
|
62
|
-
}, [isSelected]);
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
setValue(value);
|
|
65
|
-
}, [value]);
|
|
66
|
-
const handleKeyDown = useCallback((event) => {
|
|
67
|
-
if (event.key === 'Enter') {
|
|
68
|
-
const newValue = event.currentTarget.valueAsNumber;
|
|
69
|
-
if (!Number.isNaN(newValue)) {
|
|
70
|
-
const shiftValue = newValue - value;
|
|
71
|
-
handleOnPeakChange({
|
|
72
|
-
id,
|
|
73
|
-
value: newValue,
|
|
74
|
-
oldValue: value,
|
|
75
|
-
shiftValue,
|
|
76
|
-
});
|
|
77
|
-
event.currentTarget.blur();
|
|
78
|
-
setIsSelected(false);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
else if (event.key === 'Escape') {
|
|
82
|
-
setValue(value);
|
|
83
|
-
event.currentTarget.blur();
|
|
84
|
-
setIsSelected(false);
|
|
85
|
-
}
|
|
86
|
-
}, [value, handleOnPeakChange, id]);
|
|
87
|
-
const handleChange = useCallback((event) => {
|
|
88
|
-
setValue(event.target.value);
|
|
89
|
-
}, []);
|
|
90
|
-
const handleSelectPeakAnnotation = useCallback((e) => {
|
|
91
|
-
e.stopPropagation();
|
|
92
|
-
setIsSelected(true);
|
|
93
|
-
return false;
|
|
94
|
-
}, []);
|
|
95
|
-
const handleOnEnterNotation = useCallback(() => {
|
|
96
|
-
highlight.show();
|
|
97
|
-
}, [highlight]);
|
|
98
|
-
const handleOnMouseLeaveNotation = useCallback(() => {
|
|
99
|
-
highlight.hide();
|
|
100
|
-
}, [highlight]);
|
|
101
|
-
const newValue = useMemo(() => (isSelected ? value : formatNumber(value, deltaPPM.format)), [deltaPPM.format, isSelected, value]);
|
|
102
|
-
const oldValue = useMemo(() => (isSelected ? _value : formatNumber(_value, deltaPPM.format)), [_value, deltaPPM.format, isSelected]);
|
|
103
|
-
return (_jsxs("g", { css: styles, id: id, style: { outline: 'none' }, transform: `translate(${x}, ${y})`, onMouseEnter: handleOnEnterNotation, onMouseLeave: handleOnMouseLeaveNotation, children: [_jsx("line", { x1: "0", x2: "0", y1: sign === -1 ? 10 : 0, y2: sign === -1 ? 28 : -18, stroke: color, strokeWidth: highlight.isActive ? '7px' : '1px' }), _jsx("text", { ref: refText, className: "peaks-text", x: "0", y: sign === -1 ? 28 : -12, dy: "0", dx: "0.35em", fill: "transparent", fontSize: "10px", fontWeight: "100", style: {
|
|
104
|
-
position: 'absolute',
|
|
105
|
-
}, children: newValue }), _jsx("foreignObject", { x: "0", y: sign === -1 ? 16 : -22, dy: "0.1em", dx: "0.35em", width: containerSize.width + 20, height: "40px", "data-no-export": "true", children: _jsx("div", { style: {
|
|
106
|
-
width: containerSize.width + 20,
|
|
107
|
-
height: '100%',
|
|
108
|
-
paddingRight: 5,
|
|
109
|
-
}, children: _jsx("input", { onClick: handleSelectPeakAnnotation, className: isSelected ? 'input-over' : 'notification-input-normal', style: {
|
|
110
|
-
width: 'inherit',
|
|
111
|
-
border: isSelected ? `1px solid ${color}` : `0`,
|
|
112
|
-
userSelect: 'none',
|
|
113
|
-
color,
|
|
114
|
-
}, value: oldValue, onKeyDown: handleKeyDown, onChange: handleChange, type: "number" }) }) })] }));
|
|
115
|
-
}
|
|
116
|
-
export default PeakAnnotation;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
const styles = {
|
|
3
|
-
container: {
|
|
4
|
-
margin: '25px',
|
|
5
|
-
},
|
|
6
|
-
header: {
|
|
7
|
-
backgroundColor: '#ffffff',
|
|
8
|
-
padding: '20px',
|
|
9
|
-
borderRadius: '10px',
|
|
10
|
-
fontSize: '30px',
|
|
11
|
-
textAlign: 'center',
|
|
12
|
-
},
|
|
13
|
-
title: {
|
|
14
|
-
textDecoration: 'underline',
|
|
15
|
-
},
|
|
16
|
-
body: {
|
|
17
|
-
marginTop: '10px',
|
|
18
|
-
whiteSpace: 'pre-wrap',
|
|
19
|
-
backgroundColor: 'white',
|
|
20
|
-
padding: '20px',
|
|
21
|
-
borderRadius: '10px',
|
|
22
|
-
color: 'red',
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
export default function ErrorOverlay(props) {
|
|
26
|
-
return (_jsxs("div", { style: styles.container, children: [_jsx("p", { style: styles.header, children: "Something went wrong." }), _jsxs("details", { style: styles.body, children: [_jsx("p", { style: styles.title, children: props.error.message }), props.error.stack] })] }));
|
|
27
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/** @jsxImportSource @emotion/react */
|
|
2
|
-
import { WebSource } from 'filelist-utils';
|
|
3
|
-
import { CorrelationData } from 'nmr-correlation';
|
|
4
|
-
import { NmriumState, CustomWorkspaces, WorkspacePreferences as NMRiumPreferences, Spectrum } from 'nmr-load-save';
|
|
5
|
-
import { ReactElement, ReactNode } from 'react';
|
|
6
|
-
import { ErrorBoundaryPropsWithComponent } from 'react-error-boundary';
|
|
7
|
-
import { BlobObject } from './utility/export';
|
|
8
|
-
export { serializeNmriumState } from 'nmr-load-save';
|
|
9
|
-
export type { NmriumState, WorkspacePreferences as NMRiumPreferences, } from 'nmr-load-save';
|
|
10
|
-
export type NMRiumWorkspace = 'exercise' | 'process1D' | 'default' | 'prediction' | 'embedded' | 'assignment' | 'simulation' | (string & {});
|
|
11
|
-
export type OnNMRiumChange = (state: NmriumState, source: 'data' | 'view' | 'settings') => void;
|
|
12
|
-
export interface NMRiumProps {
|
|
13
|
-
data?: NMRiumData;
|
|
14
|
-
onChange?: OnNMRiumChange;
|
|
15
|
-
noErrorBoundary?: boolean;
|
|
16
|
-
onError?: ErrorBoundaryPropsWithComponent['onError'];
|
|
17
|
-
workspace?: NMRiumWorkspace;
|
|
18
|
-
customWorkspaces?: CustomWorkspaces;
|
|
19
|
-
preferences?: NMRiumPreferences;
|
|
20
|
-
emptyText?: ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
* Returns a custom spinner that will be rendered while loading data.
|
|
23
|
-
*/
|
|
24
|
-
getSpinner?: () => ReactElement;
|
|
25
|
-
}
|
|
26
|
-
export type Molecules = Array<{
|
|
27
|
-
molfile: string;
|
|
28
|
-
}>;
|
|
29
|
-
type DeepPartial<T> = {
|
|
30
|
-
[P in keyof T]?: DeepPartial<T[P]>;
|
|
31
|
-
};
|
|
32
|
-
export interface NMRiumData {
|
|
33
|
-
source?: WebSource;
|
|
34
|
-
molecules?: Molecules;
|
|
35
|
-
spectra: Array<DeepPartial<Spectrum>>;
|
|
36
|
-
correlations?: CorrelationData;
|
|
37
|
-
}
|
|
38
|
-
export interface NMRiumRef {
|
|
39
|
-
getSpectraViewerAsBlob: () => BlobObject | null;
|
|
40
|
-
}
|
|
41
|
-
declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<NMRiumProps & import("react").RefAttributes<NMRiumRef>>>;
|
|
42
|
-
export default _default;
|