nmrium 0.43.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/ExclusionZonesAnnotations.js +1 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +2 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +16 -16
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +2 -2
- package/lib/component/2d/Viewer2D.js +1 -3
- package/lib/component/EventsTrackers/KeysListenerTracker.js +1 -2
- package/lib/component/context/DispatchContext.d.ts +3 -1
- 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/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/header/Header.js +1 -1
- package/lib/component/header/ZeroFillingOptionsPanel.js +4 -4
- package/lib/component/main/InnerNMRiumContents.js +1 -2
- 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/{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/ChangeSumModalContents.js +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js +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/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +2 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +10 -6
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +4 -5
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +5 -5
- package/lib/component/panels/Panels.js +6 -7
- package/lib/component/panels/PeaksPanel/PeaksTable.js +1 -1
- 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/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +2 -3
- 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/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.js +4 -10
- package/lib/component/panels/predictionPanel/PredictionPanel.js +2 -2
- package/lib/component/reducer/IgnoreActions.js +1 -0
- package/lib/component/reducer/Reducer.d.ts +2 -2
- package/lib/component/reducer/Reducer.js +4 -2
- package/lib/component/reducer/actions/DomainActions.js +2 -3
- package/lib/component/reducer/actions/MoleculeActions.js +3 -3
- package/lib/component/reducer/actions/PreferencesActions.js +1 -2
- 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/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/toolbar/ToolTypes.js +23 -24
- 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/detectSignal.js +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +16 -16
- package/lib-cjs/component/2d/Viewer2D.js +1 -3
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +1 -2
- 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/PreferencesButton.js +13 -0
- package/lib-cjs/component/elements/formik/FormikInput.js +3 -6
- package/lib-cjs/component/header/Header.js +1 -1
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +4 -4
- package/lib-cjs/component/main/InnerNMRiumContents.js +1 -2
- 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/{AboutUsModal.js → aboutUs/AboutUsModal.js} +4 -3
- package/lib-cjs/component/modal/aboutUs/AboutUsZakodium.js +39 -0
- package/lib-cjs/component/modal/changeSum/ChangeSumModalContents.js +1 -1
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +1 -1
- 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/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +4 -5
- 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/PeaksTable.js +1 -1
- 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/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +2 -3
- 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/databasePanel/DatabasePanel.js +3 -40
- package/lib-cjs/component/panels/databasePanel/DatabaseSearchOptions.js +60 -0
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +3 -9
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +2 -2
- package/lib-cjs/component/reducer/IgnoreActions.js +1 -0
- package/lib-cjs/component/reducer/Reducer.js +4 -2
- package/lib-cjs/component/reducer/actions/DomainActions.js +2 -3
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +2 -2
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +1 -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/ToolTypes.js +23 -24
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -1
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +3 -3
- /package/lib/component/modal/{AboutUsModal.d.ts → aboutUs/AboutUsModal.d.ts} +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DatabaseSearchOptions = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const bs_1 = require("react-icons/bs");
|
|
9
|
+
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
10
|
+
const CounterLabel_1 = require("../../elements/CounterLabel");
|
|
11
|
+
const Input_1 = __importDefault(require("../../elements/Input"));
|
|
12
|
+
const PreferencesButton_1 = require("../../elements/PreferencesButton");
|
|
13
|
+
const Select_1 = __importDefault(require("../../elements/Select"));
|
|
14
|
+
const PanelHeader_1 = __importDefault(require("../header/PanelHeader"));
|
|
15
|
+
const useToolsFunctions_1 = __importDefault(require("../../hooks/useToolsFunctions"));
|
|
16
|
+
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
17
|
+
const DefaultPanelHeader_1 = require("../header/DefaultPanelHeader");
|
|
18
|
+
const fa_1 = require("react-icons/fa");
|
|
19
|
+
const io5_1 = require("react-icons/io5");
|
|
20
|
+
const ToggleButton_1 = __importDefault(require("../../elements/ToggleButton"));
|
|
21
|
+
function DatabaseSearchOptions({ databases, defaultDatabase, keywords, result, selectedTool, idCode, total, onKeywordsChange, onSettingClick, onStructureClick, onDatabaseChange, }) {
|
|
22
|
+
const { handleChangeOption } = (0, useToolsFunctions_1.default)();
|
|
23
|
+
function enableFilterHandler(flag) {
|
|
24
|
+
const tool = !flag ? ToolTypes_1.options.zoom.id : ToolTypes_1.options.databaseRangesSelection.id;
|
|
25
|
+
handleChangeOption(tool);
|
|
26
|
+
}
|
|
27
|
+
function handleSearch(input) {
|
|
28
|
+
if (typeof input === 'string' || input === -1) {
|
|
29
|
+
const solvent = String(input);
|
|
30
|
+
onKeywordsChange({ solvent });
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
onKeywordsChange({
|
|
34
|
+
searchKeywords: input.target.value,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function clearHandler() {
|
|
39
|
+
onKeywordsChange({ searchKeywords: '' });
|
|
40
|
+
}
|
|
41
|
+
return ((0, jsx_runtime_1.jsxs)(PanelHeader_1.default, { style: { flexDirection: 'column', alignItems: 'normal' }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
42
|
+
display: 'flex',
|
|
43
|
+
justifyContent: 'space-between',
|
|
44
|
+
paddingBottom: '2px',
|
|
45
|
+
}, children: [(0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 6 }, items: databases, itemTextField: "label", itemValueField: "key", onChange: onDatabaseChange, placeholder: "Select database", defaultValue: defaultDatabase }), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 4, margin: '0px 5px' }, items: result.solvents, placeholder: "Solvent", onChange: handleSearch, value: keywords.solvent }), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
46
|
+
display: 'flex',
|
|
47
|
+
alignItems: 'center',
|
|
48
|
+
flex: 2,
|
|
49
|
+
justifyContent: 'flex-end',
|
|
50
|
+
}, children: [(0, jsx_runtime_1.jsx)(CounterLabel_1.CounterLabel, { children: (0, DefaultPanelHeader_1.createFilterLabel)(total || 0, result.data.length) }), (0, jsx_runtime_1.jsx)(PreferencesButton_1.PreferencesButton, { onClick: onSettingClick })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between' }, children: [(0, jsx_runtime_1.jsx)(ToggleButton_1.default, { defaultValue: selectedTool === ToolTypes_1.options.databaseRangesSelection.id, popupTitle: "Filter by select ranges", popupPlacement: "right", onClick: enableFilterHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaICursor, { style: {
|
|
51
|
+
pointerEvents: 'none',
|
|
52
|
+
fontSize: '12px',
|
|
53
|
+
transform: 'rotate(90deg)',
|
|
54
|
+
} }) }, `${selectedTool}`), (0, jsx_runtime_1.jsx)(Input_1.default, { value: keywords.searchKeywords, renderIcon: () => (0, jsx_runtime_1.jsx)(io5_1.IoSearchOutline, {}), style: { inputWrapper: { margin: '0 5px', flex: 1 } }, className: "search-input", type: "text", debounceTime: 250, placeholder: "Search for parameter...", onChange: handleSearch, onClear: clearHandler, canClear: true }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", onClick: onStructureClick, style: { padding: '5px' }, children: !idCode ? ((0, jsx_runtime_1.jsx)(bs_1.BsHexagon, { style: {
|
|
55
|
+
fontSize: '12px',
|
|
56
|
+
} })) : ((0, jsx_runtime_1.jsx)(bs_1.BsHexagonFill, { style: {
|
|
57
|
+
fontSize: '12px',
|
|
58
|
+
} })) })] })] }));
|
|
59
|
+
}
|
|
60
|
+
exports.DatabaseSearchOptions = DatabaseSearchOptions;
|
|
@@ -8,21 +8,15 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
8
8
|
const fa_1 = require("react-icons/fa");
|
|
9
9
|
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
10
10
|
const ToggleButton_1 = __importDefault(require("../../elements/ToggleButton"));
|
|
11
|
-
const ToolTip_1 = __importDefault(require("../../elements/ToolTip/ToolTip"));
|
|
12
11
|
const PanelHeader_1 = __importDefault(require("./PanelHeader"));
|
|
12
|
+
const PreferencesButton_1 = require("../../elements/PreferencesButton");
|
|
13
|
+
const CounterLabel_1 = require("../../elements/CounterLabel");
|
|
13
14
|
const styles = {
|
|
14
15
|
leftContainer: {
|
|
15
16
|
display: 'flex',
|
|
16
17
|
flexDirection: 'row',
|
|
17
18
|
flex: 1,
|
|
18
19
|
},
|
|
19
|
-
counterLabel: {
|
|
20
|
-
margin: 0,
|
|
21
|
-
textAlign: 'right',
|
|
22
|
-
lineHeight: '22px',
|
|
23
|
-
padding: '0 5px',
|
|
24
|
-
whiteSpace: 'nowrap',
|
|
25
|
-
},
|
|
26
20
|
};
|
|
27
21
|
function createFilterLabel(total, counter) {
|
|
28
22
|
if (typeof counter === 'boolean') {
|
|
@@ -32,6 +26,6 @@ function createFilterLabel(total, counter) {
|
|
|
32
26
|
}
|
|
33
27
|
exports.createFilterLabel = createFilterLabel;
|
|
34
28
|
function DefaultPanelHeader({ counter, counterLabel, onDelete = () => null, deleteToolTip = 'Delete', onFilter = () => null, filterToolTip = '', children, onSettingClick = () => null, showSettingButton = false, canDelete = true, disableDelete = false, style = {}, className = '', renderRightButtons, }) {
|
|
35
|
-
return ((0, jsx_runtime_1.jsxs)(PanelHeader_1.default, { style, className, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.leftContainer, children: [canDelete && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { color: { base: 'black', hover: 'red' }, onClick: onDelete, disabled: counter === 0 || disableDelete, toolTip: deleteToolTip, tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) })), filterToolTip ? ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: filterToolTip, popupPlacement: "right", onClick: onFilter, children: (0, jsx_runtime_1.jsx)(fa_1.FaFilter, { style: { pointerEvents: 'none', fontSize: '12px' } }) })) : null, children] }), renderRightButtons?.(), counterLabel && (0, jsx_runtime_1.jsx)(
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)(PanelHeader_1.default, { style, className, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.leftContainer, children: [canDelete && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { color: { base: 'black', hover: 'red' }, onClick: onDelete, disabled: counter === 0 || disableDelete, toolTip: deleteToolTip, tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) })), filterToolTip ? ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: filterToolTip, popupPlacement: "right", onClick: onFilter, children: (0, jsx_runtime_1.jsx)(fa_1.FaFilter, { style: { pointerEvents: 'none', fontSize: '12px' } }) })) : null, children] }), renderRightButtons?.(), counterLabel && (0, jsx_runtime_1.jsx)(CounterLabel_1.CounterLabel, { children: counterLabel }), showSettingButton && (0, jsx_runtime_1.jsx)(PreferencesButton_1.PreferencesButton, { onClick: onSettingClick })] }));
|
|
36
30
|
}
|
|
37
31
|
exports.default = DefaultPanelHeader;
|
|
@@ -44,7 +44,7 @@ function PredictionPanel() {
|
|
|
44
44
|
const settingRef = (0, react_1.useRef)();
|
|
45
45
|
const { item: spectraPanelState, utils: { toggle: openSpectraPanel }, } = (0, ui_1.useAccordionContext)('Spectra');
|
|
46
46
|
const predictionPreferences = (0, usePanelPreferences_1.usePanelPreferences)('prediction');
|
|
47
|
-
const openMoleculeEditor = (0, MoleculeStructureEditorModal_1.useMoleculeEditor)(true);
|
|
47
|
+
const { modal, openMoleculeEditor } = (0, MoleculeStructureEditorModal_1.useMoleculeEditor)(true);
|
|
48
48
|
const refreshSlider = (0, react_1.useRef)(false);
|
|
49
49
|
(0, react_1.useEffect)(() => {
|
|
50
50
|
if (Array.isArray(molecules) &&
|
|
@@ -125,6 +125,6 @@ function PredictionPanel() {
|
|
|
125
125
|
...styles.slider,
|
|
126
126
|
height: height - 31,
|
|
127
127
|
}, children: molIndex === currentIndex && ((0, jsx_runtime_1.jsx)(full_1.StructureEditor, { width: width, initialMolfile: mol.molfile, svgMenu: true, fragment: false, onChange: changeHandler })) })] }, mol.id)))) : ((0, jsx_runtime_1.jsx)(full_1.StructureEditor, { initialMolfile: molfile || '', width: width, height: height, svgMenu: true, fragment: false, onChange: changeHandler })) }));
|
|
128
|
-
} }) }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', padding: '5px' }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: () => predictHandler('save'), disabled: !molfile, children: isPredictedBefore ? 'Replace prediction' : 'Predict spectra' }), isPredictedBefore && ((0, jsx_runtime_1.jsx)(Button_1.default.Action, { style: { marginLeft: '5px' }, onClick: () => predictHandler('add'), children: "Add prediction" }))] })] })] }))] }));
|
|
128
|
+
} }) }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', padding: '5px' }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: () => predictHandler('save'), disabled: !molfile, children: isPredictedBefore ? 'Replace prediction' : 'Predict spectra' }), isPredictedBefore && ((0, jsx_runtime_1.jsx)(Button_1.default.Action, { style: { marginLeft: '5px' }, onClick: () => predictHandler('add'), children: "Add prediction" }))] })] })] })), modal] }));
|
|
129
129
|
}
|
|
130
130
|
exports.default = PredictionPanel;
|
|
@@ -44,7 +44,6 @@ const SpectraAnalysisActions = __importStar(require("./actions/SpectraAnalysisAc
|
|
|
44
44
|
const SpectrumsActions = __importStar(require("./actions/SpectrumsActions"));
|
|
45
45
|
const ToolsActions = __importStar(require("./actions/ToolsActions"));
|
|
46
46
|
const ZonesActions = __importStar(require("./actions/ZonesActions"));
|
|
47
|
-
const Constants_2 = require("./core/Constants");
|
|
48
47
|
exports.rangeStateInit = {
|
|
49
48
|
showMultiplicityTrees: false,
|
|
50
49
|
showRangesIntegrals: true,
|
|
@@ -112,7 +111,7 @@ const getInitialState = () => ({
|
|
|
112
111
|
},
|
|
113
112
|
isLoading: false,
|
|
114
113
|
keysPreferences: {},
|
|
115
|
-
displayerMode:
|
|
114
|
+
displayerMode: '1D',
|
|
116
115
|
correlations: {},
|
|
117
116
|
displayerKey: '',
|
|
118
117
|
zoom: {
|
|
@@ -408,6 +407,9 @@ function innerSpectrumReducer(draft, action) {
|
|
|
408
407
|
return DatabaseActions.handleResurrectSpectrumFromJcamp(draft, action);
|
|
409
408
|
case 'SET_AUTOMATIC_ASSIGNMENTS':
|
|
410
409
|
return AssignmentsActions.handleSetAutomaticAssignments(draft, action);
|
|
410
|
+
case 'SECRET_THROW_ERROR': {
|
|
411
|
+
throw new Error('Error thrown in main reducer');
|
|
412
|
+
}
|
|
411
413
|
default:
|
|
412
414
|
}
|
|
413
415
|
}
|
|
@@ -8,7 +8,6 @@ const d3_1 = require("d3");
|
|
|
8
8
|
const get1DDataXY_1 = require("../../../data/data1d/Spectrum1D/get1DDataXY");
|
|
9
9
|
const Spectrum2D_1 = require("../../../data/data2d/Spectrum2D");
|
|
10
10
|
const nucleusToString_1 = __importDefault(require("../../utility/nucleusToString"));
|
|
11
|
-
const Constants_1 = require("../core/Constants");
|
|
12
11
|
const ZoomHistoryManager_1 = require("../helper/ZoomHistoryManager");
|
|
13
12
|
const getActiveSpectrum_1 = require("../helper/getActiveSpectrum");
|
|
14
13
|
function getActiveData(draft) {
|
|
@@ -130,7 +129,7 @@ function setDomain(draft, options) {
|
|
|
130
129
|
const { updateYDomain = true, isYDomainShared = true, updateXDomain = true, } = options || {};
|
|
131
130
|
let domain;
|
|
132
131
|
if (draft.view.spectra.activeTab) {
|
|
133
|
-
if (draft.displayerMode ===
|
|
132
|
+
if (draft.displayerMode === '1D') {
|
|
134
133
|
domain = getDomain(draft);
|
|
135
134
|
}
|
|
136
135
|
else {
|
|
@@ -143,7 +142,7 @@ function setDomain(draft, options) {
|
|
|
143
142
|
// draft.originDomain = domain;
|
|
144
143
|
if (updateYDomain) {
|
|
145
144
|
draft.yDomain = domain.yDomain;
|
|
146
|
-
if (draft.displayerMode ===
|
|
145
|
+
if (draft.displayerMode === '1D' && isYDomainShared) {
|
|
147
146
|
draft.yDomains = Object.fromEntries(Object.keys(domain.yDomains).map((key) => {
|
|
148
147
|
return [key, domain.yDomain];
|
|
149
148
|
}));
|
|
@@ -87,10 +87,10 @@ function handleSetMolecule(draft, action) {
|
|
|
87
87
|
}
|
|
88
88
|
exports.handleSetMolecule = handleSetMolecule;
|
|
89
89
|
function removeAssignments(draft, assignmentData) {
|
|
90
|
-
if (draft.displayerMode ===
|
|
90
|
+
if (draft.displayerMode === '1D') {
|
|
91
91
|
(0, RangesActions_1.unlinkRange)(draft, { assignmentData });
|
|
92
92
|
}
|
|
93
|
-
if (draft.displayerMode ===
|
|
93
|
+
if (draft.displayerMode === '2D') {
|
|
94
94
|
(0, ZonesActions_1.unlinkZone)(draft, { assignmentData });
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.handleApplyKeyPreferences = exports.handleSetKeyPreferences = exports.changeSpectrumVerticalAlignment = void 0;
|
|
7
7
|
const GroupByInfoKey_1 = __importDefault(require("../../utility/GroupByInfoKey"));
|
|
8
8
|
const nucleusToString_1 = __importDefault(require("../../utility/nucleusToString"));
|
|
9
|
-
const Constants_1 = require("../core/Constants");
|
|
10
9
|
const getActiveSpectrum_1 = require("../helper/getActiveSpectrum");
|
|
11
10
|
const DomainActions_1 = require("./DomainActions");
|
|
12
11
|
function changeSpectrumVerticalAlignment(draft, options) {
|
|
@@ -100,7 +99,7 @@ function handleApplyKeyPreferences(draft, action) {
|
|
|
100
99
|
draft.yDomain = preferences.yDomain;
|
|
101
100
|
draft.originDomain = preferences.originDomain;
|
|
102
101
|
draft.yDomains = preferences.yDomains;
|
|
103
|
-
if (draft.displayerMode !==
|
|
102
|
+
if (draft.displayerMode !== '2D') {
|
|
104
103
|
draft.zoom = preferences.zoom;
|
|
105
104
|
}
|
|
106
105
|
}
|
|
@@ -182,7 +182,7 @@ function handleToggleRealImaginaryVisibility(draft) {
|
|
|
182
182
|
}
|
|
183
183
|
exports.handleToggleRealImaginaryVisibility = handleToggleRealImaginaryVisibility;
|
|
184
184
|
function handleBrushEnd(draft, action) {
|
|
185
|
-
const is2D = draft.displayerMode ===
|
|
185
|
+
const is2D = draft.displayerMode === '2D';
|
|
186
186
|
const { height, margin, yDomain, yDomains, width, xDomains, xDomain, mode } = draft;
|
|
187
187
|
const xScale = (0, scale_1.getXScale)({ width, xDomains, xDomain, mode, margin });
|
|
188
188
|
const verticalAlign = (0, getVerticalAlign_1.getVerticalAlign)(draft);
|
|
@@ -215,7 +215,7 @@ function handleZoom(draft, action) {
|
|
|
215
215
|
const { event, trackID, selectedTool } = action.payload;
|
|
216
216
|
const { view: { ranges: rangeState }, displayerMode, yDomains, integralsYDomains, } = draft;
|
|
217
217
|
const activeSpectra = (0, getActiveSpectra_1.getActiveSpectra)(draft);
|
|
218
|
-
if (displayerMode ===
|
|
218
|
+
if (displayerMode === '2D') {
|
|
219
219
|
const index = trackID === DimensionLayout_1.LAYOUT.TOP_1D ? 0 : trackID === DimensionLayout_1.LAYOUT.LEFT_1D ? 1 : null;
|
|
220
220
|
if (index !== null) {
|
|
221
221
|
const id = getSpectrumID(draft, index);
|
|
@@ -262,7 +262,7 @@ function zoomOut(draft, action) {
|
|
|
262
262
|
const { zoomType, trackID } = action?.payload || {};
|
|
263
263
|
const { xDomain, yDomain } = draft.originDomain;
|
|
264
264
|
const zoomHistory = (0, ZoomHistoryManager_1.default)(draft.zoom.history, draft.view.spectra.activeTab, { xDomain, yDomain });
|
|
265
|
-
if (draft.displayerMode ===
|
|
265
|
+
if (draft.displayerMode === '1D') {
|
|
266
266
|
switch (zoomType) {
|
|
267
267
|
case Zoom1DManager_1.ZOOM_TYPES.HORIZONTAL: {
|
|
268
268
|
draft.xDomain = xDomain;
|
|
@@ -322,12 +322,12 @@ function hasAcceptedSpectrum(draft, index) {
|
|
|
322
322
|
function setMargin(draft) {
|
|
323
323
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
324
324
|
const spectrum = (activeSpectrum?.id && draft.data[activeSpectrum.index]) || null;
|
|
325
|
-
if (draft.displayerMode ===
|
|
325
|
+
if (draft.displayerMode === '2D' &&
|
|
326
326
|
(draft.toolOptions.selectedTool === ToolTypes_1.options.slicing.id ||
|
|
327
327
|
spectrum?.info.isFid)) {
|
|
328
328
|
draft.margin = Constants_1.MARGIN['2D'];
|
|
329
329
|
}
|
|
330
|
-
else if (draft.displayerMode ===
|
|
330
|
+
else if (draft.displayerMode === '2D') {
|
|
331
331
|
const top = hasAcceptedSpectrum(draft, 0)
|
|
332
332
|
? Constants_1.MARGIN['2D'].top
|
|
333
333
|
: Constants_1.MARGIN['1D'].top;
|
|
@@ -336,7 +336,7 @@ function setMargin(draft) {
|
|
|
336
336
|
: Constants_1.MARGIN['1D'].left;
|
|
337
337
|
draft.margin = { ...Constants_1.MARGIN['2D'], top, left };
|
|
338
338
|
}
|
|
339
|
-
else if (draft.displayerMode ===
|
|
339
|
+
else if (draft.displayerMode === '1D') {
|
|
340
340
|
draft.margin = Constants_1.MARGIN['1D'];
|
|
341
341
|
}
|
|
342
342
|
}
|
|
@@ -345,8 +345,8 @@ exports.setMargin = setMargin;
|
|
|
345
345
|
function setDisplayerMode(draft, data) {
|
|
346
346
|
draft.displayerMode =
|
|
347
347
|
data && data.some((d) => d.info.dimension === 2)
|
|
348
|
-
?
|
|
349
|
-
:
|
|
348
|
+
? '2D'
|
|
349
|
+
: '1D';
|
|
350
350
|
}
|
|
351
351
|
//utility
|
|
352
352
|
function setTabActiveSpectrum(draft, dataGroupByTab) {
|
|
@@ -463,7 +463,7 @@ function levelChangeHandler(draft, action) {
|
|
|
463
463
|
}
|
|
464
464
|
exports.levelChangeHandler = levelChangeHandler;
|
|
465
465
|
function setSpectraSameTopHandler(draft) {
|
|
466
|
-
if (draft.displayerMode ===
|
|
466
|
+
if (draft.displayerMode === '1D') {
|
|
467
467
|
draft.originDomain.shareYDomain = false;
|
|
468
468
|
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8 });
|
|
469
469
|
}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MARGIN =
|
|
4
|
-
var DISPLAYER_MODE;
|
|
5
|
-
(function (DISPLAYER_MODE) {
|
|
6
|
-
DISPLAYER_MODE["DM_1D"] = "1D";
|
|
7
|
-
DISPLAYER_MODE["DM_2D"] = "2D";
|
|
8
|
-
})(DISPLAYER_MODE || (exports.DISPLAYER_MODE = DISPLAYER_MODE = {}));
|
|
3
|
+
exports.MARGIN = void 0;
|
|
9
4
|
exports.MARGIN = {
|
|
10
5
|
'2D': { top: 100, right: 50, bottom: 70, left: 100 },
|
|
11
6
|
'1D': {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addToBrushHistory = void 0;
|
|
4
|
-
const Constants_1 = require("../core/Constants");
|
|
5
4
|
function zoomHistoryManager(zoomHistory, nucleus, baseZoom) {
|
|
6
5
|
if (!zoomHistory[nucleus] && !Array.isArray(zoomHistory[nucleus])) {
|
|
7
6
|
zoomHistory[nucleus] = [];
|
|
@@ -42,7 +41,7 @@ function addToBrushHistory(draft, options) {
|
|
|
42
41
|
draft.zoom.history,
|
|
43
42
|
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
44
43
|
draft.view.spectra.activeTab);
|
|
45
|
-
if (displayerMode ===
|
|
44
|
+
if (displayerMode === '2D') {
|
|
46
45
|
switch (trackID) {
|
|
47
46
|
case 'CENTER_2D':
|
|
48
47
|
draft.xDomain = xDomain;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.options = void 0;
|
|
4
4
|
const nmr_processing_1 = require("nmr-processing");
|
|
5
|
-
const Constants_1 = require("../reducer/core/Constants");
|
|
6
5
|
exports.options = {
|
|
7
6
|
zoom: {
|
|
8
7
|
id: 'zoom',
|
|
@@ -16,7 +15,7 @@ exports.options = {
|
|
|
16
15
|
label: 'Peaks picking',
|
|
17
16
|
hasOptionPanel: true,
|
|
18
17
|
isFilter: false,
|
|
19
|
-
mode:
|
|
18
|
+
mode: '1D',
|
|
20
19
|
spectraOptions: [
|
|
21
20
|
{
|
|
22
21
|
info: [{ key: 'isFt', value: true }],
|
|
@@ -30,7 +29,7 @@ exports.options = {
|
|
|
30
29
|
label: 'Integral Tool',
|
|
31
30
|
hasOptionPanel: false,
|
|
32
31
|
isFilter: false,
|
|
33
|
-
mode:
|
|
32
|
+
mode: '1D',
|
|
34
33
|
spectraOptions: [
|
|
35
34
|
{
|
|
36
35
|
info: [{ key: 'isFt', value: true }],
|
|
@@ -44,7 +43,7 @@ exports.options = {
|
|
|
44
43
|
label: 'Zone tool',
|
|
45
44
|
hasOptionPanel: true,
|
|
46
45
|
isFilter: false,
|
|
47
|
-
mode:
|
|
46
|
+
mode: '2D',
|
|
48
47
|
spectraOptions: [
|
|
49
48
|
{
|
|
50
49
|
info: [{ key: 'isFt', value: true }],
|
|
@@ -58,7 +57,7 @@ exports.options = {
|
|
|
58
57
|
label: 'Slicing tool',
|
|
59
58
|
hasOptionPanel: false,
|
|
60
59
|
isFilter: false,
|
|
61
|
-
mode:
|
|
60
|
+
mode: '2D',
|
|
62
61
|
spectraOptions: [
|
|
63
62
|
{
|
|
64
63
|
info: [{ key: 'isFt', value: true }],
|
|
@@ -72,7 +71,7 @@ exports.options = {
|
|
|
72
71
|
label: 'Move spectrum horizontally',
|
|
73
72
|
hasOptionPanel: false,
|
|
74
73
|
isFilter: false,
|
|
75
|
-
mode:
|
|
74
|
+
mode: '1D',
|
|
76
75
|
spectraOptions: [
|
|
77
76
|
{
|
|
78
77
|
info: [{ key: 'isFt', value: true }],
|
|
@@ -86,7 +85,7 @@ exports.options = {
|
|
|
86
85
|
label: 'Equalizer tool',
|
|
87
86
|
hasOptionPanel: false,
|
|
88
87
|
isFilter: false,
|
|
89
|
-
mode:
|
|
88
|
+
mode: '1D',
|
|
90
89
|
spectraOptions: [
|
|
91
90
|
{
|
|
92
91
|
info: [{ key: 'isFt', value: true }],
|
|
@@ -100,7 +99,7 @@ exports.options = {
|
|
|
100
99
|
label: 'Range picking and multiplet analysis',
|
|
101
100
|
hasOptionPanel: true,
|
|
102
101
|
isFilter: false,
|
|
103
|
-
mode:
|
|
102
|
+
mode: '1D',
|
|
104
103
|
spectraOptions: [
|
|
105
104
|
{
|
|
106
105
|
info: [{ key: 'isFt', value: true }],
|
|
@@ -114,7 +113,7 @@ exports.options = {
|
|
|
114
113
|
label: nmr_processing_1.Filters.apodization.name,
|
|
115
114
|
hasOptionPanel: true,
|
|
116
115
|
isFilter: true,
|
|
117
|
-
mode:
|
|
116
|
+
mode: '1D',
|
|
118
117
|
spectraOptions: [
|
|
119
118
|
{
|
|
120
119
|
info: [
|
|
@@ -131,7 +130,7 @@ exports.options = {
|
|
|
131
130
|
label: nmr_processing_1.Filters.zeroFilling.name,
|
|
132
131
|
hasOptionPanel: true,
|
|
133
132
|
isFilter: true,
|
|
134
|
-
mode:
|
|
133
|
+
mode: '1D',
|
|
135
134
|
spectraOptions: [
|
|
136
135
|
{
|
|
137
136
|
info: [
|
|
@@ -148,7 +147,7 @@ exports.options = {
|
|
|
148
147
|
label: nmr_processing_1.Filters.phaseCorrection.name,
|
|
149
148
|
hasOptionPanel: true,
|
|
150
149
|
isFilter: true,
|
|
151
|
-
mode:
|
|
150
|
+
mode: '1D',
|
|
152
151
|
spectraOptions: [
|
|
153
152
|
{
|
|
154
153
|
info: [
|
|
@@ -165,7 +164,7 @@ exports.options = {
|
|
|
165
164
|
label: nmr_processing_1.Filters.baselineCorrection.name,
|
|
166
165
|
hasOptionPanel: true,
|
|
167
166
|
isFilter: true,
|
|
168
|
-
mode:
|
|
167
|
+
mode: '1D',
|
|
169
168
|
spectraOptions: [
|
|
170
169
|
{
|
|
171
170
|
info: [{ key: 'isFt', value: true }],
|
|
@@ -179,7 +178,7 @@ exports.options = {
|
|
|
179
178
|
label: 'range general selector',
|
|
180
179
|
hasOptionPanel: false,
|
|
181
180
|
isFilter: false,
|
|
182
|
-
mode:
|
|
181
|
+
mode: '1D',
|
|
183
182
|
spectraOptions: [
|
|
184
183
|
{
|
|
185
184
|
info: [{ key: 'isFt', value: true }],
|
|
@@ -193,7 +192,7 @@ exports.options = {
|
|
|
193
192
|
label: 'edit range',
|
|
194
193
|
hasOptionPanel: false,
|
|
195
194
|
isFilter: false,
|
|
196
|
-
mode:
|
|
195
|
+
mode: '1D',
|
|
197
196
|
spectraOptions: [
|
|
198
197
|
{
|
|
199
198
|
info: [{ key: 'isFt', value: true }],
|
|
@@ -207,7 +206,7 @@ exports.options = {
|
|
|
207
206
|
label: 'Multiple spectra analysis',
|
|
208
207
|
hasOptionPanel: false,
|
|
209
208
|
isFilter: false,
|
|
210
|
-
mode:
|
|
209
|
+
mode: '1D',
|
|
211
210
|
spectraOptions: [
|
|
212
211
|
{
|
|
213
212
|
info: [{ key: 'isFt', value: true }],
|
|
@@ -224,7 +223,7 @@ exports.options = {
|
|
|
224
223
|
label: 'Exclusion zones',
|
|
225
224
|
hasOptionPanel: false,
|
|
226
225
|
isFilter: false,
|
|
227
|
-
mode:
|
|
226
|
+
mode: '1D',
|
|
228
227
|
spectraOptions: [
|
|
229
228
|
{
|
|
230
229
|
info: [{ key: 'isFt', value: true }],
|
|
@@ -241,7 +240,7 @@ exports.options = {
|
|
|
241
240
|
label: 'Matrix generations exclusion zones',
|
|
242
241
|
hasOptionPanel: false,
|
|
243
242
|
isFilter: false,
|
|
244
|
-
mode:
|
|
243
|
+
mode: '1D',
|
|
245
244
|
spectraOptions: [
|
|
246
245
|
{
|
|
247
246
|
info: [{ key: 'isFt', value: true }],
|
|
@@ -258,7 +257,7 @@ exports.options = {
|
|
|
258
257
|
label: 'Filter database',
|
|
259
258
|
hasOptionPanel: false,
|
|
260
259
|
isFilter: false,
|
|
261
|
-
mode:
|
|
260
|
+
mode: '1D',
|
|
262
261
|
spectraOptions: [
|
|
263
262
|
{
|
|
264
263
|
info: [{ key: 'isFt', value: true }],
|
|
@@ -279,7 +278,7 @@ exports.options = {
|
|
|
279
278
|
label: 'Fourier transform',
|
|
280
279
|
hasOptionPanel: false,
|
|
281
280
|
isFilter: true,
|
|
282
|
-
mode:
|
|
281
|
+
mode: '1D',
|
|
283
282
|
spectraOptions: [
|
|
284
283
|
{
|
|
285
284
|
info: [
|
|
@@ -296,7 +295,7 @@ exports.options = {
|
|
|
296
295
|
label: 'Fourier transform dimension 1',
|
|
297
296
|
hasOptionPanel: false,
|
|
298
297
|
isFilter: true,
|
|
299
|
-
mode:
|
|
298
|
+
mode: '2D',
|
|
300
299
|
spectraOptions: [
|
|
301
300
|
{
|
|
302
301
|
info: [
|
|
@@ -314,7 +313,7 @@ exports.options = {
|
|
|
314
313
|
label: 'Fourier transform dimension 2',
|
|
315
314
|
hasOptionPanel: false,
|
|
316
315
|
isFilter: true,
|
|
317
|
-
mode:
|
|
316
|
+
mode: '2D',
|
|
318
317
|
spectraOptions: [
|
|
319
318
|
{
|
|
320
319
|
info: [
|
|
@@ -339,7 +338,7 @@ exports.options = {
|
|
|
339
338
|
label: 'Real / Imaginary',
|
|
340
339
|
hasOptionPanel: false,
|
|
341
340
|
isFilter: false,
|
|
342
|
-
mode:
|
|
341
|
+
mode: '1D',
|
|
343
342
|
spectraOptions: [
|
|
344
343
|
{
|
|
345
344
|
info: [{ key: 'isComplex', value: true }],
|
|
@@ -353,7 +352,7 @@ exports.options = {
|
|
|
353
352
|
label: 'Align spectrum',
|
|
354
353
|
hasOptionPanel: false,
|
|
355
354
|
isFilter: false,
|
|
356
|
-
mode:
|
|
355
|
+
mode: '1D',
|
|
357
356
|
isToggle: false,
|
|
358
357
|
},
|
|
359
358
|
spectraStackAlignments: {
|
|
@@ -361,7 +360,7 @@ exports.options = {
|
|
|
361
360
|
label: 'Stack spectra',
|
|
362
361
|
hasOptionPanel: false,
|
|
363
362
|
isFilter: false,
|
|
364
|
-
mode:
|
|
363
|
+
mode: '1D',
|
|
365
364
|
spectraOptions: [
|
|
366
365
|
{
|
|
367
366
|
info: [{ key: 'isFt', value: true }],
|
|
@@ -20,7 +20,7 @@ function detectSignal(data, options) {
|
|
|
20
20
|
};
|
|
21
21
|
const result = (0, multiplet_analysis_1.analyseMultiplet)(dataRoi, {
|
|
22
22
|
frequency,
|
|
23
|
-
minimalResolution: 0.
|
|
23
|
+
minimalResolution: 0.1,
|
|
24
24
|
maxTestedJ: 17,
|
|
25
25
|
checkSymmetryFirst: true,
|
|
26
26
|
takeBestPartMultiplet: true,
|
package/lib-cjs/versionInfo.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nmrium",
|
|
3
3
|
"description": "React component to display and process nuclear magnetic resonance (NMR) spectra.",
|
|
4
|
-
"version": "0.43.
|
|
4
|
+
"version": "0.43.1-pre.1692874523",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib-cjs/component/main/index.js",
|
|
7
7
|
"module": "lib/component/main/index.js",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"multiplet-analysis": "^2.1.2",
|
|
89
89
|
"nmr-correlation": "^2.3.3",
|
|
90
90
|
"nmr-load-save": "^0.17.2",
|
|
91
|
-
"nmr-processing": "^10.0.
|
|
91
|
+
"nmr-processing": "^10.0.6",
|
|
92
92
|
"nmredata": "^0.9.2",
|
|
93
93
|
"numeral": "^2.0.6",
|
|
94
94
|
"openchemlib": "^8.3.0",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"react-ocl-nmr": "^3.0.0",
|
|
106
106
|
"react-plot": "^1.4.2",
|
|
107
107
|
"react-rnd": "^10.4.1",
|
|
108
|
-
"react-science": "^0.
|
|
108
|
+
"react-science": "^0.26.2",
|
|
109
109
|
"react-slider": "^2.0.6",
|
|
110
110
|
"react-table": "^7.8.0",
|
|
111
111
|
"react-transition-group": "^4.4.5",
|
|
File without changes
|