@complat/react-spectra-editor 1.3.5 → 1.4.1
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/dist/__tests__/fixtures/nmr1h_2_jcamp.js +3199 -1944
- package/dist/__tests__/units/components/cmd_bar/01_viewer.test.js +21 -18
- package/dist/__tests__/units/components/cmd_bar/02_zoom.test.js +15 -13
- package/dist/__tests__/units/components/cmd_bar/03_peak.test.js +35 -26
- package/dist/__tests__/units/components/cmd_bar/07_pecker.test.js +17 -14
- package/dist/__tests__/units/components/cmd_bar/r08_change_axes.test.js +15 -13
- package/dist/__tests__/units/components/common/comps.test.js +9 -8
- package/dist/__tests__/units/components/common/draw.test.js +26 -34
- package/dist/__tests__/units/components/panel/graph_selection.test.js +25 -22
- package/dist/__tests__/units/components/panel/info.test.js +30 -25
- package/dist/__tests__/units/components/panel/peaks.test.js +29 -24
- package/dist/actions/manager.js +6 -2
- package/dist/actions/ui.js +13 -21
- package/dist/app.js +45 -45
- package/dist/components/cmd_bar/01_viewer.js +38 -31
- package/dist/components/cmd_bar/02_zoom.js +34 -27
- package/dist/components/cmd_bar/03_peak.js +85 -64
- package/dist/components/cmd_bar/04_integration.js +97 -76
- package/dist/components/cmd_bar/05_multiplicity.js +94 -67
- package/dist/components/cmd_bar/06_undo_redo.js +41 -32
- package/dist/components/cmd_bar/07_pecker.js +70 -47
- package/dist/components/cmd_bar/common.js +8 -8
- package/dist/components/cmd_bar/index.js +20 -21
- package/dist/components/cmd_bar/r01_layout.js +201 -137
- package/dist/components/cmd_bar/r02_scan.js +63 -51
- package/dist/components/cmd_bar/r03_threshold.js +95 -69
- package/dist/components/cmd_bar/r04_submit.js +155 -133
- package/dist/components/cmd_bar/r05_submit_btn.js +39 -36
- package/dist/components/cmd_bar/r06_predict_btn.js +66 -52
- package/dist/components/cmd_bar/r07_wavelength_btn.js +35 -31
- package/dist/components/cmd_bar/r08_change_axes.js +65 -56
- package/dist/components/cmd_bar/r09_detector.js +38 -33
- package/dist/components/cmd_bar/tri_btn.js +37 -25
- package/dist/components/common/comps.js +5 -6
- package/dist/components/d3_line/index.js +2 -1
- package/dist/components/d3_line/line_focus.js +32 -34
- package/dist/components/d3_multi/index.js +2 -1
- package/dist/components/d3_multi/multi_focus.js +60 -37
- package/dist/components/d3_rect/index.js +2 -1
- package/dist/components/d3_rect/rect_focus.js +18 -20
- package/dist/components/forecast/comps.js +169 -132
- package/dist/components/forecast/ir_comps.js +88 -69
- package/dist/components/forecast/ir_viewer.js +35 -28
- package/dist/components/forecast/nmr_comps.js +105 -76
- package/dist/components/forecast/nmr_viewer.js +36 -29
- package/dist/components/forecast/section_loading.js +22 -17
- package/dist/components/forecast_viewer.js +19 -17
- package/dist/components/multi_jcamps_viewer.js +44 -38
- package/dist/components/panel/compare.js +92 -76
- package/dist/components/panel/cyclic_voltamery_data.js +171 -122
- package/dist/components/panel/graph_selection.js +113 -90
- package/dist/components/panel/index.js +43 -39
- package/dist/components/panel/info.js +203 -156
- package/dist/components/panel/multiplicity.js +85 -63
- package/dist/components/panel/multiplicity_coupling.js +36 -29
- package/dist/components/panel/multiplicity_select.js +20 -19
- package/dist/components/panel/peaks.js +78 -56
- package/dist/constants/action_type.js +2 -1
- package/dist/helpers/cfg.js +1 -2
- package/dist/helpers/chem.js +5 -13
- package/dist/helpers/converter.js +1 -2
- package/dist/helpers/extractParams.js +1 -2
- package/dist/helpers/extractPeaksEdit.js +3 -6
- package/dist/helpers/format.js +28 -63
- package/dist/helpers/init.js +5 -9
- package/dist/helpers/integration.js +1 -2
- package/dist/helpers/mount.js +1 -2
- package/dist/index.js +306 -276
- package/dist/layer_content.js +14 -14
- package/dist/layer_init.js +12 -11
- package/dist/layer_prism.js +83 -72
- package/dist/reducers/reducer_axes.js +2 -5
- package/dist/reducers/reducer_curve.js +8 -6
- package/dist/reducers/reducer_detector.js +1 -3
- package/dist/reducers/reducer_edit_peak.js +1 -3
- package/dist/reducers/reducer_forecast.js +1 -3
- package/dist/reducers/reducer_integration.js +1 -3
- package/dist/reducers/reducer_jcamp.js +5 -8
- package/dist/reducers/reducer_layout.js +1 -3
- package/dist/reducers/reducer_manager.js +1 -3
- package/dist/reducers/reducer_meta.js +1 -3
- package/dist/reducers/reducer_multiplicity.js +3 -3
- package/dist/reducers/reducer_scan.js +1 -3
- package/dist/reducers/reducer_shift.js +1 -3
- package/dist/reducers/reducer_simulation.js +1 -3
- package/dist/reducers/reducer_status.js +1 -3
- package/dist/reducers/reducer_submit.js +1 -3
- package/dist/reducers/reducer_threshold.js +199 -29
- package/dist/reducers/reducer_ui.js +1 -3
- package/dist/reducers/reducer_voltammetry.js +3 -7
- package/dist/reducers/reducer_wavelength.js +1 -3
- package/dist/sagas/saga_multi_entities.js +35 -14
- package/dist/sagas/saga_multiplicity.js +1 -2
- package/dist/third_party/jAnalyzer.js +1 -1
- package/package.json +18 -1
|
@@ -15,8 +15,8 @@ var _styles = require("@mui/styles");
|
|
|
15
15
|
var _material = require("@mui/material");
|
|
16
16
|
var _curve = require("../../actions/curve");
|
|
17
17
|
var _list_layout = require("../../constants/list_layout");
|
|
18
|
-
|
|
19
|
-
function _interopRequireWildcard(e, r) { if (!
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
20
20
|
/* eslint-disable react/function-component-definition, function-paren-newline,
|
|
21
21
|
react/require-default-props, react/no-unused-prop-types */
|
|
22
22
|
|
|
@@ -50,16 +50,15 @@ const styles = () => ({
|
|
|
50
50
|
overflowWrap: 'anywhere'
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
|
-
const GraphSelectionPanel =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
} = _ref;
|
|
53
|
+
const GraphSelectionPanel = ({
|
|
54
|
+
classes,
|
|
55
|
+
curveSt,
|
|
56
|
+
entityFileNames,
|
|
57
|
+
subLayoutsInfo,
|
|
58
|
+
layoutSt,
|
|
59
|
+
selectCurveAct,
|
|
60
|
+
toggleShowAllCurveAct
|
|
61
|
+
}) => {
|
|
63
62
|
let subLayoutValues = [];
|
|
64
63
|
if (subLayoutsInfo) {
|
|
65
64
|
subLayoutValues = Object.keys(subLayoutsInfo);
|
|
@@ -69,7 +68,7 @@ const GraphSelectionPanel = _ref => {
|
|
|
69
68
|
setSelectedSublayout(subLayoutValues[0]);
|
|
70
69
|
}, subLayoutValues);
|
|
71
70
|
if (!curveSt) {
|
|
72
|
-
return /*#__PURE__*/
|
|
71
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {});
|
|
73
72
|
}
|
|
74
73
|
const {
|
|
75
74
|
curveIdx,
|
|
@@ -77,7 +76,7 @@ const GraphSelectionPanel = _ref => {
|
|
|
77
76
|
isShowAllCurve
|
|
78
77
|
} = curveSt;
|
|
79
78
|
if (!listCurves) {
|
|
80
|
-
return /*#__PURE__*/
|
|
79
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {});
|
|
81
80
|
}
|
|
82
81
|
const onChange = idx => {
|
|
83
82
|
selectCurveAct(idx);
|
|
@@ -127,82 +126,106 @@ const GraphSelectionPanel = _ref => {
|
|
|
127
126
|
filename
|
|
128
127
|
};
|
|
129
128
|
});
|
|
130
|
-
return /*#__PURE__*/
|
|
131
|
-
"data-testid": "GraphSelectionPanel"
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
129
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Accordion, {
|
|
130
|
+
"data-testid": "GraphSelectionPanel",
|
|
131
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.AccordionSummary, {
|
|
132
|
+
expandIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandMore.default, {}),
|
|
133
|
+
className: (0, _classnames.default)(classes.panelSummary),
|
|
134
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
135
|
+
className: "txt-panel-header",
|
|
136
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
137
|
+
className: (0, _classnames.default)(classes.txtBadge, 'txt-sv-panel-title'),
|
|
138
|
+
children: "Graph selection"
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Divider, {}), layoutSt === _list_layout.LIST_LAYOUT.AIF ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
142
|
+
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
|
|
143
|
+
checked: isShowAllCurve,
|
|
144
|
+
onChange: onChangeSwitch
|
|
145
|
+
}),
|
|
146
|
+
label: "Show all curves"
|
|
147
|
+
}) : null, subLayoutValues && subLayoutValues.length > 1 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
148
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tabs, {
|
|
149
|
+
value: selectedSubLayout,
|
|
150
|
+
onChange: onChangeTabSubLayout,
|
|
151
|
+
children: subLayoutValues.map((subLayout, i) => {
|
|
152
|
+
let subLayoutName = '';
|
|
153
|
+
switch (subLayout.toUpperCase()) {
|
|
154
|
+
case 'G/MOL':
|
|
155
|
+
subLayoutName = 'MWD';
|
|
156
|
+
break;
|
|
157
|
+
case 'MILLILITERS':
|
|
158
|
+
subLayoutName = 'ELU';
|
|
159
|
+
break;
|
|
160
|
+
case 'INTENSITY':
|
|
161
|
+
subLayoutName = 'Chromatogram';
|
|
162
|
+
break;
|
|
163
|
+
case 'DEGREES CELSIUS':
|
|
164
|
+
subLayoutName = 'Temperature';
|
|
165
|
+
break;
|
|
166
|
+
default:
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tab, {
|
|
170
|
+
value: subLayout,
|
|
171
|
+
label: subLayoutName
|
|
172
|
+
}, i);
|
|
173
|
+
})
|
|
174
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.List, {
|
|
175
|
+
children: itemsSubLayout.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItem, {
|
|
176
|
+
onClick: () => onChange(item.idx),
|
|
177
|
+
className: (0, _classnames.default)(item.idx === curveIdx ? classes.curveSelected : classes.curveDefault) // eslint-disable-line
|
|
178
|
+
,
|
|
179
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
180
|
+
className: (0, _classnames.default)(classes.curve),
|
|
181
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
182
|
+
children: item.name
|
|
183
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
184
|
+
style: {
|
|
185
|
+
float: 'right',
|
|
186
|
+
width: '95%'
|
|
187
|
+
},
|
|
188
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("hr", {
|
|
189
|
+
className: (0, _classnames.default)(classes.line),
|
|
190
|
+
style: {
|
|
191
|
+
backgroundColor: item.color
|
|
192
|
+
}
|
|
193
|
+
}), item.filename !== '' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
194
|
+
children: ["File: ", item.filename]
|
|
195
|
+
}) : null // eslint-disable-line
|
|
196
|
+
]
|
|
197
|
+
})]
|
|
198
|
+
})
|
|
199
|
+
}, item.idx))
|
|
200
|
+
})]
|
|
201
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.List, {
|
|
202
|
+
children: items.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItem, {
|
|
203
|
+
onClick: () => onChange(item.idx),
|
|
204
|
+
className: (0, _classnames.default)(item.idx === curveIdx ? classes.curveSelected : classes.curveDefault) // eslint-disable-line
|
|
205
|
+
,
|
|
206
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
207
|
+
className: (0, _classnames.default)(classes.curve),
|
|
208
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
209
|
+
children: item.name
|
|
210
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
211
|
+
style: {
|
|
212
|
+
float: 'right',
|
|
213
|
+
width: '95%'
|
|
214
|
+
},
|
|
215
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("hr", {
|
|
216
|
+
className: (0, _classnames.default)(classes.line),
|
|
217
|
+
style: {
|
|
218
|
+
backgroundColor: item.color
|
|
219
|
+
}
|
|
220
|
+
}), item.filename !== '' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
221
|
+
children: ["File: ", item.filename]
|
|
222
|
+
}) : null // eslint-disable-line
|
|
223
|
+
]
|
|
224
|
+
})]
|
|
225
|
+
})
|
|
226
|
+
}, item.idx))
|
|
227
|
+
})]
|
|
228
|
+
});
|
|
206
229
|
};
|
|
207
230
|
const mapStateToProps = (state, props) => (
|
|
208
231
|
// eslint-disable-line
|
|
@@ -19,6 +19,7 @@ var _multiplicity = _interopRequireDefault(require("./multiplicity"));
|
|
|
19
19
|
var _cyclic_voltamery_data = _interopRequireDefault(require("./cyclic_voltamery_data"));
|
|
20
20
|
var _graph_selection = _interopRequireDefault(require("./graph_selection"));
|
|
21
21
|
var _cfg = _interopRequireDefault(require("../../helpers/cfg"));
|
|
22
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
23
|
/* eslint-disable react/prop-types, react/require-default-props */
|
|
23
24
|
|
|
24
25
|
const theme = (0, _styles.createTheme)({
|
|
@@ -97,45 +98,48 @@ class PanelViewer extends _react.default.Component {
|
|
|
97
98
|
listCurves
|
|
98
99
|
} = curveSt;
|
|
99
100
|
const hideGraphSelection = listCurves === false || listCurves === undefined;
|
|
100
|
-
return /*#__PURE__*/
|
|
101
|
-
className: (0, _classnames.default)(classes.panels)
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
101
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
102
|
+
className: (0, _classnames.default)(classes.panels),
|
|
103
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledEngineProvider, {
|
|
104
|
+
injectFirst: true,
|
|
105
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ThemeProvider, {
|
|
106
|
+
theme: theme,
|
|
107
|
+
children: [hideGraphSelection ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_graph_selection.default, {
|
|
108
|
+
jcampIdx: jcampIdx,
|
|
109
|
+
entityFileNames: entityFileNames,
|
|
110
|
+
expand: expand === 'graph',
|
|
111
|
+
onExapnd: onExapndGraphSelection,
|
|
112
|
+
subLayoutsInfo: subLayoutsInfo
|
|
113
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_info.default, {
|
|
114
|
+
feature: feature,
|
|
115
|
+
integration: integration,
|
|
116
|
+
editorOnly: editorOnly,
|
|
117
|
+
expand: expand === 'info',
|
|
118
|
+
molSvg: molSvg,
|
|
119
|
+
exactMass: exactMass,
|
|
120
|
+
onExapnd: onExapndInfo,
|
|
121
|
+
descriptions: descriptions,
|
|
122
|
+
canChangeDescription: canChangeDescription,
|
|
123
|
+
onDescriptionChanged: this.handleDescriptionChanged
|
|
124
|
+
}), _cfg.default.hidePanelPeak(layoutSt) ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_peaks.default, {
|
|
125
|
+
expand: expand === 'peak',
|
|
126
|
+
onExapnd: onExapndPeak
|
|
127
|
+
}), _cfg.default.hidePanelMpy(layoutSt) ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_multiplicity.default, {
|
|
128
|
+
expand: expand === 'mpy',
|
|
129
|
+
onExapnd: onExapndMpy
|
|
130
|
+
}), _cfg.default.hidePanelCompare(layoutSt) || listCurves.length > 1 ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_compare.default, {
|
|
131
|
+
expand: expand === 'compare',
|
|
132
|
+
onExapnd: onExapndCompare
|
|
133
|
+
}), _cfg.default.hidePanelCyclicVolta(layoutSt) ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_cyclic_voltamery_data.default, {
|
|
134
|
+
jcampIdx: jcampIdx,
|
|
135
|
+
feature: feature,
|
|
136
|
+
expand: expand === 'cyclicvolta',
|
|
137
|
+
onExapnd: onExapndCyclicVolta,
|
|
138
|
+
userManualLink: userManualLink ? userManualLink.cv : undefined
|
|
139
|
+
})]
|
|
140
|
+
})
|
|
141
|
+
})
|
|
142
|
+
});
|
|
139
143
|
}
|
|
140
144
|
}
|
|
141
145
|
const mapStateToProps = (state, _) => (
|