nmrium 0.52.0 → 0.54.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/Viewer1D.js +48 -17
- package/lib/component/1d/ranges/AssignmentLabel.d.ts +7 -0
- package/lib/component/1d/ranges/AssignmentLabel.js +10 -0
- package/lib/component/1d/ranges/Range.js +15 -6
- package/lib/component/1d/tool/XLabelPointer.js +4 -12
- package/lib/component/2d/tools/XYLabelPointer.js +3 -9
- package/lib/component/context/LoggerContext.js +11 -4
- package/lib/component/elements/CloseButton.d.ts +1 -1
- package/lib/component/elements/CustomToolTip.d.ts +8 -0
- package/lib/component/elements/CustomToolTip.js +107 -0
- package/lib/component/elements/EditableColumn.js +6 -5
- package/lib/component/elements/SaveButton.d.ts +1 -1
- package/lib/component/elements/formik/FormikError.js +2 -4
- package/lib/component/elements/formik/FormikInput.js +2 -2
- package/lib/component/header/Header.js +1 -1
- package/lib/component/header/PhaseCorrectionTwoDimensionsPanel.js +41 -10
- package/lib/component/hooks/useActiveSpectrumRangesViewState.js +1 -0
- package/lib/component/hooks/useActiveSpectrumZonesViewState.js +1 -0
- package/lib/component/hooks/useToolsFunctions.js +7 -1
- package/lib/component/main/NMRiumStateProvider.js +12 -2
- package/lib/component/modal/AboutPredictionModal.js +1 -1
- package/lib/component/modal/AboutSpectrumSimulationModal.js +1 -1
- package/lib/component/modal/CopyClipboardModal.js +1 -1
- package/lib/component/modal/EditPeakShapeModal.js +1 -1
- package/lib/component/modal/ImportPublicationStringModal.d.ts +5 -3
- package/lib/component/modal/ImportPublicationStringModal.js +18 -9
- package/lib/component/modal/PredictSpectraModal.js +1 -1
- package/lib/component/modal/aboutUs/AboutUsModal.js +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.js +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +1 -1
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js +1 -1
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js +1 -1
- package/lib/component/modal/editZone/EditZoneModal.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +12 -19
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +2 -2
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +2 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +5 -5
- package/lib/component/panels/RangesPanel/RangesHeader.js +29 -15
- package/lib/component/panels/RangesPanel/RangesPreferences.js +19 -13
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +2 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.d.ts +7 -0
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.js +16 -0
- package/lib/component/panels/SpectraPanel/SpectraPanelHeader.js +22 -8
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +1 -1
- package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.d.ts +5 -5
- package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +79 -89
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.d.ts +5 -4
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +66 -98
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +13 -32
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +4 -4
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.js +2 -2
- package/lib/component/panels/header/PreferencesHeader.js +1 -1
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +4 -4
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +8 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -1
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.js +1 -1
- package/lib/component/reducer/Reducer.js +4 -0
- package/lib/component/reducer/actions/FiltersActions.d.ts +3 -2
- package/lib/component/reducer/actions/FiltersActions.js +364 -318
- package/lib/component/reducer/actions/MoleculeActions.js +1 -1
- package/lib/component/reducer/actions/RangesActions.d.ts +9 -5
- package/lib/component/reducer/actions/RangesActions.js +31 -21
- package/lib/component/reducer/actions/SpectraActions.d.ts +5 -4
- package/lib/component/reducer/actions/SpectraActions.js +5 -1
- package/lib/component/reducer/actions/ToolsActions.js +13 -20
- package/lib/component/reducer/preferences/actions/setWorkspace.js +4 -3
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +6 -4
- package/lib/component/toolbar/ToolBar.js +112 -26
- package/lib/component/utility/export.js +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +7 -12
- package/lib/data/data1d/Spectrum1D/get1DColor.d.ts +10 -3
- package/lib/data/data1d/Spectrum1D/get1DColor.js +28 -2
- package/lib/data/data1d/Spectrum1D/index.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/index.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/createRange.d.ts +50 -0
- package/lib/data/data1d/Spectrum1D/ranges/createRange.js +51 -0
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +4 -2
- package/lib/data/data1d/Spectrum1D/ranges/resizeRange.d.ts +52 -0
- package/lib/data/data1d/Spectrum1D/ranges/resizeRange.js +28 -0
- package/lib/data/data2d/Spectrum2D/get2DColor.d.ts +11 -3
- package/lib/data/data2d/Spectrum2D/get2DColor.js +20 -4
- package/lib/data/data2d/Spectrum2D/getSlice.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +1 -0
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +1 -0
- package/lib/data/utilities/generateColor.d.ts +7 -3
- package/lib/data/utilities/generateColor.js +5 -17
- package/lib/versionInfo.js +1 -1
- package/package.json +29 -29
- package/lib/component/elements/MolecularFormulaInput.d.ts +0 -6
- package/lib/component/elements/MolecularFormulaInput.js +0 -63
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +0 -7
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +0 -31
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +0 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +0 -32
|
@@ -1,63 +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 { useCallback, useState } from 'react';
|
|
5
|
-
import getAtomsFromMF from '../../data/utilities/getAtomsFromMF';
|
|
6
|
-
const inputStyle = css `
|
|
7
|
-
text-align: center;
|
|
8
|
-
|
|
9
|
-
input {
|
|
10
|
-
height: 100%;
|
|
11
|
-
width: 200px;
|
|
12
|
-
border-radius: 5px;
|
|
13
|
-
border: 0.55px solid #c7c7c7;
|
|
14
|
-
margin: 0 5px;
|
|
15
|
-
text-align: center;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
button {
|
|
19
|
-
flex: 2;
|
|
20
|
-
padding: 5px;
|
|
21
|
-
border: 1px solid gray;
|
|
22
|
-
border-radius: 5px;
|
|
23
|
-
height: 36px;
|
|
24
|
-
margin: 0 auto;
|
|
25
|
-
margin-top: 15px;
|
|
26
|
-
display: block;
|
|
27
|
-
width: 20%;
|
|
28
|
-
color: white;
|
|
29
|
-
background-color: gray;
|
|
30
|
-
}
|
|
31
|
-
`;
|
|
32
|
-
function isValidMf(mf) {
|
|
33
|
-
if (mf.trim().length === 0) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
getAtomsFromMF(mf);
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
export default function MolecularFormulaInput({ onSave = () => null, previousMF, }) {
|
|
45
|
-
const [mf, setMF] = useState('');
|
|
46
|
-
const [isValidMF, setIsValidMF] = useState(true);
|
|
47
|
-
const [hasChanged, setHasChanged] = useState(false);
|
|
48
|
-
const onChangeHandler = useCallback((e) => {
|
|
49
|
-
setHasChanged(true);
|
|
50
|
-
if (isValidMf(e.target.value)) {
|
|
51
|
-
setIsValidMF(true);
|
|
52
|
-
setMF(e.target.value);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
setIsValidMF(false);
|
|
56
|
-
setMF('');
|
|
57
|
-
}
|
|
58
|
-
}, []);
|
|
59
|
-
const onSaveHandler = useCallback(() => {
|
|
60
|
-
onSave(hasChanged ? mf.trim() : previousMF);
|
|
61
|
-
}, [hasChanged, mf, onSave, previousMF]);
|
|
62
|
-
return (_jsxs("div", { css: inputStyle, children: [_jsx("input", { type: "text", onChange: onChangeHandler, defaultValue: previousMF }), _jsx("button", { type: "button", onClick: onSaveHandler, disabled: !isValidMF, children: isValidMF ? 'Set' : 'Invalid' })] }));
|
|
63
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { xyIntegration } from 'ml-spectra-processing';
|
|
2
|
-
import { mapRanges } from 'nmr-processing';
|
|
3
|
-
import detectSignals from './detectSignals';
|
|
4
|
-
export function addRange(spectrum, options) {
|
|
5
|
-
const { from, to } = options;
|
|
6
|
-
const { x, re: y } = spectrum.data;
|
|
7
|
-
const { nucleus, originFrequency: frequency } = spectrum.info;
|
|
8
|
-
const absolute = xyIntegration({ x, y }, { from, to });
|
|
9
|
-
const signals = detectSignals({ x, y }, {
|
|
10
|
-
from,
|
|
11
|
-
to,
|
|
12
|
-
nucleus,
|
|
13
|
-
frequency,
|
|
14
|
-
}) || [];
|
|
15
|
-
const range = {
|
|
16
|
-
from,
|
|
17
|
-
to,
|
|
18
|
-
absolute,
|
|
19
|
-
signals,
|
|
20
|
-
};
|
|
21
|
-
try {
|
|
22
|
-
spectrum.ranges.values = spectrum.ranges.values.concat(
|
|
23
|
-
// TODO: Check this error.
|
|
24
|
-
// @ts-expect-error To be checked
|
|
25
|
-
mapRanges([range], spectrum));
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
reportError(error);
|
|
29
|
-
throw new Error('Could not calculate the multiplicity');
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { xyIntegration } from 'ml-spectra-processing';
|
|
2
|
-
import { mapRanges, updateRangesRelativeValues, } from 'nmr-processing';
|
|
3
|
-
import detectSignals from './detectSignals';
|
|
4
|
-
export function changeRange(spectrum, range) {
|
|
5
|
-
const { from, to, id } = range;
|
|
6
|
-
const { x, re: y } = spectrum.data;
|
|
7
|
-
const { originFrequency: frequency, nucleus } = spectrum.info;
|
|
8
|
-
const index = spectrum.ranges.values.findIndex((i) => i.id === id);
|
|
9
|
-
const absolute = xyIntegration({ x, y }, { from, to });
|
|
10
|
-
const signals = detectSignals({ x, y }, {
|
|
11
|
-
from,
|
|
12
|
-
to,
|
|
13
|
-
nucleus,
|
|
14
|
-
frequency,
|
|
15
|
-
});
|
|
16
|
-
if (index !== -1) {
|
|
17
|
-
const [newRange] = mapRanges([
|
|
18
|
-
{
|
|
19
|
-
...spectrum.ranges.values[index],
|
|
20
|
-
originalFrom: from,
|
|
21
|
-
originalTo: to,
|
|
22
|
-
...range,
|
|
23
|
-
absolute,
|
|
24
|
-
signals,
|
|
25
|
-
},
|
|
26
|
-
], spectrum);
|
|
27
|
-
if (newRange) {
|
|
28
|
-
spectrum.ranges.values[index] = newRange;
|
|
29
|
-
updateRangesRelativeValues(spectrum);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|