nmrium 0.19.0 → 0.20.2
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/Chart1D.js +3 -3
- package/lib/component/1d/ExclusionZoneAnnotation.d.ts +11 -0
- package/lib/component/1d/ExclusionZoneAnnotation.js +18 -0
- package/lib/component/1d/ExclusionZonesAnnotations.d.ts +3 -0
- package/lib/component/1d/ExclusionZonesAnnotations.js +28 -0
- package/lib/component/1d/Line.js +11 -23
- package/lib/component/1d/Viewer1D.js +36 -5
- package/lib/component/1d/ranges/Ranges.js +3 -3
- package/lib/component/1d/{BaseLineZones.d.ts → tool/BaseLineZones.d.ts} +0 -0
- package/lib/component/1d/{BaseLineZones.js → tool/BaseLineZones.js} +5 -5
- package/lib/component/1d/utilities/useIntegralPath.js +9 -10
- package/lib/component/2d/Contours.js +12 -11
- package/lib/component/2d/Left1DChart.js +7 -9
- package/lib/component/2d/Top1DChart.js +7 -7
- package/lib/component/2d/tools/slicing/HorizontalSliceChart.js +7 -7
- package/lib/component/2d/tools/slicing/VerticalSliceChart.js +7 -9
- package/lib/component/EventsTrackers/BrushTracker.js +2 -2
- package/lib/component/EventsTrackers/KeysListenerTracker.js +12 -3
- package/lib/component/NMRium.d.ts +1 -1
- package/lib/component/NMRium.js +28 -25
- package/lib/component/elements/NumberInput.d.ts +1 -2
- package/lib/component/elements/Tab/Tab.js +1 -0
- package/lib/component/hooks/useActiveSpectrumStyleOptions.d.ts +6 -0
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +15 -0
- package/lib/component/hooks/useXYReduce.d.ts +2 -1
- package/lib/component/loader/DropZone.js +1 -1
- package/lib/component/modal/ModalStyle.js +5 -2
- package/lib/component/modal/MoleculeStructureEditorModal.js +3 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +10 -1
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.d.ts +2 -0
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +35 -0
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +49 -51
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +3 -8
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -23
- package/lib/component/panels/Panels.js +10 -0
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.d.ts +5 -5
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +1 -1
- package/lib/component/panels/SummaryPanel/Utilities.d.ts +7 -7
- package/lib/component/panels/ZonesPanel/ZonesTable.js +9 -2
- package/lib/component/reducer/Reducer.d.ts +11 -27
- package/lib/component/reducer/Reducer.js +4 -5
- package/lib/component/reducer/actions/CorrelationsActions.d.ts +7 -7
- package/lib/component/reducer/actions/CorrelationsActions.js +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts +3 -1
- package/lib/component/reducer/actions/FiltersActions.js +60 -18
- package/lib/component/reducer/actions/LoadActions.js +2 -3
- package/lib/component/reducer/actions/MoleculeActions.js +2 -2
- package/lib/component/reducer/actions/PreferencesActions.js +4 -7
- package/lib/component/reducer/actions/RangesActions.js +1 -1
- package/lib/component/reducer/actions/ToolsActions.d.ts +1 -3
- package/lib/component/reducer/actions/ToolsActions.js +1 -30
- package/lib/component/reducer/helper/getRange.d.ts +6 -1
- package/lib/component/reducer/helper/getRange.js +1 -1
- package/lib/component/toolbar/FunctionToolBar.js +2 -5
- package/lib/component/utility/PathBuilder.d.ts +7 -0
- package/lib/component/utility/PathBuilder.js +17 -0
- package/lib/component/utility/getSpectraByNucleus.d.ts +3 -0
- package/lib/component/utility/getSpectraByNucleus.js +4 -0
- package/lib/data/Filters.d.ts +2 -1
- package/lib/data/Filters.js +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -2
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +0 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +23 -15
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +16 -0
- package/lib/data/data1d/filter1d/exclusionZones.js +28 -0
- package/lib/data/types/data1d/ExclusionZone.d.ts +5 -0
- package/lib/data/types/data1d/ExclusionZone.js +1 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +3 -3
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +23 -0
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +52 -0
- package/lib-cjs/component/1d/Line.js +11 -23
- package/lib-cjs/component/1d/Viewer1D.js +36 -5
- package/lib-cjs/component/1d/ranges/Ranges.js +1 -1
- package/lib-cjs/component/1d/{BaseLineZones.js → tool/BaseLineZones.js} +5 -5
- package/lib-cjs/component/1d/utilities/useIntegralPath.js +9 -10
- package/lib-cjs/component/2d/Contours.js +12 -11
- package/lib-cjs/component/2d/Left1DChart.js +7 -9
- package/lib-cjs/component/2d/Top1DChart.js +7 -7
- package/lib-cjs/component/2d/tools/slicing/HorizontalSliceChart.js +7 -7
- package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +7 -9
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +2 -2
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +12 -3
- package/lib-cjs/component/NMRium.js +28 -25
- package/lib-cjs/component/elements/Tab/Tab.js +1 -0
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +21 -0
- package/lib-cjs/component/loader/DropZone.js +1 -1
- package/lib-cjs/component/modal/ModalStyle.js +5 -2
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +3 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +10 -1
- package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +40 -0
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +49 -51
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +3 -8
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -22
- package/lib-cjs/component/panels/Panels.js +10 -0
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -1
- package/lib-cjs/component/reducer/Reducer.js +4 -5
- package/lib-cjs/component/reducer/actions/FiltersActions.js +62 -18
- package/lib-cjs/component/reducer/actions/LoadActions.js +2 -3
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +2 -2
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +4 -7
- package/lib-cjs/component/reducer/actions/RangesActions.js +1 -1
- package/lib-cjs/component/reducer/actions/ToolsActions.js +1 -32
- package/lib-cjs/component/reducer/helper/getRange.js +1 -1
- package/lib-cjs/component/toolbar/FunctionToolBar.js +2 -5
- package/lib-cjs/component/utility/PathBuilder.js +21 -0
- package/lib-cjs/component/utility/getSpectraByNucleus.js +11 -0
- package/lib-cjs/data/Filters.js +3 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +5 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +0 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +24 -15
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +34 -0
- package/lib-cjs/data/types/data1d/ExclusionZone.js +2 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +28 -29
- package/lib/component/1d/ExclusionZone.d.ts +0 -8
- package/lib/component/1d/ExclusionZone.js +0 -30
- package/lib/component/1d/ExclusionZones.d.ts +0 -2
- package/lib/component/1d/ExclusionZones.js +0 -10
- package/lib-cjs/component/1d/ExclusionZone.js +0 -32
- package/lib-cjs/component/1d/ExclusionZones.js +0 -16
package/lib/component/NMRium.js
CHANGED
|
@@ -106,7 +106,10 @@ const defaultPreferences = {};
|
|
|
106
106
|
const defaultData = {
|
|
107
107
|
spectra: [],
|
|
108
108
|
};
|
|
109
|
-
function NMRium(
|
|
109
|
+
function NMRium(props) {
|
|
110
|
+
return (_jsx(RootLayout, { style: { width: '100%' }, children: _jsx(ErrorBoundary, { FallbackComponent: ErrorOverlay, children: _jsx(InnerNMRium, { ...props }, void 0) }, void 0) }, void 0));
|
|
111
|
+
}
|
|
112
|
+
function InnerNMRium({ data: dataProp = defaultData, mode = NMRiumMode.DEFAULT, preferences = defaultPreferences, getSpinner = defaultGetSpinner, onDataChange, emptyText, }) {
|
|
110
113
|
const rootRef = useRef(null);
|
|
111
114
|
const elementsWraperRef = useRef(null);
|
|
112
115
|
const [show, toggle] = useToggle(false);
|
|
@@ -156,30 +159,30 @@ function NMRium({ data: dataProp = defaultData, mode = NMRiumMode.DEFAULT, prefe
|
|
|
156
159
|
const mouseLeaveHandler = useCallback(() => {
|
|
157
160
|
dispatchMiddleWare({ type: SET_MOUSE_OVER_DISPLAYER, payload: false });
|
|
158
161
|
}, [dispatchMiddleWare]);
|
|
159
|
-
return (_jsx(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
162
|
+
return (_jsx(GlobalProvider, { value: {
|
|
163
|
+
rootRef: rootRef.current,
|
|
164
|
+
elementsWraperRef: elementsWraperRef.current,
|
|
165
|
+
}, children: _jsx(PreferencesProvider, { value: preferencesState, children: _jsx("div", { onMouseEnter: mouseEnterHandler, onMouseLeave: mouseLeaveHandler, style: { height: '100%', position: 'relative' }, children: _jsx(AlertProvider, { wrapperRef: elementsWraperRef.current, children: _jsx(DispatchProvider, { value: dispatchMiddleWare, children: _jsx(ChartDataProvider, { value: state, children: _jsx(ModalProvider, { wrapperRef: elementsWraperRef.current, children: _jsx(HighlightProvider, { children: _jsx(AssignmentProvider, { spectraData: spectraData, children: _jsx(SpinnerProvider, { value: getSpinner, children: _jsx("div", { className: "nmrium-container", ref: rootRef, css: containerStyles, onContextMenu: preventContextMenuHandler, style: { height: '100%', width: '100%' }, children: _jsx(DropZone, { children: _jsxs("div", { style: {
|
|
166
|
+
display: 'flex',
|
|
167
|
+
flexDirection: 'column',
|
|
168
|
+
backgroundColor: 'white',
|
|
169
|
+
width: '100%',
|
|
170
|
+
}, children: [_jsx(Header, { isFullscreen: isFullscreen, onMaximize: toggle }, void 0), _jsxs("div", { style: {
|
|
163
171
|
display: 'flex',
|
|
164
|
-
flexDirection: '
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
left: 0,
|
|
180
|
-
right: 0,
|
|
181
|
-
top: 0,
|
|
182
|
-
bottom: 0,
|
|
183
|
-
} }, String(isFullscreen))] }, void 0)] }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0));
|
|
172
|
+
flexDirection: 'row',
|
|
173
|
+
height: '100%',
|
|
174
|
+
}, children: [_jsx(ToolBar, {}, void 0), _jsxs(SplitPane, { initialSeparation: "590px", orientation: "horizontal", sideSeparation: "end", children: [_jsxs("div", { css: viewerContainerStyle, children: [_jsx(KeysListenerTracker, {}, void 0), _jsx("div", { "data-test-id": "viewer", style: {
|
|
175
|
+
width: '100%',
|
|
176
|
+
height: '100%',
|
|
177
|
+
}, children: displayerMode ===
|
|
178
|
+
DISPLAYER_MODE.DM_1D ? (_jsx(Viewer1D, { emptyText: emptyText }, void 0)) : (_jsx(Viewer2D, { emptyText: emptyText }, void 0)) }, void 0)] }, void 0), _jsx(Panels, {}, void 0)] }, void 0), _jsx("div", { ref: elementsWraperRef, id: "main-wrapper", style: {
|
|
179
|
+
position: 'absolute',
|
|
180
|
+
pointerEvents: 'none',
|
|
181
|
+
zIndex: 0,
|
|
182
|
+
left: 0,
|
|
183
|
+
right: 0,
|
|
184
|
+
top: 0,
|
|
185
|
+
bottom: 0,
|
|
186
|
+
} }, String(isFullscreen))] }, void 0)] }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0));
|
|
184
187
|
}
|
|
185
188
|
export default memo(NMRium);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface NumberInputProps {
|
|
3
|
-
ref?: any;
|
|
4
3
|
pattern?: string;
|
|
5
4
|
label?: string;
|
|
6
5
|
name?: string;
|
|
@@ -17,5 +16,5 @@ export interface NumberInputProps {
|
|
|
17
16
|
onChange?: (element: any) => void;
|
|
18
17
|
onInput?: () => void;
|
|
19
18
|
}
|
|
20
|
-
declare const NumberInput: import("react").ForwardRefExoticComponent<
|
|
19
|
+
declare const NumberInput: import("react").ForwardRefExoticComponent<NumberInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
21
20
|
export default NumberInput;
|
|
@@ -14,6 +14,7 @@ const styles = (styles) => css `
|
|
|
14
14
|
|
|
15
15
|
${styles}
|
|
16
16
|
`;
|
|
17
|
+
/* eslint-enable react/no-unused-prop-types */
|
|
17
18
|
export function InternalTab({ tabid, tablabel, isActive, onClick = () => null, canDelete, onDelete = () => null, tabstyles, render, }) {
|
|
18
19
|
let className = 'tab-list-item';
|
|
19
20
|
// use tab identifier if given (higher priority)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import get from 'lodash/get';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useChartData } from '../context/ChartContext';
|
|
4
|
+
import { usePreferences } from '../context/PreferencesContext';
|
|
5
|
+
export default function useActiveSpectrumStyleOptions(id) {
|
|
6
|
+
const { activeSpectrum } = useChartData();
|
|
7
|
+
const preferences = usePreferences();
|
|
8
|
+
return useMemo(() => {
|
|
9
|
+
const isActive = activeSpectrum === null ? true : id === activeSpectrum.id ? true : false;
|
|
10
|
+
const opacity = isActive
|
|
11
|
+
? 1
|
|
12
|
+
: get(preferences, 'controllers.dimmedSpectraTransparency', 0.1);
|
|
13
|
+
return { isActive, opacity };
|
|
14
|
+
}, [activeSpectrum, id, preferences]);
|
|
15
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataXY, DoubleArray } from 'cheminfo-types';
|
|
1
2
|
export declare enum XYReducerDomainAxis {
|
|
2
3
|
XAxis = "XAxis",
|
|
3
4
|
YAxis = "YAxis"
|
|
@@ -6,5 +7,5 @@ declare type XYReducerDomainAxisType = keyof typeof XYReducerDomainAxis;
|
|
|
6
7
|
export default function useXYReduce(domainAxis: XYReducerDomainAxisType): (data: {
|
|
7
8
|
x: number[];
|
|
8
9
|
y: number[];
|
|
9
|
-
}) =>
|
|
10
|
+
}) => DataXY<DoubleArray>;
|
|
10
11
|
export {};
|
|
@@ -199,7 +199,7 @@ function DropZone(props) {
|
|
|
199
199
|
const open = useCallback(() => {
|
|
200
200
|
openImportDialog();
|
|
201
201
|
}, [openImportDialog]);
|
|
202
|
-
return (_jsx(LoaderProvider, { value: open, children: _jsxs("div", { ...getRootProps(), css: containerStyle, children: [_jsx("input", { ...getInputProps() }, void 0), isDragActive && (_jsxs("div", { css: style, style: {
|
|
202
|
+
return (_jsx(LoaderProvider, { value: open, children: _jsxs("div", { ...getRootProps(), role: "none", css: containerStyle, children: [_jsx("input", { "data-test-id": "dropzone-input", ...getInputProps() }, void 0), isDragActive && (_jsxs("div", { css: style, style: {
|
|
203
203
|
width: `${width}px`,
|
|
204
204
|
height: `${height}px`,
|
|
205
205
|
marginTop: '30px',
|
|
@@ -31,12 +31,15 @@ export const ModalStyles = css `
|
|
|
31
31
|
button:focus {
|
|
32
32
|
outline: none;
|
|
33
33
|
}
|
|
34
|
-
button:hover {
|
|
34
|
+
button:not([disabled]):hover {
|
|
35
35
|
color: #007bff;
|
|
36
36
|
}
|
|
37
|
-
.btn:hover {
|
|
37
|
+
.btn:not([disabled]):hover {
|
|
38
38
|
background-color: #ffffff;
|
|
39
39
|
}
|
|
40
|
+
.btn:disabled {
|
|
41
|
+
opacity: 0.5;
|
|
42
|
+
}
|
|
40
43
|
.btn {
|
|
41
44
|
border: none;
|
|
42
45
|
padding: 0 15px;
|
|
@@ -18,7 +18,8 @@ function MoleculeStructureEditorModal(props) {
|
|
|
18
18
|
}
|
|
19
19
|
}, [selectedMolecule]);
|
|
20
20
|
const cb = useCallback((newMolfile) => {
|
|
21
|
-
|
|
21
|
+
const molText = /(?<s>M {2}V30 BEGIN BOND)(?<mol>.*?)(?<e>M {2}V30 END BOND)/gs.exec(newMolfile)?.groups?.mol;
|
|
22
|
+
setMolfile(molText?.trim() ? newMolfile : null);
|
|
22
23
|
}, [setMolfile]);
|
|
23
24
|
const handleClose = useCallback(() => {
|
|
24
25
|
onClose();
|
|
@@ -33,6 +34,6 @@ function MoleculeStructureEditorModal(props) {
|
|
|
33
34
|
onClose('new');
|
|
34
35
|
}
|
|
35
36
|
}, [dispatch, selectedMolecule, molfile, onClose]);
|
|
36
|
-
return (_jsxs("div", { css: ModalStyles, children: [_jsx(StructureEditor, { initialMolfile: selectedMolecule?.molfile, svgMenu: true, fragment: false, onChange: cb }, void 0), _jsxs("div", { className: "footer-container", children: [_jsx("button", { type: "button", className: "btn", onClick: handleSave, children: "Save" }, void 0), _jsx("button", { type: "button", className: "btn", onClick: handleClose, children: "Close" }, void 0)] }, void 0)] }, void 0));
|
|
37
|
+
return (_jsxs("div", { css: ModalStyles, children: [_jsx(StructureEditor, { initialMolfile: selectedMolecule?.molfile, svgMenu: true, fragment: false, onChange: cb }, void 0), _jsxs("div", { className: "footer-container", children: [_jsx("button", { type: "button", className: "btn", onClick: handleSave, disabled: !molfile, children: "Save" }, void 0), _jsx("button", { type: "button", className: "btn", onClick: handleClose, children: "Close" }, void 0)] }, void 0)] }, void 0));
|
|
37
38
|
}
|
|
38
39
|
export default MoleculeStructureEditorModal;
|
|
@@ -49,6 +49,15 @@ const styles = css `
|
|
|
49
49
|
.container {
|
|
50
50
|
flex: 1;
|
|
51
51
|
}
|
|
52
|
+
|
|
53
|
+
.infoText {
|
|
54
|
+
padding: 10px;
|
|
55
|
+
font-size: 12px;
|
|
56
|
+
text-align: left;
|
|
57
|
+
color: white;
|
|
58
|
+
background-color: #5f5f5f;
|
|
59
|
+
border-radius: 5px;
|
|
60
|
+
}
|
|
52
61
|
`;
|
|
53
62
|
function MultipleSpectraFiltersModal({ onClose = () => null, nucleus = '', }) {
|
|
54
63
|
const refForm = useRef();
|
|
@@ -105,6 +114,6 @@ function MultipleSpectraFiltersModal({ onClose = () => null, nucleus = '', }) {
|
|
|
105
114
|
break;
|
|
106
115
|
}
|
|
107
116
|
}, [filter, submitHandler]);
|
|
108
|
-
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Apply filters" }, void 0), _jsx(CloseButton, { onClick: onClose, className: "close-bt" }, void 0)] }, void 0), _jsxs("div", { className: "inner-content container", children: [_jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Filter :" }, void 0), _jsx(Select, { data: List, style: { width: 275, height: 30, margin: 0 }, onChange: filterChangeHandler }, void 0)] }, void 0), filterOptions] }, void 0), _jsxs("div", { className: "footer-container", children: [_jsx("button", { type: "button", onClick: handleSave, className: "btn primary", children: "Apply" }, void 0), _jsx("button", { type: "button", onClick: onClose, className: "btn", children: "Close" }, void 0)] }, void 0)] }, void 0));
|
|
117
|
+
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Apply filters" }, void 0), _jsx(CloseButton, { onClick: onClose, className: "close-bt" }, void 0)] }, void 0), _jsxs("div", { className: "inner-content container", children: [_jsx("p", { className: "infoText", children: "This filter will use the exclusions zones defined in the first spectrum." }, void 0), _jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Filter :" }, void 0), _jsx(Select, { data: List, style: { width: 275, height: 30, margin: 0 }, onChange: filterChangeHandler }, void 0)] }, void 0), filterOptions] }, void 0), _jsxs("div", { className: "footer-container", children: [_jsx("button", { type: "button", onClick: handleSave, className: "btn primary", children: "Apply" }, void 0), _jsx("button", { type: "button", onClick: onClose, className: "btn", children: "Close" }, void 0)] }, void 0)] }, void 0));
|
|
109
118
|
}
|
|
110
119
|
export default MultipleSpectraFiltersModal;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { SvgNmrAddFilter, SvgNmrExportAsMatrix } from 'cheminfo-font';
|
|
4
|
+
import { useCallback } from 'react';
|
|
5
|
+
import { useDispatch } from '../../context/DispatchContext';
|
|
6
|
+
import Button from '../../elements/ButtonToolTip';
|
|
7
|
+
import { positions, useModal } from '../../elements/popup/Modal';
|
|
8
|
+
import ExportAsMatrixModal from '../../modal/ExportAsMatrixModal';
|
|
9
|
+
import MultipleSpectraFiltersModal from '../../modal/MultipleSpectraFiltersModal';
|
|
10
|
+
import { RESET_SELECTED_TOOL } from '../../reducer/types/Types';
|
|
11
|
+
import { tablePanelStyle } from '../extra/BasicPanelStyle';
|
|
12
|
+
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
13
|
+
function MatrixGenerationPanel() {
|
|
14
|
+
const modal = useModal();
|
|
15
|
+
const dispatch = useDispatch();
|
|
16
|
+
const openFiltersModal = useCallback(() => {
|
|
17
|
+
dispatch({ type: RESET_SELECTED_TOOL });
|
|
18
|
+
modal.show(_jsx(MultipleSpectraFiltersModal, {}, void 0), {
|
|
19
|
+
isBackgroundBlur: false,
|
|
20
|
+
position: positions.TOP_CENTER,
|
|
21
|
+
width: 550,
|
|
22
|
+
height: 250,
|
|
23
|
+
});
|
|
24
|
+
}, [modal, dispatch]);
|
|
25
|
+
const openExportAsMatrixModal = useCallback(() => {
|
|
26
|
+
dispatch({ type: RESET_SELECTED_TOOL });
|
|
27
|
+
modal.show(_jsx(ExportAsMatrixModal, {}, void 0), {
|
|
28
|
+
isBackgroundBlur: false,
|
|
29
|
+
position: positions.TOP_CENTER,
|
|
30
|
+
width: 500,
|
|
31
|
+
});
|
|
32
|
+
}, [modal, dispatch]);
|
|
33
|
+
return (_jsxs("div", { css: tablePanelStyle, children: [_jsxs(DefaultPanelHeader, { deleteToolTip: "Delete All Peaks", showSettingButton: true, canDelete: false, children: [_jsx(Button, { popupTitle: "Add Filter", onClick: openFiltersModal, children: _jsx(SvgNmrAddFilter, { style: { fontSize: '18px' } }, void 0) }, void 0), _jsx(Button, { popupTitle: "Export spectra as a Matrix", onClick: openExportAsMatrixModal, children: _jsx(SvgNmrExportAsMatrix, {}, void 0) }, void 0)] }, void 0), _jsx("div", { className: "inner-container" }, void 0)] }, void 0));
|
|
34
|
+
}
|
|
35
|
+
export default MatrixGenerationPanel;
|
|
@@ -3,9 +3,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import OCL from 'openchemlib/full';
|
|
5
5
|
import { useState, useCallback, useEffect, memo } from 'react';
|
|
6
|
+
import { ResponsiveChart } from 'react-d3-utils';
|
|
6
7
|
import { MF } from 'react-mf';
|
|
7
8
|
import OCLnmr from 'react-ocl-nmr';
|
|
8
|
-
import { useMeasure } from 'react-use';
|
|
9
9
|
import { useChartData } from '../../context/ChartContext';
|
|
10
10
|
import { useDispatch } from '../../context/DispatchContext';
|
|
11
11
|
import NextPrev from '../../elements/NextPrev';
|
|
@@ -15,48 +15,44 @@ import MoleculeStructureEditorModal from '../../modal/MoleculeStructureEditorMod
|
|
|
15
15
|
import { SET_MOLECULE } from '../../reducer/types/Types';
|
|
16
16
|
import MoleculePanelHeader from './MoleculePanelHeader';
|
|
17
17
|
import useAtomAssignment from './useAtomAssignment';
|
|
18
|
-
const styles =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
`;
|
|
18
|
+
const styles = {
|
|
19
|
+
panel: css({
|
|
20
|
+
display: 'flex',
|
|
21
|
+
flexGrow: 1,
|
|
22
|
+
width: '100%',
|
|
23
|
+
height: '100%',
|
|
24
|
+
flexDirection: 'column',
|
|
25
|
+
}),
|
|
26
|
+
molecule: css({
|
|
27
|
+
display: 'flex',
|
|
28
|
+
flex: '1 1 0%',
|
|
29
|
+
flexDirection: 'column',
|
|
30
|
+
minHeight: 0,
|
|
31
|
+
}),
|
|
32
|
+
toolbar: css({
|
|
33
|
+
display: 'flex',
|
|
34
|
+
borderBottom: '0.55px solid rgb(240, 240, 240)',
|
|
35
|
+
padding: '0px 10px',
|
|
36
|
+
justifyContent: 'end',
|
|
37
|
+
height: 22,
|
|
38
|
+
}),
|
|
39
|
+
slider: css({
|
|
40
|
+
display: 'flex',
|
|
41
|
+
flexDirection: 'column',
|
|
42
|
+
justifyContent: 'center',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
flexGrow: 1,
|
|
45
|
+
minHeight: 0,
|
|
46
|
+
}),
|
|
47
|
+
items: css({
|
|
48
|
+
display: 'flex',
|
|
49
|
+
flexDirection: 'column',
|
|
50
|
+
flex: '1 1 0%',
|
|
51
|
+
height: '100%',
|
|
52
|
+
minHeight: 0,
|
|
53
|
+
}),
|
|
54
|
+
};
|
|
58
55
|
function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab, displayerMode, }) {
|
|
59
|
-
const [refContainer, { width, height }] = useMeasure();
|
|
60
56
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
61
57
|
const [molecules, setMolecules] = useState([]);
|
|
62
58
|
const dispatch = useDispatch();
|
|
@@ -85,15 +81,17 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
|
|
|
85
81
|
const moleculeIndexHandler = useCallback((index) => {
|
|
86
82
|
setCurrentIndex(index);
|
|
87
83
|
}, []);
|
|
88
|
-
return (_jsxs("div", { css: styles, children: [_jsx(MoleculePanelHeader, { currentIndex: currentIndex, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditorHandler(), onMoleculeIndexChange: moleculeIndexHandler }, void 0), _jsx("div", {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
84
|
+
return (_jsxs("div", { css: styles.panel, children: [_jsx(MoleculePanelHeader, { currentIndex: currentIndex, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditorHandler(), onMoleculeIndexChange: moleculeIndexHandler }, void 0), _jsx("div", { css: styles.molecule, children: _jsx(NextPrev, { onChange: (slideIndex) => setCurrentIndex(slideIndex), defaultIndex: currentIndex, children: molecules && molecules.length > 0 ? (molecules.map((mol, index) => (_jsxs("div", { css: styles.items, children: [_jsxs("span", { css: styles.toolbar, children: [_jsx(MF, { mf: mol.mf }, void 0), " - ", mol.mw?.toFixed(2)] }, void 0), _jsx("div", { css: styles.slider, className: "mol-svg-container", onDoubleClick: () => openMoleculeEditorHandler(mol), style: {
|
|
85
|
+
backgroundColor: (index + 1) % 2 !== 0 ? '#fafafa' : 'white',
|
|
86
|
+
}, children: _jsx(ResponsiveChart, { children: ({ height, width }) => {
|
|
87
|
+
return (_jsx(OCLnmr, { OCL: OCL, id: `molSVG${index}`, width: width, height: height, molfile: mol.molfile || '', setMolfile: (molfile) => handleReplaceMolecule(mol.key, molfile), setSelectedAtom: handleOnClickAtom, atomHighlightColor: currentDiaIDsToHighlight &&
|
|
88
|
+
currentDiaIDsToHighlight.length > 0
|
|
89
|
+
? 'red'
|
|
90
|
+
: '#FFD700', atomHighlightOpacity: 0.35, highlights: currentDiaIDsToHighlight &&
|
|
91
|
+
currentDiaIDsToHighlight.length > 0
|
|
92
|
+
? currentDiaIDsToHighlight
|
|
93
|
+
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover }, void 0));
|
|
94
|
+
} }, void 0) }, void 0)] }, mol.key)))) : (_jsx("div", { style: { width: '100%', height: '100%' }, onClick: () => openMoleculeEditorHandler() }, void 0)) }, void 0) }, void 0)] }, void 0));
|
|
97
95
|
}
|
|
98
96
|
const MemoizedMoleculePanel = memo(MoleculePanelInner);
|
|
99
97
|
const emptyData = { ranges: {}, zones: {} };
|
|
@@ -98,15 +98,10 @@ export default function useAtomAssignment({ displayerMode, activeTab, zones, ran
|
|
|
98
98
|
return getCurrentDiaIDsToHighlight(assignmentData, displayerMode).concat(highlights);
|
|
99
99
|
}, [assignmentData, data, displayerMode, highlightData.highlight]);
|
|
100
100
|
const toggleAssignment = useCallback((diaID, atomInformation) => {
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
if (assignedDiaIDsMerged.some((_oclID) => atomInformation.oclIDs.includes(_oclID)) &&
|
|
104
|
-
!diaID.some((_oclID) => atomInformation.oclIDs.includes(_oclID))) {
|
|
105
|
-
alert.info('Atom is already assigned to another signal!');
|
|
106
|
-
return diaID;
|
|
107
|
-
}
|
|
101
|
+
// a previous version of the code prevented to assign many time the same atom
|
|
102
|
+
// see revision cc13abc18f77b6787b923e3c4edaef51750d9e90
|
|
108
103
|
return toggleDiaIDs(diaID, atomInformation);
|
|
109
|
-
}, [
|
|
104
|
+
}, []);
|
|
110
105
|
const handleOnClickAtom = useCallback((atom, event) => {
|
|
111
106
|
if (!checkModifierKeyActivated(event)) {
|
|
112
107
|
if (activeAssignment.isActive) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { SvgNmrOverlay
|
|
4
|
+
import { SvgNmrOverlay } from 'cheminfo-font';
|
|
5
5
|
import { useCallback, useState, useRef, memo, useMemo } from 'react';
|
|
6
6
|
import { FaFileExport } from 'react-icons/fa';
|
|
7
7
|
import { IoPulseOutline } from 'react-icons/io5';
|
|
@@ -13,8 +13,6 @@ import ToggleButton from '../../elements/ToggleButton';
|
|
|
13
13
|
import { positions, useAlert } from '../../elements/popup/Alert';
|
|
14
14
|
import { useModal } from '../../elements/popup/Modal';
|
|
15
15
|
import AlignSpectraModal from '../../modal/AlignSpectraModal';
|
|
16
|
-
import ExportAsMatrixModal from '../../modal/ExportAsMatrixModal';
|
|
17
|
-
import MultipleSpectraFiltersModal from '../../modal/MultipleSpectraFiltersModal';
|
|
18
16
|
import { RESET_SELECTED_TOOL } from '../../reducer/types/Types';
|
|
19
17
|
import Events from '../../utility/Events';
|
|
20
18
|
import { copyTextToClipboard } from '../../utility/Export';
|
|
@@ -56,15 +54,6 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectraAnalysis, }) {
|
|
|
56
54
|
width: 500,
|
|
57
55
|
});
|
|
58
56
|
}, [activeTab, modal, dispatch]);
|
|
59
|
-
const openFiltersModal = useCallback(() => {
|
|
60
|
-
dispatch({ type: RESET_SELECTED_TOOL });
|
|
61
|
-
modal.show(_jsx(MultipleSpectraFiltersModal, {}, void 0), {
|
|
62
|
-
isBackgroundBlur: false,
|
|
63
|
-
position: positions.TOP_CENTER,
|
|
64
|
-
width: 550,
|
|
65
|
-
height: 250,
|
|
66
|
-
});
|
|
67
|
-
}, [modal, dispatch]);
|
|
68
57
|
const copyToClipboardHandler = useCallback(async () => {
|
|
69
58
|
const data = getDataAsString(spectraAnalysis, activeTab);
|
|
70
59
|
const success = await copyTextToClipboard(data);
|
|
@@ -75,14 +64,6 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectraAnalysis, }) {
|
|
|
75
64
|
alert.error('copy to clipboard failed');
|
|
76
65
|
}
|
|
77
66
|
}, [activeTab, alert, spectraAnalysis]);
|
|
78
|
-
const openExportAsMatrixModal = useCallback(() => {
|
|
79
|
-
dispatch({ type: RESET_SELECTED_TOOL });
|
|
80
|
-
modal.show(_jsx(ExportAsMatrixModal, {}, void 0), {
|
|
81
|
-
isBackgroundBlur: false,
|
|
82
|
-
position: positions.TOP_CENTER,
|
|
83
|
-
width: 500,
|
|
84
|
-
});
|
|
85
|
-
}, [modal, dispatch]);
|
|
86
67
|
return (_jsxs("div", { css: [
|
|
87
68
|
tablePanelStyle,
|
|
88
69
|
isFlipped &&
|
|
@@ -95,9 +76,7 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectraAnalysis, }) {
|
|
|
95
76
|
// style={styles.button}
|
|
96
77
|
onClick: copyToClipboardHandler, children: _jsx(FaFileExport, {}, void 0) }, void 0), _jsx(Button, { popupTitle: "Spectra calibration",
|
|
97
78
|
// style={styles.button}
|
|
98
|
-
onClick: openAlignSpectra, children: _jsx(SvgNmrOverlay, { style: { fontSize: '18px' } }, void 0) }, void 0), _jsx(ToggleButton, { popupTitle: "Y Spectra Tracker", popupPlacement: "right", onClick: showTrackerHandler, children: _jsx(IoPulseOutline, {}, void 0) }, void 0), _jsx(
|
|
99
|
-
// style={styles.button}
|
|
100
|
-
onClick: openFiltersModal, children: _jsx(SvgNmrAddFilter, { style: { fontSize: '18px' } }, void 0) }, void 0), _jsx(Button, { popupTitle: "Export spectra as a Matrix", onClick: openExportAsMatrixModal, children: _jsx(SvgNmrExportAsMatrix, {}, void 0) }, void 0)] }, void 0)), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler }, void 0)), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(MultipleSpectraAnalysisTable, { data: data, activeTab: activeTab }, void 0)) : (_jsx(MultipleSpectraAnalysisPreferences, { data: data, onAfterSave: afterSaveHandler, ref: settingRef }, void 0)) }, void 0)] }, void 0));
|
|
79
|
+
onClick: openAlignSpectra, children: _jsx(SvgNmrOverlay, { style: { fontSize: '18px' } }, void 0) }, void 0), _jsx(ToggleButton, { popupTitle: "Y Spectra Tracker", popupPlacement: "right", onClick: showTrackerHandler, children: _jsx(IoPulseOutline, {}, void 0) }, void 0)] }, void 0)), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler }, void 0)), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(MultipleSpectraAnalysisTable, { data: data, activeTab: activeTab }, void 0)) : (_jsx(MultipleSpectraAnalysisPreferences, { data: data, onAfterSave: afterSaveHandler, ref: settingRef }, void 0)) }, void 0)] }, void 0));
|
|
101
80
|
}
|
|
102
81
|
const MemoizedMultipleSpectraAnalysisPanel = memo(MultipleSpectraAnalysisPanelInner);
|
|
103
82
|
export default function MultipleSpectraAnalysisPanel() {
|
|
@@ -9,6 +9,7 @@ import { DISPLAYER_MODE } from '../reducer/core/Constants';
|
|
|
9
9
|
import { options } from '../toolbar/ToolTypes';
|
|
10
10
|
import InformationPanel from './InformationPanel';
|
|
11
11
|
import IntegralPanel from './IntegralsPanel/IntegralPanel';
|
|
12
|
+
import MatrixGenerationPanel from './MatrixGenerationPanel/MatrixGenerationPanel';
|
|
12
13
|
import MoleculePanel from './MoleculesPanel/MoleculePanel';
|
|
13
14
|
import MultipleSpectraAnalysisPanel from './MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel';
|
|
14
15
|
import PeaksPanel from './PeaksPanel/PeaksPanel';
|
|
@@ -69,6 +70,14 @@ const accordionItems = [
|
|
|
69
70
|
hidePreferenceKey: 'hideMultipleSpectraAnalysisPanel',
|
|
70
71
|
mode: null,
|
|
71
72
|
},
|
|
73
|
+
{
|
|
74
|
+
title: 'Matrix Generation',
|
|
75
|
+
component: _jsx(MatrixGenerationPanel, {}, void 0),
|
|
76
|
+
openWhen: [],
|
|
77
|
+
hidePreferenceKey: '',
|
|
78
|
+
mode: null,
|
|
79
|
+
isExperimental: true,
|
|
80
|
+
},
|
|
72
81
|
{
|
|
73
82
|
title: 'Zones',
|
|
74
83
|
component: _jsx(ZonesPanel, {}, void 0),
|
|
@@ -103,6 +112,7 @@ export const PANELS_ACCORDION = {
|
|
|
103
112
|
peakPicking: 'Peaks',
|
|
104
113
|
integral: 'Integrals',
|
|
105
114
|
rangesPicking: 'Ranges',
|
|
115
|
+
zone2D: 'Zones',
|
|
106
116
|
};
|
|
107
117
|
function PanelsInner({ displayerMode }) {
|
|
108
118
|
const preferences = usePreferences();
|
|
@@ -42,7 +42,7 @@ function Spectrum2DHistogram({ color = 'red', data, options = {}, }) {
|
|
|
42
42
|
}
|
|
43
43
|
return { sanPlot, lines };
|
|
44
44
|
}, [data.z, options, yLogBase]);
|
|
45
|
-
return (_jsxs("div", { children: [_jsx("
|
|
45
|
+
return (_jsxs("div", { children: [_jsx("div", { style: { textAlign: 'center', paddingBottom: 5, paddingTop: 5 }, children: "San Plot" }, void 0), _jsxs("div", { style: {
|
|
46
46
|
borderTop: '1px solid #ededed',
|
|
47
47
|
marginTop: '10px',
|
|
48
48
|
paddingTop: '10px',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Correlation, Link } from 'nmr-correlation';
|
|
2
2
|
interface MoveLinkProps {
|
|
3
|
-
correlationDim1:
|
|
4
|
-
correlationDim2:
|
|
5
|
-
link:
|
|
6
|
-
correlations:
|
|
3
|
+
correlationDim1: Correlation;
|
|
4
|
+
correlationDim2: Correlation;
|
|
5
|
+
link: Link;
|
|
6
|
+
correlations: Correlation[];
|
|
7
7
|
onEdit: (action: string, valueDim1: string, valueDim2: string | undefined) => void;
|
|
8
8
|
}
|
|
9
9
|
declare function MoveLink({ correlationDim1, correlationDim2, link, correlations, onEdit, }: MoveLinkProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { getLinkDelta, getLinkDim } from 'nmr-correlation';
|
|
4
|
+
import { getLinkDelta, getLinkDim, } from 'nmr-correlation';
|
|
5
5
|
import { memo, useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
6
|
import { FaFlask, FaSlidersH } from 'react-icons/fa';
|
|
7
7
|
import { findRange, findSignal1D, findSignal2D, findSpectrum, findZone, } from '../../../data/utilities/FindUtilities';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Link, Correlation } from 'nmr-correlation';
|
|
2
2
|
import { Datum2D } from '../../../data/types/data2d';
|
|
3
3
|
declare function getAtomType(nucleus: string): string;
|
|
4
4
|
declare function getLabelColor(correlationData: any, correlation: any): string | null;
|
|
5
|
-
declare function findSignalMatch1D(spectrum: Datum2D, link:
|
|
6
|
-
declare function findSignalMatch2D(spectrum: Datum2D, link:
|
|
7
|
-
declare function getAbbreviation(link:
|
|
5
|
+
declare function findSignalMatch1D(spectrum: Datum2D, link: Link, factor: number, xDomain0: number, xDomain1: number): boolean;
|
|
6
|
+
declare function findSignalMatch2D(spectrum: Datum2D, link: Link, factor: number, xDomain0: number, xDomain1: number, yDomain0: number, yDomain1: number): boolean;
|
|
7
|
+
declare function getAbbreviation(link: Link): string;
|
|
8
8
|
declare function buildNewLink1D(link: any): Link;
|
|
9
|
-
declare function buildNewLink2D(link:
|
|
10
|
-
declare function cloneCorrelationAndEditLink(correlation:
|
|
9
|
+
declare function buildNewLink2D(link: Link, axis: 'x' | 'y'): Link;
|
|
10
|
+
declare function cloneCorrelationAndEditLink(correlation: Correlation, link: Link, axis: 'x' | 'y', action: 'add' | 'remove' | 'unmove'): Correlation;
|
|
11
11
|
declare function getEditedCorrelations({ correlationDim1, correlationDim2, selectedCorrelationValueDim1, selectedCorrelationValueDim2, action, link, correlations, }: {
|
|
12
12
|
correlationDim1: any;
|
|
13
13
|
correlationDim2: any;
|
|
@@ -17,7 +17,7 @@ declare function getEditedCorrelations({ correlationDim1, correlationDim2, selec
|
|
|
17
17
|
link: any;
|
|
18
18
|
correlations: any;
|
|
19
19
|
}): {
|
|
20
|
-
editedCorrelations:
|
|
20
|
+
editedCorrelations: Correlation[];
|
|
21
21
|
buildCorrelationDataOptions: {
|
|
22
22
|
skipDataUpdate?: boolean | undefined;
|
|
23
23
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { useMemo, useCallback, useRef } from 'react';
|
|
@@ -109,6 +109,13 @@ function ZonesTable({ tableData, onUnlink, context, nuclei }) {
|
|
|
109
109
|
}, [tableData]);
|
|
110
110
|
const { items: sortedData, isSortedDesc, onSort } = useTableSortBy(data);
|
|
111
111
|
const rows = useMemo(() => sortedData.map((rowData, index) => (_jsx(ZonesTableRow, { rowIndex: index, rowData: rowData, onUnlink: onUnlink, onContextMenu: (e, rowData) => contextMenuHandler(e, rowData) }, `${rowData.tableMetaInfo.id}`))), [contextMenuHandler, sortedData, onUnlink]);
|
|
112
|
-
return (_jsxs("div", { children: [_jsxs("table", { css: tableStyle, children: [_jsxs("thead", { children: [_jsxs("tr", { children: [_jsx("th", { rowSpan: 2, children: "#" }, void 0), _jsx("th", { colSpan: 2, children: "\u03B4 (ppm)" }, void 0), _jsx("th", { colSpan: 2, children: _jsx(FaLink, {}, void 0) }, void 0), _jsx("th", { colSpan: 2, children: "\u03A3" }, void 0), _jsx("th", { rowSpan: 2, children: "Kind" }, void 0), _jsx("th", { rowSpan: 2, children: '' }, void 0)] }, void 0), _jsxs("tr", { children: [
|
|
112
|
+
return (_jsxs("div", { children: [_jsxs("table", { css: tableStyle, children: [_jsxs("thead", { children: [_jsxs("tr", { children: [_jsx("th", { rowSpan: 2, children: "#" }, void 0), _jsx("th", { colSpan: 2, children: "\u03B4 (ppm)" }, void 0), _jsx("th", { colSpan: 2, children: _jsx(FaLink, {}, void 0) }, void 0), _jsx("th", { colSpan: 2, children: "\u03A3" }, void 0), _jsx("th", { rowSpan: 2, children: "Kind" }, void 0), _jsx("th", { rowSpan: 2, children: '' }, void 0)] }, void 0), _jsxs("tr", { children: [_jsx("th", { id: "tableMetaInfo.signal.x.delta", ...onSort, children: _jsxs(SurroundedText, { text: "F2", children: [nuclei[0], ' ', isSortedDesc('tableMetaInfo.signal.x.delta').content] }, void 0) }, void 0), _jsx("th", { id: "tableMetaInfo.signal.y.delta", ...onSort, children: _jsxs(SurroundedText, { text: "F1", children: [nuclei[1], ' ', isSortedDesc('tableMetaInfo.signal.y.delta').content] }, void 0) }, void 0), _jsx("th", { children: _jsx(SurroundedText, { text: "F2", children: nuclei[0] }, void 0) }, void 0), _jsx("th", { children: _jsx(SurroundedText, { text: "F1", children: nuclei[1] }, void 0) }, void 0), _jsx("th", { children: _jsx(SurroundedText, { text: "F2", children: nuclei[0] }, void 0) }, void 0), _jsx("th", { children: _jsx(SurroundedText, { text: "F1", children: nuclei[1] }, void 0) }, void 0)] }, void 0)] }, void 0), _jsx("tbody", { children: rows }, void 0)] }, void 0), _jsx(ContextMenu, { ref: contextRef, context: context }, void 0)] }, void 0));
|
|
113
|
+
}
|
|
114
|
+
function SurroundedText(props) {
|
|
115
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { style: {
|
|
116
|
+
position: 'absolute',
|
|
117
|
+
fontSize: 8,
|
|
118
|
+
color: '#3539E6',
|
|
119
|
+
}, children: props.text }, void 0), _jsx("div", { style: { marginLeft: 5 }, children: props.children }, void 0)] }, void 0));
|
|
113
120
|
}
|
|
114
121
|
export default ZonesTable;
|