@complat/react-spectra-editor 1.7.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/LICENSE +21 -662
- package/README.md +5 -0
- package/dist/__tests__/fixtures/lc_ms_jcamp.js +2329 -0
- package/dist/__tests__/fixtures/lc_ms_jcamp_2.js +2874 -0
- package/dist/__tests__/fixtures/lc_ms_jcamp_mz_chemstation.js +3242 -0
- package/dist/__tests__/fixtures/lc_ms_jcamp_tic_chemstation.js +854 -0
- package/dist/__tests__/fixtures/lc_ms_jcamp_tic_neg.js +1233 -0
- package/dist/__tests__/fixtures/lc_ms_jcamp_tic_pos.js +1233 -0
- package/dist/__tests__/fixtures/lc_ms_jcamp_uvvis.js +48908 -0
- package/dist/__tests__/fixtures/lc_ms_jcamp_uvvis_chemstation.js +15424 -0
- package/dist/__tests__/units/components/cmd_bar/r05_submit_btn.test.js +158 -3
- package/dist/__tests__/units/components/d3_line_rect.test.js +85 -0
- package/dist/__tests__/units/components/d3_multi/multi_focus.test.js +43 -0
- package/dist/__tests__/units/components/hplc_viewer.test.js +123 -0
- package/dist/__tests__/units/components/panel/info.test.js +55 -15
- package/dist/__tests__/units/features/lc-ms/parsing/lcmsCategory.test.js +73 -0
- package/dist/__tests__/units/features/lc-ms/submit/peaks.test.js +310 -0
- package/dist/actions/curve.js +5 -2
- package/dist/actions/hplc_ms.js +66 -0
- package/dist/actions/integration.js +17 -2
- package/dist/actions/ui.js +39 -11
- package/dist/app.js +21 -8
- package/dist/components/cmd_bar/01_viewer.js +15 -11
- package/dist/components/cmd_bar/03_peak.js +25 -16
- package/dist/components/cmd_bar/04_integration.js +116 -17
- package/dist/components/cmd_bar/08_peak_group.js +83 -0
- package/dist/components/cmd_bar/collapsible_toolbar_group.js +101 -0
- package/dist/components/cmd_bar/common.js +4 -3
- package/dist/components/cmd_bar/index.js +76 -18
- package/dist/components/cmd_bar/r01_layout.js +6 -0
- package/dist/components/cmd_bar/r02_scan.js +15 -11
- package/dist/components/cmd_bar/r03_threshold.js +19 -3
- package/dist/components/cmd_bar/r04_submit.js +61 -6
- package/dist/components/cmd_bar/r05_submit_btn.js +60 -13
- package/dist/components/cmd_bar/r06_predict_btn.js +4 -4
- package/dist/components/cmd_bar/r07_wavelength_btn.js +10 -9
- package/dist/components/cmd_bar/r09_detector.js +2 -2
- package/dist/components/cmd_bar/tri_btn.js +4 -1
- package/dist/components/common/draw.js +6 -5
- package/dist/components/d3_line/index.js +70 -15
- package/dist/components/d3_line/line_focus.js +104 -67
- package/dist/components/d3_line_rect/index.js +836 -0
- package/dist/components/d3_line_rect/line_focus.js +526 -0
- package/dist/components/d3_line_rect/multi_focus.js +433 -0
- package/dist/components/d3_line_rect/rect_focus.js +247 -0
- package/dist/components/d3_multi/index.js +154 -163
- package/dist/components/d3_multi/multi_focus.js +117 -68
- package/dist/components/d3_rect/index.js +6 -0
- package/dist/components/d3_rect/rect_focus.js +17 -5
- package/dist/components/hplc_viewer.js +169 -0
- package/dist/components/lc_ms_uv_tools_bar.js +175 -0
- package/dist/components/multi_jcamps_viewer.js +17 -5
- package/dist/components/panel/compare.js +84 -62
- package/dist/components/panel/cyclic_voltamery_data.js +15 -14
- package/dist/components/panel/graph_selection.js +32 -30
- package/dist/components/panel/index.js +28 -22
- package/dist/components/panel/info.js +75 -26
- package/dist/constants/action_type.js +23 -2
- package/dist/constants/list_graph.js +16 -0
- package/dist/constants/list_layout.js +2 -1
- package/dist/constants/list_ui.js +5 -2
- package/dist/features/lc-ms/entities/extractEntityLCMS.js +187 -0
- package/dist/features/lc-ms/parsing/chemstation.js +108 -0
- package/dist/features/lc-ms/parsing/index.js +46 -0
- package/dist/features/lc-ms/parsing/lcmsCategory.js +44 -0
- package/dist/features/lc-ms/parsing/lcmsJcampInfo.js +18 -0
- package/dist/features/lc-ms/parsing/lcmsMsPage.js +241 -0
- package/dist/features/lc-ms/parsing/pageValue.js +27 -0
- package/dist/features/lc-ms/submit/index.js +24 -0
- package/dist/features/lc-ms/submit/peaks.js +66 -0
- package/dist/features/lc-ms/ui/wavelengthSelect.js +54 -0
- package/dist/fn.js +4 -1
- package/dist/helpers/brush.js +74 -19
- package/dist/helpers/calc.js +4 -2
- package/dist/helpers/cfg.js +5 -4
- package/dist/helpers/chem.js +449 -71
- package/dist/helpers/compass.js +181 -17
- package/dist/helpers/extractEntityLCMS.js +24 -0
- package/dist/helpers/extractParams.js +118 -33
- package/dist/helpers/extractPeaksEdit.js +29 -9
- package/dist/helpers/format.js +189 -4
- package/dist/helpers/init.js +25 -5
- package/dist/helpers/integration.js +130 -17
- package/dist/helpers/integration_draft.js +43 -0
- package/dist/helpers/integration_focus.js +155 -0
- package/dist/helpers/integration_jcamp.js +68 -0
- package/dist/helpers/integration_split.js +202 -0
- package/dist/helpers/mount.js +8 -1
- package/dist/helpers/sweep.js +39 -0
- package/dist/index.js +284 -26
- package/dist/layer_content.js +17 -3
- package/dist/layer_init.js +124 -14
- package/dist/layer_prism.js +31 -5
- package/dist/reducers/index.js +3 -1
- package/dist/reducers/reducer_curve.js +54 -36
- package/dist/reducers/reducer_hplc_ms/hydrate.js +289 -0
- package/dist/reducers/reducer_hplc_ms/index.js +122 -0
- package/dist/reducers/reducer_hplc_ms/persistence.js +74 -0
- package/dist/reducers/reducer_hplc_ms/tic.js +70 -0
- package/dist/reducers/reducer_hplc_ms/utils.js +70 -0
- package/dist/reducers/reducer_hplc_ms/uvvis.js +377 -0
- package/dist/reducers/reducer_integration.js +265 -7
- package/dist/reducers/reducer_layout.js +1 -1
- package/dist/reducers/reducer_submit.js +2 -1
- package/dist/reducers/reducer_ui.js +149 -13
- package/dist/reducers/undo_redo_config.js +2 -2
- package/dist/sagas/saga_lcms_ui.js +85 -0
- package/dist/sagas/saga_ui.js +177 -74
- package/dist/setupTests.js +5 -5
- package/package.json +10 -7
|
@@ -11,9 +11,12 @@ var _redux = require("redux");
|
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _chem = require("../../helpers/chem");
|
|
13
13
|
var _format = _interopRequireDefault(require("../../helpers/format"));
|
|
14
|
+
var _cfg = _interopRequireDefault(require("../../helpers/cfg"));
|
|
14
15
|
var _manager = require("../../actions/manager");
|
|
15
16
|
var _ui = require("../../actions/ui");
|
|
17
|
+
var _integration = require("../../actions/integration");
|
|
16
18
|
var _list_ui = require("../../constants/list_ui");
|
|
19
|
+
var _list_graph = require("../../constants/list_graph");
|
|
17
20
|
var _cyclic_voltammetry = require("../../actions/cyclic_voltammetry");
|
|
18
21
|
var _multi_focus = _interopRequireDefault(require("./multi_focus"));
|
|
19
22
|
var _draw = require("../common/draw");
|
|
@@ -31,9 +34,12 @@ class ViewerMulti extends _react.default.Component {
|
|
|
31
34
|
entities,
|
|
32
35
|
clickUiTargetAct,
|
|
33
36
|
selectUiSweepAct,
|
|
34
|
-
scrollUiWheelAct
|
|
37
|
+
scrollUiWheelAct,
|
|
38
|
+
splitIntegrationAct,
|
|
39
|
+
addVisualSplitLineAct,
|
|
40
|
+
removeVisualSplitLineAct
|
|
35
41
|
} = this.props;
|
|
36
|
-
this.rootKlass =
|
|
42
|
+
this.rootKlass = `.${_list_graph.LIST_ROOT_SVG_GRAPH.LINE}`;
|
|
37
43
|
this.containerRef = /*#__PURE__*/_react.default.createRef();
|
|
38
44
|
this.currentSize = null;
|
|
39
45
|
this.resizeObserver = null;
|
|
@@ -43,85 +49,18 @@ class ViewerMulti extends _react.default.Component {
|
|
|
43
49
|
entities,
|
|
44
50
|
clickUiTargetAct,
|
|
45
51
|
selectUiSweepAct,
|
|
46
|
-
scrollUiWheelAct
|
|
52
|
+
scrollUiWheelAct,
|
|
53
|
+
splitIntegrationAct,
|
|
54
|
+
addVisualSplitLineAct,
|
|
55
|
+
removeVisualSplitLineAct
|
|
47
56
|
});
|
|
48
57
|
this.normChange = this.normChange.bind(this);
|
|
49
58
|
this.handleResize = this.handleResize.bind(this);
|
|
59
|
+
this.syncFocusActions = this.syncFocusActions.bind(this);
|
|
50
60
|
}
|
|
51
61
|
componentDidMount() {
|
|
52
|
-
this.renderChart(this.props, true);
|
|
53
62
|
this.setupResizeObserver();
|
|
54
|
-
|
|
55
|
-
curveSt,
|
|
56
|
-
seed,
|
|
57
|
-
peak,
|
|
58
|
-
cLabel,
|
|
59
|
-
xLabel,
|
|
60
|
-
yLabel,
|
|
61
|
-
feature,
|
|
62
|
-
tTrEndPts,
|
|
63
|
-
tSfPeaks,
|
|
64
|
-
editPeakSt,
|
|
65
|
-
layoutSt,
|
|
66
|
-
sweepExtentSt,
|
|
67
|
-
isUiNoBrushSt,
|
|
68
|
-
isHidden,
|
|
69
|
-
resetAllAct,
|
|
70
|
-
cyclicvoltaSt,
|
|
71
|
-
integationSt,
|
|
72
|
-
mtplySt,
|
|
73
|
-
axesUnitsSt
|
|
74
|
-
} = this.props;
|
|
75
|
-
(0, _draw.drawDestroy)(this.rootKlass);
|
|
76
|
-
resetAllAct(feature);
|
|
77
|
-
let xxLabel = xLabel;
|
|
78
|
-
let yyLabel = yLabel;
|
|
79
|
-
if (axesUnitsSt) {
|
|
80
|
-
const {
|
|
81
|
-
curveIdx
|
|
82
|
-
} = curveSt;
|
|
83
|
-
const {
|
|
84
|
-
axes
|
|
85
|
-
} = axesUnitsSt;
|
|
86
|
-
let selectedAxes = axes[curveIdx];
|
|
87
|
-
if (!selectedAxes) {
|
|
88
|
-
selectedAxes = {
|
|
89
|
-
xUnit: '',
|
|
90
|
-
yUnit: ''
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
const {
|
|
94
|
-
xUnit,
|
|
95
|
-
yUnit
|
|
96
|
-
} = selectedAxes;
|
|
97
|
-
xxLabel = xUnit === '' ? xLabel : xUnit;
|
|
98
|
-
yyLabel = yUnit === '' ? yLabel : yUnit;
|
|
99
|
-
}
|
|
100
|
-
if (cyclicvoltaSt && cyclicvoltaSt.useCurrentDensity) {
|
|
101
|
-
const areaUnit = cyclicvoltaSt.areaUnit || 'cm²';
|
|
102
|
-
const baseUnit = /mA/i.test(String(yyLabel)) ? 'mA' : 'A';
|
|
103
|
-
yyLabel = `Current density in ${baseUnit}/${areaUnit}`;
|
|
104
|
-
}
|
|
105
|
-
const filterSeed = seed;
|
|
106
|
-
const filterPeak = peak;
|
|
107
|
-
(0, _draw.drawMain)(this.rootKlass, W, H);
|
|
108
|
-
this.focus.create({
|
|
109
|
-
curveSt,
|
|
110
|
-
filterSeed,
|
|
111
|
-
filterPeak,
|
|
112
|
-
tTrEndPts,
|
|
113
|
-
tSfPeaks,
|
|
114
|
-
editPeakSt,
|
|
115
|
-
layoutSt,
|
|
116
|
-
sweepExtentSt,
|
|
117
|
-
isUiNoBrushSt,
|
|
118
|
-
cyclicvoltaSt,
|
|
119
|
-
integationSt,
|
|
120
|
-
mtplySt
|
|
121
|
-
});
|
|
122
|
-
(0, _draw.drawLabel)(this.rootKlass, cLabel, xxLabel, yyLabel);
|
|
123
|
-
(0, _draw.drawDisplay)(this.rootKlass, isHidden);
|
|
124
|
-
(0, _draw.drawArrowOnCurve)(this.rootKlass, isHidden);
|
|
63
|
+
this.mountChart(this.props, true);
|
|
125
64
|
}
|
|
126
65
|
componentDidUpdate(prevProps) {
|
|
127
66
|
const {
|
|
@@ -137,65 +76,50 @@ class ViewerMulti extends _react.default.Component {
|
|
|
137
76
|
editPeakSt,
|
|
138
77
|
layoutSt,
|
|
139
78
|
sweepExtentSt,
|
|
79
|
+
isUiAddIntgSt,
|
|
80
|
+
isUiSplitIntgSt,
|
|
81
|
+
isUiVisualSplitIntgSt,
|
|
140
82
|
isUiNoBrushSt,
|
|
141
83
|
isHidden,
|
|
142
84
|
cyclicvoltaSt,
|
|
143
|
-
|
|
85
|
+
integrationSt,
|
|
144
86
|
mtplySt,
|
|
145
|
-
axesUnitsSt
|
|
87
|
+
axesUnitsSt,
|
|
88
|
+
uiSt
|
|
146
89
|
} = this.props;
|
|
90
|
+
this.syncFocusActions();
|
|
147
91
|
this.normChange(prevProps);
|
|
148
|
-
let xxLabel = xLabel;
|
|
149
|
-
let yyLabel = yLabel;
|
|
150
|
-
if (axesUnitsSt) {
|
|
151
|
-
const {
|
|
152
|
-
curveIdx
|
|
153
|
-
} = curveSt;
|
|
154
|
-
const {
|
|
155
|
-
axes
|
|
156
|
-
} = axesUnitsSt;
|
|
157
|
-
let selectedAxes = axes[curveIdx];
|
|
158
|
-
if (!selectedAxes) {
|
|
159
|
-
selectedAxes = {
|
|
160
|
-
xUnit: '',
|
|
161
|
-
yUnit: ''
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
const {
|
|
165
|
-
xUnit,
|
|
166
|
-
yUnit
|
|
167
|
-
} = selectedAxes;
|
|
168
|
-
xxLabel = xUnit === '' ? xLabel : xUnit;
|
|
169
|
-
yyLabel = yUnit === '' ? yLabel : yUnit;
|
|
170
|
-
}
|
|
171
|
-
if (cyclicvoltaSt && cyclicvoltaSt.useCurrentDensity) {
|
|
172
|
-
const areaUnit = cyclicvoltaSt.areaUnit || 'cm²';
|
|
173
|
-
const baseUnit = /mA/i.test(String(yyLabel)) ? 'mA' : 'A';
|
|
174
|
-
yyLabel = `Current density in ${baseUnit}/${areaUnit}`;
|
|
175
|
-
}
|
|
176
|
-
const filterSeed = seed;
|
|
177
|
-
const filterPeak = peak;
|
|
178
92
|
if (_format.default.isCyclicVoltaLayout(layoutSt)) {
|
|
179
93
|
this.handleResize();
|
|
180
94
|
}
|
|
95
|
+
const hasRelevantChange = prevProps.entities !== entities || prevProps.curveSt !== curveSt || prevProps.seed !== seed || prevProps.peak !== peak || prevProps.tTrEndPts !== tTrEndPts || prevProps.tSfPeaks !== tSfPeaks || prevProps.editPeakSt !== editPeakSt || prevProps.layoutSt !== layoutSt || prevProps.sweepExtentSt !== sweepExtentSt || prevProps.isUiNoBrushSt !== isUiNoBrushSt || prevProps.isHidden !== isHidden || prevProps.cyclicvoltaSt !== cyclicvoltaSt || prevProps.integrationSt !== integrationSt || prevProps.mtplySt !== mtplySt || prevProps.axesUnitsSt !== axesUnitsSt || prevProps.uiSt !== uiSt || prevProps.cLabel !== cLabel || prevProps.xLabel !== xLabel || prevProps.yLabel !== yLabel;
|
|
96
|
+
if (!hasRelevantChange) return;
|
|
97
|
+
const {
|
|
98
|
+
xxLabel,
|
|
99
|
+
yyLabel
|
|
100
|
+
} = this.resolveAxisLabels(this.props);
|
|
181
101
|
this.focus.update({
|
|
182
102
|
entities,
|
|
183
103
|
curveSt,
|
|
184
|
-
filterSeed,
|
|
185
|
-
filterPeak,
|
|
104
|
+
filterSeed: seed,
|
|
105
|
+
filterPeak: peak,
|
|
186
106
|
tTrEndPts,
|
|
187
107
|
tSfPeaks,
|
|
188
108
|
editPeakSt,
|
|
189
109
|
layoutSt,
|
|
190
110
|
sweepExtentSt,
|
|
111
|
+
isUiAddIntgSt,
|
|
112
|
+
isUiSplitIntgSt,
|
|
113
|
+
isUiVisualSplitIntgSt,
|
|
191
114
|
isUiNoBrushSt,
|
|
192
115
|
cyclicvoltaSt,
|
|
193
|
-
|
|
194
|
-
mtplySt
|
|
116
|
+
integrationSt,
|
|
117
|
+
mtplySt,
|
|
118
|
+
uiSt
|
|
195
119
|
});
|
|
196
120
|
(0, _draw.drawLabel)(this.rootKlass, cLabel, xxLabel, yyLabel);
|
|
197
121
|
(0, _draw.drawDisplay)(this.rootKlass, isHidden);
|
|
198
|
-
(0, _draw.drawArrowOnCurve)(this.rootKlass, isHidden);
|
|
122
|
+
(0, _draw.drawArrowOnCurve)(this.rootKlass, isHidden || !_format.default.isAIFLayout(layoutSt));
|
|
199
123
|
}
|
|
200
124
|
componentWillUnmount() {
|
|
201
125
|
(0, _draw.drawDestroy)(this.rootKlass);
|
|
@@ -209,7 +133,7 @@ class ViewerMulti extends _react.default.Component {
|
|
|
209
133
|
const size = this.getContainerSize();
|
|
210
134
|
if (!size) return;
|
|
211
135
|
if (!this.currentSize || size.width !== this.currentSize.width || size.height !== this.currentSize.height) {
|
|
212
|
-
this.
|
|
136
|
+
this.mountChart(this.props, false);
|
|
213
137
|
}
|
|
214
138
|
}
|
|
215
139
|
getContainerSize() {
|
|
@@ -241,12 +165,69 @@ class ViewerMulti extends _react.default.Component {
|
|
|
241
165
|
this.resizeObserver = new ResizeObserver(this.handleResize);
|
|
242
166
|
this.resizeObserver.observe(this.containerRef.current);
|
|
243
167
|
}
|
|
168
|
+
syncFocusActions() {
|
|
169
|
+
if (!this.focus) return;
|
|
170
|
+
const {
|
|
171
|
+
clickUiTargetAct,
|
|
172
|
+
selectUiSweepAct,
|
|
173
|
+
scrollUiWheelAct,
|
|
174
|
+
splitIntegrationAct,
|
|
175
|
+
addVisualSplitLineAct,
|
|
176
|
+
removeVisualSplitLineAct
|
|
177
|
+
} = this.props;
|
|
178
|
+
Object.assign(this.focus, {
|
|
179
|
+
clickUiTargetAct,
|
|
180
|
+
selectUiSweepAct,
|
|
181
|
+
scrollUiWheelAct,
|
|
182
|
+
splitIntegrationAct,
|
|
183
|
+
addVisualSplitLineAct,
|
|
184
|
+
removeVisualSplitLineAct
|
|
185
|
+
});
|
|
186
|
+
}
|
|
244
187
|
teardownResizeObserver() {
|
|
245
188
|
if (this.resizeObserver) {
|
|
246
189
|
this.resizeObserver.disconnect();
|
|
247
190
|
this.resizeObserver = null;
|
|
248
191
|
}
|
|
249
192
|
}
|
|
193
|
+
resolveAxisLabels(props) {
|
|
194
|
+
const {
|
|
195
|
+
curveSt,
|
|
196
|
+
xLabel,
|
|
197
|
+
yLabel,
|
|
198
|
+
axesUnitsSt,
|
|
199
|
+
cyclicvoltaSt
|
|
200
|
+
} = props;
|
|
201
|
+
let xxLabel = xLabel;
|
|
202
|
+
let yyLabel = yLabel;
|
|
203
|
+
if (axesUnitsSt) {
|
|
204
|
+
const {
|
|
205
|
+
curveIdx
|
|
206
|
+
} = curveSt;
|
|
207
|
+
const {
|
|
208
|
+
axes
|
|
209
|
+
} = axesUnitsSt;
|
|
210
|
+
const selectedAxes = axes[curveIdx] || {
|
|
211
|
+
xUnit: '',
|
|
212
|
+
yUnit: ''
|
|
213
|
+
};
|
|
214
|
+
const {
|
|
215
|
+
xUnit,
|
|
216
|
+
yUnit
|
|
217
|
+
} = selectedAxes;
|
|
218
|
+
xxLabel = xUnit === '' ? xLabel : xUnit;
|
|
219
|
+
yyLabel = yUnit === '' ? yLabel : yUnit;
|
|
220
|
+
}
|
|
221
|
+
if (cyclicvoltaSt && cyclicvoltaSt.useCurrentDensity) {
|
|
222
|
+
const areaUnit = cyclicvoltaSt.areaUnit || 'cm²';
|
|
223
|
+
const baseUnit = /mA/i.test(String(yyLabel)) ? 'mA' : 'A';
|
|
224
|
+
yyLabel = `Current density in ${baseUnit}/${areaUnit}`;
|
|
225
|
+
}
|
|
226
|
+
return {
|
|
227
|
+
xxLabel,
|
|
228
|
+
yyLabel
|
|
229
|
+
};
|
|
230
|
+
}
|
|
250
231
|
normChange(prevProps) {
|
|
251
232
|
const {
|
|
252
233
|
feature,
|
|
@@ -258,31 +239,50 @@ class ViewerMulti extends _react.default.Component {
|
|
|
258
239
|
resetAllAct(feature);
|
|
259
240
|
}
|
|
260
241
|
}
|
|
261
|
-
|
|
242
|
+
createMultiFocus(size, props) {
|
|
243
|
+
const {
|
|
244
|
+
entities,
|
|
245
|
+
clickUiTargetAct,
|
|
246
|
+
selectUiSweepAct,
|
|
247
|
+
scrollUiWheelAct,
|
|
248
|
+
splitIntegrationAct,
|
|
249
|
+
addVisualSplitLineAct,
|
|
250
|
+
removeVisualSplitLineAct
|
|
251
|
+
} = props;
|
|
252
|
+
return new _multi_focus.default({
|
|
253
|
+
W: size.width,
|
|
254
|
+
H: size.height,
|
|
255
|
+
entities,
|
|
256
|
+
clickUiTargetAct,
|
|
257
|
+
selectUiSweepAct,
|
|
258
|
+
scrollUiWheelAct,
|
|
259
|
+
splitIntegrationAct,
|
|
260
|
+
addVisualSplitLineAct,
|
|
261
|
+
removeVisualSplitLineAct
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
mountChart(props, shouldReset = false) {
|
|
262
265
|
const {
|
|
263
266
|
curveSt,
|
|
264
267
|
seed,
|
|
265
268
|
peak,
|
|
266
269
|
cLabel,
|
|
267
|
-
xLabel,
|
|
268
|
-
yLabel,
|
|
269
270
|
feature,
|
|
270
271
|
tTrEndPts,
|
|
271
272
|
tSfPeaks,
|
|
272
273
|
editPeakSt,
|
|
273
274
|
layoutSt,
|
|
274
275
|
sweepExtentSt,
|
|
276
|
+
isUiAddIntgSt,
|
|
277
|
+
isUiSplitIntgSt,
|
|
278
|
+
isUiVisualSplitIntgSt,
|
|
275
279
|
isUiNoBrushSt,
|
|
276
280
|
isHidden,
|
|
277
281
|
resetAllAct,
|
|
278
282
|
cyclicvoltaSt,
|
|
279
|
-
|
|
283
|
+
integrationSt,
|
|
280
284
|
mtplySt,
|
|
281
|
-
|
|
282
|
-
entities,
|
|
283
|
-
clickUiTargetAct,
|
|
284
|
-
selectUiSweepAct,
|
|
285
|
-
scrollUiWheelAct
|
|
285
|
+
uiSt
|
|
286
286
|
} = props;
|
|
287
287
|
const size = this.getTargetSize(layoutSt);
|
|
288
288
|
this.currentSize = size;
|
|
@@ -290,57 +290,34 @@ class ViewerMulti extends _react.default.Component {
|
|
|
290
290
|
if (shouldReset) {
|
|
291
291
|
resetAllAct(feature);
|
|
292
292
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
const {
|
|
300
|
-
axes
|
|
301
|
-
} = axesUnitsSt;
|
|
302
|
-
let selectedAxes = axes[curveIdx];
|
|
303
|
-
if (!selectedAxes) {
|
|
304
|
-
selectedAxes = {
|
|
305
|
-
xUnit: '',
|
|
306
|
-
yUnit: ''
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
const {
|
|
310
|
-
xUnit,
|
|
311
|
-
yUnit
|
|
312
|
-
} = selectedAxes;
|
|
313
|
-
xxLabel = xUnit === '' ? xLabel : xUnit;
|
|
314
|
-
yyLabel = yUnit === '' ? yLabel : yUnit;
|
|
315
|
-
}
|
|
316
|
-
const filterSeed = seed;
|
|
317
|
-
const filterPeak = peak;
|
|
318
|
-
this.focus = new _multi_focus.default({
|
|
319
|
-
W: size.width,
|
|
320
|
-
H: size.height,
|
|
321
|
-
entities,
|
|
322
|
-
clickUiTargetAct,
|
|
323
|
-
selectUiSweepAct,
|
|
324
|
-
scrollUiWheelAct
|
|
325
|
-
});
|
|
293
|
+
const {
|
|
294
|
+
xxLabel,
|
|
295
|
+
yyLabel
|
|
296
|
+
} = this.resolveAxisLabels(props);
|
|
297
|
+
this.focus = this.createMultiFocus(size, props);
|
|
298
|
+
this.syncFocusActions();
|
|
326
299
|
(0, _draw.drawMain)(this.rootKlass, size.width, size.height);
|
|
327
300
|
this.focus.create({
|
|
328
301
|
curveSt,
|
|
329
|
-
filterSeed,
|
|
330
|
-
filterPeak,
|
|
302
|
+
filterSeed: seed,
|
|
303
|
+
filterPeak: peak,
|
|
331
304
|
tTrEndPts,
|
|
332
305
|
tSfPeaks,
|
|
333
306
|
editPeakSt,
|
|
334
307
|
layoutSt,
|
|
335
308
|
sweepExtentSt,
|
|
309
|
+
isUiAddIntgSt,
|
|
310
|
+
isUiSplitIntgSt,
|
|
311
|
+
isUiVisualSplitIntgSt,
|
|
336
312
|
isUiNoBrushSt,
|
|
337
313
|
cyclicvoltaSt,
|
|
338
|
-
|
|
339
|
-
mtplySt
|
|
314
|
+
integrationSt,
|
|
315
|
+
mtplySt,
|
|
316
|
+
uiSt
|
|
340
317
|
});
|
|
341
318
|
(0, _draw.drawLabel)(this.rootKlass, cLabel, xxLabel, yyLabel);
|
|
342
319
|
(0, _draw.drawDisplay)(this.rootKlass, isHidden);
|
|
343
|
-
(0, _draw.drawArrowOnCurve)(this.rootKlass, isHidden);
|
|
320
|
+
(0, _draw.drawArrowOnCurve)(this.rootKlass, isHidden || !_format.default.isAIFLayout(layoutSt));
|
|
344
321
|
}
|
|
345
322
|
render() {
|
|
346
323
|
const {
|
|
@@ -348,7 +325,7 @@ class ViewerMulti extends _react.default.Component {
|
|
|
348
325
|
} = this.props;
|
|
349
326
|
const isCyclicVolta = _format.default.isCyclicVoltaLayout(layoutSt);
|
|
350
327
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
351
|
-
className:
|
|
328
|
+
className: _list_graph.LIST_ROOT_SVG_GRAPH.LINE,
|
|
352
329
|
ref: this.containerRef,
|
|
353
330
|
style: isCyclicVolta ? {
|
|
354
331
|
height: '100%'
|
|
@@ -358,6 +335,7 @@ class ViewerMulti extends _react.default.Component {
|
|
|
358
335
|
}
|
|
359
336
|
const mapStateToProps = (state, props) => ({
|
|
360
337
|
curveSt: state.curve,
|
|
338
|
+
uiSt: state.ui,
|
|
361
339
|
seed: (0, _chem.Topic2Seed)(state, props),
|
|
362
340
|
peak: (0, _chem.Feature2Peak)(state, props),
|
|
363
341
|
tTrEndPts: (0, _chem.ToThresEndPts)(state, props),
|
|
@@ -365,10 +343,13 @@ const mapStateToProps = (state, props) => ({
|
|
|
365
343
|
editPeakSt: state.editPeak.present,
|
|
366
344
|
layoutSt: state.layout,
|
|
367
345
|
sweepExtentSt: state.ui.sweepExtent,
|
|
346
|
+
isUiAddIntgSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.INTEGRATION_ADD,
|
|
347
|
+
isUiSplitIntgSt: _cfg.default.showIntegSplitTools(state.layout) && state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.INTEGRATION_SPLIT,
|
|
348
|
+
isUiVisualSplitIntgSt: _cfg.default.showIntegSplitTools(state.layout) && state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.INTEGRATION_VISUAL_SPLIT,
|
|
368
349
|
isUiNoBrushSt: _list_ui.LIST_NON_BRUSH_TYPES.indexOf(state.ui.sweepType) < 0,
|
|
369
350
|
cyclicvoltaSt: state.cyclicvolta,
|
|
370
351
|
maxminPeakSt: (0, _chem.Feature2MaxMinPeak)(state, props),
|
|
371
|
-
|
|
352
|
+
integrationSt: state.integration.present,
|
|
372
353
|
mtplySt: state.multiplicity.present,
|
|
373
354
|
axesUnitsSt: state.axesUnits
|
|
374
355
|
});
|
|
@@ -377,12 +358,16 @@ const mapDispatchToProps = dispatch => (0, _redux.bindActionCreators)({
|
|
|
377
358
|
clickUiTargetAct: _ui.clickUiTarget,
|
|
378
359
|
selectUiSweepAct: _ui.selectUiSweep,
|
|
379
360
|
scrollUiWheelAct: _ui.scrollUiWheel,
|
|
361
|
+
splitIntegrationAct: _integration.splitIntegration,
|
|
362
|
+
addVisualSplitLineAct: _integration.addVisualSplitLine,
|
|
363
|
+
removeVisualSplitLineAct: _integration.removeVisualSplitLine,
|
|
380
364
|
addNewCylicVoltaPairPeakAct: _cyclic_voltammetry.addNewCylicVoltaPairPeak,
|
|
381
365
|
addCylicVoltaMaxPeakAct: _cyclic_voltammetry.addCylicVoltaMaxPeak,
|
|
382
366
|
addCylicVoltaMinPeakAct: _cyclic_voltammetry.addCylicVoltaMinPeak
|
|
383
367
|
}, dispatch);
|
|
384
368
|
ViewerMulti.propTypes = {
|
|
385
369
|
curveSt: _propTypes.default.object.isRequired,
|
|
370
|
+
uiSt: _propTypes.default.object.isRequired,
|
|
386
371
|
entities: _propTypes.default.array.isRequired,
|
|
387
372
|
seed: _propTypes.default.array.isRequired,
|
|
388
373
|
peak: _propTypes.default.array.isRequired,
|
|
@@ -393,14 +378,20 @@ ViewerMulti.propTypes = {
|
|
|
393
378
|
tSfPeaks: _propTypes.default.array.isRequired,
|
|
394
379
|
editPeakSt: _propTypes.default.object.isRequired,
|
|
395
380
|
layoutSt: _propTypes.default.string.isRequired,
|
|
396
|
-
|
|
381
|
+
integrationSt: _propTypes.default.object.isRequired,
|
|
397
382
|
mtplySt: _propTypes.default.object.isRequired,
|
|
398
383
|
sweepExtentSt: _propTypes.default.object.isRequired,
|
|
384
|
+
isUiAddIntgSt: _propTypes.default.bool.isRequired,
|
|
385
|
+
isUiSplitIntgSt: _propTypes.default.bool.isRequired,
|
|
386
|
+
isUiVisualSplitIntgSt: _propTypes.default.bool.isRequired,
|
|
399
387
|
isUiNoBrushSt: _propTypes.default.bool.isRequired,
|
|
400
388
|
resetAllAct: _propTypes.default.func.isRequired,
|
|
401
389
|
clickUiTargetAct: _propTypes.default.func.isRequired,
|
|
402
390
|
selectUiSweepAct: _propTypes.default.func.isRequired,
|
|
403
391
|
scrollUiWheelAct: _propTypes.default.func.isRequired,
|
|
392
|
+
splitIntegrationAct: _propTypes.default.func.isRequired,
|
|
393
|
+
addVisualSplitLineAct: _propTypes.default.func.isRequired,
|
|
394
|
+
removeVisualSplitLineAct: _propTypes.default.func.isRequired,
|
|
404
395
|
isHidden: _propTypes.default.bool,
|
|
405
396
|
cyclicvoltaSt: _propTypes.default.object.isRequired,
|
|
406
397
|
maxminPeakSt: _propTypes.default.object,
|