@complat/react-spectra-editor 0.10.14-beta.2 → 0.10.14-beta.3
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/actions/curve.js +25 -0
- package/dist/actions/cyclic_voltammetry.js +89 -0
- package/dist/actions/threshold.js +18 -2
- package/dist/actions/ui.js +10 -2
- package/dist/actions/wavelength.js +2 -2
- package/dist/app.js +13 -1
- package/dist/components/cmd_bar/03_peak.js +39 -5
- package/dist/components/cmd_bar/07_pecker.js +141 -0
- package/dist/components/cmd_bar/index.js +13 -4
- package/dist/components/cmd_bar/r01_layout.js +9 -0
- package/dist/components/cmd_bar/r05_submit_btn.js +13 -6
- package/dist/components/cmd_bar/r07_wavelength_btn.js +1 -1
- package/dist/components/d3_line/index.js +6 -1
- package/dist/components/d3_line/line_focus.js +4 -2
- package/dist/components/d3_multi/index.js +240 -0
- package/dist/components/d3_multi/multi_focus.js +550 -0
- package/dist/components/forecast/comps.js +1 -1
- package/dist/components/multi_jcamps_viewer.js +185 -0
- package/dist/components/panel/cyclic_voltamery_data.js +408 -0
- package/dist/components/panel/graph_selection.js +184 -0
- package/dist/components/panel/index.js +22 -3
- package/dist/components/panel/info.js +1 -1
- package/dist/constants/action_type.js +25 -2
- package/dist/constants/list_layout.js +2 -1
- package/dist/constants/list_ui.js +8 -2
- package/dist/helpers/calc.js +3 -0
- package/dist/helpers/cfg.js +11 -1
- package/dist/helpers/chem.js +170 -15
- package/dist/helpers/compass.js +77 -17
- package/dist/helpers/converter.js +37 -5
- package/dist/helpers/format.js +15 -2
- package/dist/helpers/mount.js +5 -2
- package/dist/index.js +43 -5
- package/dist/layer_init.js +57 -14
- package/dist/reducers/index.js +11 -1
- package/dist/reducers/reducer_curve.js +60 -0
- package/dist/reducers/reducer_threshold.js +7 -1
- package/dist/reducers/reducer_ui.js +4 -2
- package/dist/reducers/reducer_voltammetry.js +248 -0
- package/dist/sagas/index.js +5 -1
- package/dist/sagas/saga_multi_entities.js +114 -0
- package/dist/sagas/saga_ui.js +107 -11
- package/dist/third_party/peakInterval.js +2 -0
- package/package.json +19 -15
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.setAllCurves = exports.selectCurve = undefined;
|
|
7
|
+
|
|
8
|
+
var _action_type = require('../constants/action_type');
|
|
9
|
+
|
|
10
|
+
var selectCurve = function selectCurve(payload) {
|
|
11
|
+
return {
|
|
12
|
+
type: _action_type.CURVE.SELECT_WORKING_CURVE,
|
|
13
|
+
payload: payload
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var setAllCurves = function setAllCurves(payload) {
|
|
18
|
+
return {
|
|
19
|
+
type: _action_type.CURVE.SET_ALL_CURVES,
|
|
20
|
+
payload: payload
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.selectCurve = selectCurve;
|
|
25
|
+
exports.setAllCurves = setAllCurves;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.removeCylicVoltaPecker = exports.addCylicVoltaPecker = exports.selectPairPeak = exports.setWorkWithMaxPeak = exports.removeCylicVoltaMinPeak = exports.addCylicVoltaMinPeak = exports.removeCylicVoltaMaxPeak = exports.addCylicVoltaMaxPeak = exports.removeCylicVoltaPairPeak = exports.addNewCylicVoltaPairPeak = undefined;
|
|
7
|
+
|
|
8
|
+
var _action_type = require('../constants/action_type');
|
|
9
|
+
|
|
10
|
+
var addNewCylicVoltaPairPeak = function addNewCylicVoltaPairPeak(payload) {
|
|
11
|
+
return {
|
|
12
|
+
type: _action_type.CYCLIC_VOLTA_METRY.ADD_PAIR_PEAKS,
|
|
13
|
+
payload: payload
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var removeCylicVoltaPairPeak = function removeCylicVoltaPairPeak(payload) {
|
|
18
|
+
return {
|
|
19
|
+
type: _action_type.CYCLIC_VOLTA_METRY.REMOVE_PAIR_PEAKS,
|
|
20
|
+
payload: payload
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var addCylicVoltaMaxPeak = function addCylicVoltaMaxPeak(payload) {
|
|
25
|
+
return {
|
|
26
|
+
type: _action_type.CYCLIC_VOLTA_METRY.ADD_MAX_PEAK,
|
|
27
|
+
payload: payload
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var removeCylicVoltaMaxPeak = function removeCylicVoltaMaxPeak(payload) {
|
|
32
|
+
return {
|
|
33
|
+
type: _action_type.CYCLIC_VOLTA_METRY.REMOVE_MAX_PEAK,
|
|
34
|
+
payload: payload
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var addCylicVoltaMinPeak = function addCylicVoltaMinPeak(payload) {
|
|
39
|
+
return {
|
|
40
|
+
type: _action_type.CYCLIC_VOLTA_METRY.ADD_MIN_PEAK,
|
|
41
|
+
payload: payload
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var removeCylicVoltaMinPeak = function removeCylicVoltaMinPeak(payload) {
|
|
46
|
+
return {
|
|
47
|
+
type: _action_type.CYCLIC_VOLTA_METRY.REMOVE_MIN_PEAK,
|
|
48
|
+
payload: payload
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var setWorkWithMaxPeak = function setWorkWithMaxPeak(payload) {
|
|
53
|
+
return {
|
|
54
|
+
type: _action_type.CYCLIC_VOLTA_METRY.WORK_WITH_MAX_PEAK,
|
|
55
|
+
payload: payload
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
var selectPairPeak = function selectPairPeak(payload) {
|
|
60
|
+
return {
|
|
61
|
+
type: _action_type.CYCLIC_VOLTA_METRY.SELECT_PAIR_PEAK,
|
|
62
|
+
payload: payload
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
var addCylicVoltaPecker = function addCylicVoltaPecker(payload) {
|
|
67
|
+
return {
|
|
68
|
+
type: _action_type.CYCLIC_VOLTA_METRY.ADD_PECKER,
|
|
69
|
+
payload: payload
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
var removeCylicVoltaPecker = function removeCylicVoltaPecker(payload) {
|
|
74
|
+
return {
|
|
75
|
+
type: _action_type.CYCLIC_VOLTA_METRY.REMOVE_PECKER,
|
|
76
|
+
payload: payload
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
exports.addNewCylicVoltaPairPeak = addNewCylicVoltaPairPeak;
|
|
81
|
+
exports.removeCylicVoltaPairPeak = removeCylicVoltaPairPeak;
|
|
82
|
+
exports.addCylicVoltaMaxPeak = addCylicVoltaMaxPeak;
|
|
83
|
+
exports.removeCylicVoltaMaxPeak = removeCylicVoltaMaxPeak;
|
|
84
|
+
exports.addCylicVoltaMinPeak = addCylicVoltaMinPeak;
|
|
85
|
+
exports.removeCylicVoltaMinPeak = removeCylicVoltaMinPeak;
|
|
86
|
+
exports.setWorkWithMaxPeak = setWorkWithMaxPeak;
|
|
87
|
+
exports.selectPairPeak = selectPairPeak;
|
|
88
|
+
exports.addCylicVoltaPecker = addCylicVoltaPecker;
|
|
89
|
+
exports.removeCylicVoltaPecker = removeCylicVoltaPecker;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.toggleThresholdIsEdit = exports.resetThresholdValue = exports.updateThresholdValue = undefined;
|
|
6
|
+
exports.updateLowerThresholdValue = exports.updateUpperThresholdValue = exports.toggleThresholdIsEdit = exports.resetThresholdValue = exports.updateThresholdValue = undefined;
|
|
7
7
|
|
|
8
8
|
var _action_type = require('../constants/action_type');
|
|
9
9
|
|
|
@@ -28,6 +28,22 @@ var toggleThresholdIsEdit = function toggleThresholdIsEdit(payload) {
|
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
+
var updateUpperThresholdValue = function updateUpperThresholdValue(payload) {
|
|
32
|
+
return {
|
|
33
|
+
type: _action_type.THRESHOLD.UPDATE_UPPER_VALUE,
|
|
34
|
+
payload: payload
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var updateLowerThresholdValue = function updateLowerThresholdValue(payload) {
|
|
39
|
+
return {
|
|
40
|
+
type: _action_type.THRESHOLD.UPDATE_LOWER_VALUE,
|
|
41
|
+
payload: payload
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
31
45
|
exports.updateThresholdValue = updateThresholdValue;
|
|
32
46
|
exports.resetThresholdValue = resetThresholdValue;
|
|
33
|
-
exports.toggleThresholdIsEdit = toggleThresholdIsEdit;
|
|
47
|
+
exports.toggleThresholdIsEdit = toggleThresholdIsEdit;
|
|
48
|
+
exports.updateUpperThresholdValue = updateUpperThresholdValue;
|
|
49
|
+
exports.updateLowerThresholdValue = updateLowerThresholdValue;
|
package/dist/actions/ui.js
CHANGED
|
@@ -15,9 +15,11 @@ var setUiViewerType = function setUiViewerType(payload) {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
var setUiSweepType = function setUiSweepType(payload) {
|
|
18
|
+
var jcampIdx = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
18
19
|
return {
|
|
19
20
|
type: _action_type.UI.SWEEP.SET_TYPE,
|
|
20
|
-
payload: payload
|
|
21
|
+
payload: payload,
|
|
22
|
+
jcampIdx: jcampIdx
|
|
21
23
|
};
|
|
22
24
|
};
|
|
23
25
|
|
|
@@ -36,10 +38,16 @@ var scrollUiWheel = function scrollUiWheel(payload) {
|
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
var clickUiTarget = function clickUiTarget(payload, onPeak) {
|
|
41
|
+
var voltammetryPeakIdx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
42
|
+
var jcampIdx = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
43
|
+
var onPecker = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
39
44
|
return {
|
|
40
45
|
type: _action_type.UI.CLICK_TARGET,
|
|
41
46
|
payload: payload,
|
|
42
|
-
onPeak: onPeak
|
|
47
|
+
onPeak: onPeak,
|
|
48
|
+
voltammetryPeakIdx: voltammetryPeakIdx,
|
|
49
|
+
jcampIdx: jcampIdx,
|
|
50
|
+
onPecker: onPecker
|
|
43
51
|
};
|
|
44
52
|
};
|
|
45
53
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.updateWaveLength = undefined;
|
|
7
7
|
|
|
8
|
-
var _action_type = require(
|
|
8
|
+
var _action_type = require('../constants/action_type');
|
|
9
9
|
|
|
10
10
|
var updateWaveLength = function updateWaveLength(payload) {
|
|
11
11
|
return {
|
package/dist/app.js
CHANGED
|
@@ -72,12 +72,17 @@ var SpectraEditor = function SpectraEditor(_ref) {
|
|
|
72
72
|
editorOnly = _ref.editorOnly,
|
|
73
73
|
descriptions = _ref.descriptions,
|
|
74
74
|
canChangeDescription = _ref.canChangeDescription,
|
|
75
|
-
onDescriptionChanged = _ref.onDescriptionChanged
|
|
75
|
+
onDescriptionChanged = _ref.onDescriptionChanged,
|
|
76
|
+
multiEntities = _ref.multiEntities,
|
|
77
|
+
multiMolSvgs = _ref.multiMolSvgs,
|
|
78
|
+
entityFileNames = _ref.entityFileNames;
|
|
76
79
|
return _react2.default.createElement(
|
|
77
80
|
_reactRedux.Provider,
|
|
78
81
|
{ store: store },
|
|
79
82
|
_react2.default.createElement(_layer_init2.default, {
|
|
80
83
|
entity: entity,
|
|
84
|
+
multiEntities: multiEntities,
|
|
85
|
+
entityFileNames: entityFileNames,
|
|
81
86
|
others: others,
|
|
82
87
|
cLabel: cLabel,
|
|
83
88
|
xLabel: xLabel,
|
|
@@ -86,6 +91,7 @@ var SpectraEditor = function SpectraEditor(_ref) {
|
|
|
86
91
|
operations: operations,
|
|
87
92
|
descriptions: ensureQuillDelta(descriptions),
|
|
88
93
|
molSvg: molSvg,
|
|
94
|
+
multiMolSvgs: multiMolSvgs,
|
|
89
95
|
editorOnly: editorOnly,
|
|
90
96
|
canChangeDescription: canChangeDescription,
|
|
91
97
|
onDescriptionChanged: onDescriptionChanged
|
|
@@ -95,6 +101,8 @@ var SpectraEditor = function SpectraEditor(_ref) {
|
|
|
95
101
|
|
|
96
102
|
SpectraEditor.propTypes = {
|
|
97
103
|
entity: _propTypes2.default.object.isRequired,
|
|
104
|
+
multiEntities: _propTypes2.default.array,
|
|
105
|
+
entityFileNames: _propTypes2.default.array,
|
|
98
106
|
others: _propTypes2.default.object,
|
|
99
107
|
cLabel: _propTypes2.default.string,
|
|
100
108
|
xLabel: _propTypes2.default.string,
|
|
@@ -103,6 +111,7 @@ SpectraEditor.propTypes = {
|
|
|
103
111
|
operations: _propTypes2.default.array,
|
|
104
112
|
descriptions: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.array]),
|
|
105
113
|
molSvg: _propTypes2.default.string,
|
|
114
|
+
multiMolSvgs: _propTypes2.default.array,
|
|
106
115
|
editorOnly: _propTypes2.default.bool,
|
|
107
116
|
canChangeDescription: _propTypes2.default.bool,
|
|
108
117
|
onDescriptionChanged: _propTypes2.default.func
|
|
@@ -110,6 +119,8 @@ SpectraEditor.propTypes = {
|
|
|
110
119
|
|
|
111
120
|
SpectraEditor.defaultProps = {
|
|
112
121
|
others: { others: [], addOthersCb: false },
|
|
122
|
+
multiEntities: false,
|
|
123
|
+
entityFileNames: false,
|
|
113
124
|
cLabel: '',
|
|
114
125
|
xLabel: '',
|
|
115
126
|
yLabel: '',
|
|
@@ -117,6 +128,7 @@ SpectraEditor.defaultProps = {
|
|
|
117
128
|
operations: [],
|
|
118
129
|
descriptions: [],
|
|
119
130
|
molSvg: '',
|
|
131
|
+
multiMolSvgs: [],
|
|
120
132
|
editorOnly: false,
|
|
121
133
|
canChangeDescription: false
|
|
122
134
|
};
|
|
@@ -54,7 +54,10 @@ var Peak = function Peak(_ref) {
|
|
|
54
54
|
isFocusRmPeakSt = _ref.isFocusRmPeakSt,
|
|
55
55
|
disableRmPeakSt = _ref.disableRmPeakSt,
|
|
56
56
|
isFocusSetRefSt = _ref.isFocusSetRefSt,
|
|
57
|
-
disableSetRefSt = _ref.disableSetRefSt
|
|
57
|
+
disableSetRefSt = _ref.disableSetRefSt,
|
|
58
|
+
isHandleMaxAndMinPeaksSt = _ref.isHandleMaxAndMinPeaksSt,
|
|
59
|
+
cyclicVotaSt = _ref.cyclicVotaSt,
|
|
60
|
+
curveSt = _ref.curveSt;
|
|
58
61
|
|
|
59
62
|
var onSweepPeakAdd = function onSweepPeakAdd() {
|
|
60
63
|
return setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.PEAK_ADD);
|
|
@@ -65,6 +68,31 @@ var Peak = function Peak(_ref) {
|
|
|
65
68
|
var onSweepAnchorShift = function onSweepAnchorShift() {
|
|
66
69
|
return setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.ANCHOR_SHIFT);
|
|
67
70
|
};
|
|
71
|
+
if (isHandleMaxAndMinPeaksSt) {
|
|
72
|
+
var curveIdx = curveSt.curveIdx;
|
|
73
|
+
var spectraList = cyclicVotaSt.spectraList;
|
|
74
|
+
|
|
75
|
+
var spectra = spectraList[curveIdx];
|
|
76
|
+
if (spectra) {
|
|
77
|
+
var isWorkMaxPeak = spectra.isWorkMaxPeak;
|
|
78
|
+
|
|
79
|
+
if (isWorkMaxPeak) {
|
|
80
|
+
onSweepPeakAdd = function onSweepPeakAdd() {
|
|
81
|
+
return setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_ADD_MAX_PEAK, curveIdx);
|
|
82
|
+
};
|
|
83
|
+
onSweepPeakDELETE = function onSweepPeakDELETE() {
|
|
84
|
+
return setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_RM_MAX_PEAK, curveIdx);
|
|
85
|
+
};
|
|
86
|
+
} else {
|
|
87
|
+
onSweepPeakAdd = function onSweepPeakAdd() {
|
|
88
|
+
return setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_ADD_MIN_PEAK, curveIdx);
|
|
89
|
+
};
|
|
90
|
+
onSweepPeakDELETE = function onSweepPeakDELETE() {
|
|
91
|
+
return setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_RM_MIN_PEAK, curveIdx);
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
68
96
|
|
|
69
97
|
return _react2.default.createElement(
|
|
70
98
|
'span',
|
|
@@ -146,12 +174,15 @@ var Peak = function Peak(_ref) {
|
|
|
146
174
|
var mapStateToProps = function mapStateToProps(state, _) {
|
|
147
175
|
return (// eslint-disable-line
|
|
148
176
|
{
|
|
149
|
-
isFocusAddPeakSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.PEAK_ADD,
|
|
177
|
+
isFocusAddPeakSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.PEAK_ADD || state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_ADD_MAX_PEAK || state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_ADD_MIN_PEAK,
|
|
150
178
|
disableAddPeakSt: _cfg2.default.btnCmdAddPeak(state.layout),
|
|
151
|
-
isFocusRmPeakSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.PEAK_DELETE,
|
|
179
|
+
isFocusRmPeakSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.PEAK_DELETE || state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_RM_MAX_PEAK || state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_RM_MIN_PEAK,
|
|
152
180
|
disableRmPeakSt: _cfg2.default.btnCmdRmPeak(state.layout),
|
|
153
181
|
isFocusSetRefSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.ANCHOR_SHIFT,
|
|
154
|
-
disableSetRefSt: _cfg2.default.btnCmdSetRef(state.layout)
|
|
182
|
+
disableSetRefSt: _cfg2.default.btnCmdSetRef(state.layout),
|
|
183
|
+
isHandleMaxAndMinPeaksSt: !_cfg2.default.hidePanelCyclicVolta(state.layout),
|
|
184
|
+
cyclicVotaSt: state.cyclicvolta,
|
|
185
|
+
curveSt: state.curve
|
|
155
186
|
}
|
|
156
187
|
);
|
|
157
188
|
};
|
|
@@ -170,7 +201,10 @@ Peak.propTypes = {
|
|
|
170
201
|
disableRmPeakSt: _propTypes2.default.bool.isRequired,
|
|
171
202
|
isFocusSetRefSt: _propTypes2.default.bool.isRequired,
|
|
172
203
|
disableSetRefSt: _propTypes2.default.bool.isRequired,
|
|
173
|
-
setUiSweepTypeAct: _propTypes2.default.func.isRequired
|
|
204
|
+
setUiSweepTypeAct: _propTypes2.default.func.isRequired,
|
|
205
|
+
isHandleMaxAndMinPeaksSt: _propTypes2.default.bool.isRequired,
|
|
206
|
+
cyclicVotaSt: _propTypes2.default.object.isRequired,
|
|
207
|
+
curveSt: _propTypes2.default.object.isRequired
|
|
174
208
|
};
|
|
175
209
|
|
|
176
210
|
exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), (0, _styles.withStyles)(styles))(Peak);
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _react = require('react');
|
|
8
|
+
|
|
9
|
+
var _react2 = _interopRequireDefault(_react);
|
|
10
|
+
|
|
11
|
+
var _reactRedux = require('react-redux');
|
|
12
|
+
|
|
13
|
+
var _redux = require('redux');
|
|
14
|
+
|
|
15
|
+
var _classnames = require('classnames');
|
|
16
|
+
|
|
17
|
+
var _classnames2 = _interopRequireDefault(_classnames);
|
|
18
|
+
|
|
19
|
+
var _propTypes = require('prop-types');
|
|
20
|
+
|
|
21
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
22
|
+
|
|
23
|
+
var _styles = require('@material-ui/core/styles');
|
|
24
|
+
|
|
25
|
+
var _Tooltip = require('@material-ui/core/Tooltip');
|
|
26
|
+
|
|
27
|
+
var _Tooltip2 = _interopRequireDefault(_Tooltip);
|
|
28
|
+
|
|
29
|
+
var _ui = require('../../actions/ui');
|
|
30
|
+
|
|
31
|
+
var _common = require('./common');
|
|
32
|
+
|
|
33
|
+
var _list_ui = require('../../constants/list_ui');
|
|
34
|
+
|
|
35
|
+
var _cfg = require('../../helpers/cfg');
|
|
36
|
+
|
|
37
|
+
var _cfg2 = _interopRequireDefault(_cfg);
|
|
38
|
+
|
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40
|
+
|
|
41
|
+
var styles = function styles() {
|
|
42
|
+
return Object.assign({}, _common.commonStyle);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var Pecker = function Pecker(_ref) {
|
|
46
|
+
var classes = _ref.classes,
|
|
47
|
+
layoutSt = _ref.layoutSt,
|
|
48
|
+
isFocusAddPeckerSt = _ref.isFocusAddPeckerSt,
|
|
49
|
+
isFocusRmPeckerSt = _ref.isFocusRmPeckerSt,
|
|
50
|
+
setUiSweepTypeAct = _ref.setUiSweepTypeAct,
|
|
51
|
+
jcampIdx = _ref.jcampIdx;
|
|
52
|
+
|
|
53
|
+
var onSweepPeckerAdd = function onSweepPeckerAdd() {
|
|
54
|
+
return setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_ADD_PECKER, jcampIdx);
|
|
55
|
+
};
|
|
56
|
+
var onSweepPeckerDELETE = function onSweepPeckerDELETE() {
|
|
57
|
+
return setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_RM_PECKER, jcampIdx);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return !_cfg2.default.hidePanelCyclicVolta(layoutSt) ? _react2.default.createElement(
|
|
61
|
+
'span',
|
|
62
|
+
null,
|
|
63
|
+
_react2.default.createElement(
|
|
64
|
+
_Tooltip2.default,
|
|
65
|
+
{ title: _react2.default.createElement(
|
|
66
|
+
'span',
|
|
67
|
+
{ className: 'txt-sv-tp' },
|
|
68
|
+
'Add Pecker'
|
|
69
|
+
) },
|
|
70
|
+
_react2.default.createElement(
|
|
71
|
+
'span',
|
|
72
|
+
null,
|
|
73
|
+
_react2.default.createElement(
|
|
74
|
+
_common.MuButton,
|
|
75
|
+
{
|
|
76
|
+
className: (0, _classnames2.default)((0, _common.focusStyle)(isFocusAddPeckerSt, classes), 'btn-sv-bar-addpeak'),
|
|
77
|
+
onClick: onSweepPeckerAdd
|
|
78
|
+
},
|
|
79
|
+
_react2.default.createElement(
|
|
80
|
+
'span',
|
|
81
|
+
{ className: (0, _classnames2.default)(classes.txt, 'txt-sv-bar-addpeak') },
|
|
82
|
+
'Pe+'
|
|
83
|
+
)
|
|
84
|
+
)
|
|
85
|
+
)
|
|
86
|
+
),
|
|
87
|
+
_react2.default.createElement(
|
|
88
|
+
_Tooltip2.default,
|
|
89
|
+
{ title: _react2.default.createElement(
|
|
90
|
+
'span',
|
|
91
|
+
{ className: 'txt-sv-tp' },
|
|
92
|
+
'Remove Pecker'
|
|
93
|
+
) },
|
|
94
|
+
_react2.default.createElement(
|
|
95
|
+
'span',
|
|
96
|
+
null,
|
|
97
|
+
_react2.default.createElement(
|
|
98
|
+
_common.MuButton,
|
|
99
|
+
{
|
|
100
|
+
className: (0, _classnames2.default)((0, _common.focusStyle)(isFocusRmPeckerSt, classes), 'btn-sv-bar-rmpeak'),
|
|
101
|
+
onClick: onSweepPeckerDELETE
|
|
102
|
+
},
|
|
103
|
+
_react2.default.createElement(
|
|
104
|
+
'span',
|
|
105
|
+
{ className: (0, _classnames2.default)(classes.txt, 'txt-sv-bar-rmpeak') },
|
|
106
|
+
'Pe-'
|
|
107
|
+
)
|
|
108
|
+
)
|
|
109
|
+
)
|
|
110
|
+
)
|
|
111
|
+
) : _react2.default.createElement('span', null);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
var mapStateToProps = function mapStateToProps(state, _) {
|
|
115
|
+
return (// eslint-disable-line
|
|
116
|
+
{
|
|
117
|
+
layoutSt: state.layout,
|
|
118
|
+
isFocusAddPeckerSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_ADD_PECKER,
|
|
119
|
+
isFocusRmPeckerSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_RM_PECKER,
|
|
120
|
+
cyclicVotaSt: state.cyclicvolta
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
126
|
+
return (0, _redux.bindActionCreators)({
|
|
127
|
+
setUiSweepTypeAct: _ui.setUiSweepType
|
|
128
|
+
}, dispatch);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
Pecker.propTypes = {
|
|
132
|
+
classes: _propTypes2.default.object.isRequired,
|
|
133
|
+
layoutSt: _propTypes2.default.string.isRequired,
|
|
134
|
+
isFocusAddPeckerSt: _propTypes2.default.bool.isRequired,
|
|
135
|
+
isFocusRmPeckerSt: _propTypes2.default.bool.isRequired,
|
|
136
|
+
setUiSweepTypeAct: _propTypes2.default.func.isRequired,
|
|
137
|
+
cyclicVotaSt: _propTypes2.default.object.isRequired,
|
|
138
|
+
jcampIdx: _propTypes2.default.any
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), (0, _styles.withStyles)(styles))(Pecker);
|
|
@@ -60,6 +60,10 @@ var _r07_wavelength_btn = require('./r07_wavelength_btn');
|
|
|
60
60
|
|
|
61
61
|
var _r07_wavelength_btn2 = _interopRequireDefault(_r07_wavelength_btn);
|
|
62
62
|
|
|
63
|
+
var _pecker = require('./07_pecker');
|
|
64
|
+
|
|
65
|
+
var _pecker2 = _interopRequireDefault(_pecker);
|
|
66
|
+
|
|
63
67
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
64
68
|
|
|
65
69
|
var styles = function styles() {
|
|
@@ -72,13 +76,16 @@ var CmdBar = function CmdBar(_ref) {
|
|
|
72
76
|
hasEdit = _ref.hasEdit,
|
|
73
77
|
forecast = _ref.forecast,
|
|
74
78
|
operations = _ref.operations,
|
|
75
|
-
editorOnly = _ref.editorOnly
|
|
79
|
+
editorOnly = _ref.editorOnly,
|
|
80
|
+
jcampIdx = _ref.jcampIdx,
|
|
81
|
+
hideThreshold = _ref.hideThreshold;
|
|
76
82
|
return _react2.default.createElement(
|
|
77
83
|
'div',
|
|
78
84
|
{ className: classes.card },
|
|
79
85
|
_react2.default.createElement(_viewer2.default, { editorOnly: editorOnly }),
|
|
80
86
|
_react2.default.createElement(_zoom2.default, null),
|
|
81
|
-
_react2.default.createElement(_peak2.default,
|
|
87
|
+
_react2.default.createElement(_peak2.default, { jcampIdx: jcampIdx }),
|
|
88
|
+
_react2.default.createElement(_pecker2.default, { jcampIdx: jcampIdx }),
|
|
82
89
|
_react2.default.createElement(_integration2.default, null),
|
|
83
90
|
_react2.default.createElement(_multiplicity2.default, null),
|
|
84
91
|
_react2.default.createElement(_undo_redo2.default, null),
|
|
@@ -90,7 +97,7 @@ var CmdBar = function CmdBar(_ref) {
|
|
|
90
97
|
hideSwitch: false,
|
|
91
98
|
disabled: false
|
|
92
99
|
}),
|
|
93
|
-
_react2.default.createElement(_r03_threshold2.default, { feature: feature, hasEdit: hasEdit }),
|
|
100
|
+
hideThreshold ? null : _react2.default.createElement(_r03_threshold2.default, { feature: feature, hasEdit: hasEdit }),
|
|
94
101
|
_react2.default.createElement(_r01_layout2.default, { feature: feature, hasEdit: hasEdit }),
|
|
95
102
|
_react2.default.createElement(_r07_wavelength_btn2.default, null)
|
|
96
103
|
);
|
|
@@ -112,7 +119,9 @@ CmdBar.propTypes = {
|
|
|
112
119
|
forecast: _propTypes2.default.object.isRequired,
|
|
113
120
|
hasEdit: _propTypes2.default.bool.isRequired,
|
|
114
121
|
operations: _propTypes2.default.array.isRequired,
|
|
115
|
-
editorOnly: _propTypes2.default.bool.isRequired
|
|
122
|
+
editorOnly: _propTypes2.default.bool.isRequired,
|
|
123
|
+
jcampIdx: _propTypes2.default.any,
|
|
124
|
+
hideThreshold: _propTypes2.default.bool
|
|
116
125
|
};
|
|
117
126
|
|
|
118
127
|
exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), (0, _styles.withStyles)(styles))(CmdBar);
|
|
@@ -300,6 +300,15 @@ var layoutSelect = function layoutSelect(classes, layoutSt, updateLayoutAct) {
|
|
|
300
300
|
{ className: (0, _classnames2.default)(classes.txtOpt, 'option-sv-bar-layout') },
|
|
301
301
|
'MS'
|
|
302
302
|
)
|
|
303
|
+
),
|
|
304
|
+
_react2.default.createElement(
|
|
305
|
+
_MenuItem2.default,
|
|
306
|
+
{ value: _list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY },
|
|
307
|
+
_react2.default.createElement(
|
|
308
|
+
'span',
|
|
309
|
+
{ className: (0, _classnames2.default)(classes.txtOpt, 'option-sv-bar-layout') },
|
|
310
|
+
'CV (CYCLIC VOLTAMMETRY)'
|
|
311
|
+
)
|
|
303
312
|
)
|
|
304
313
|
)
|
|
305
314
|
);
|
|
@@ -42,7 +42,7 @@ var styles = function styles() {
|
|
|
42
42
|
return Object.assign({}, _common.commonStyle);
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
var onClickCb = function onClickCb(operation, peaksEdit, isAscend, isIntensity, scan, thres, layoutSt, shiftSt, analysis, decimalSt, integrationSt, multiplicitySt, allIntegrationSt, aucValues, waveLengthSt) {
|
|
45
|
+
var onClickCb = function onClickCb(operation, peaksEdit, isAscend, isIntensity, scan, thres, layoutSt, shiftSt, analysis, decimalSt, integrationSt, multiplicitySt, allIntegrationSt, aucValues, waveLengthSt, cyclicvoltaSt, curveSt) {
|
|
46
46
|
return function () {
|
|
47
47
|
operation({
|
|
48
48
|
peaks: peaksEdit,
|
|
@@ -58,7 +58,9 @@ var onClickCb = function onClickCb(operation, peaksEdit, isAscend, isIntensity,
|
|
|
58
58
|
multiplicity: multiplicitySt,
|
|
59
59
|
allIntegration: allIntegrationSt,
|
|
60
60
|
aucValues: aucValues,
|
|
61
|
-
waveLength: waveLengthSt
|
|
61
|
+
waveLength: waveLengthSt,
|
|
62
|
+
cyclicvoltaSt: cyclicvoltaSt,
|
|
63
|
+
curveSt: curveSt
|
|
62
64
|
});
|
|
63
65
|
};
|
|
64
66
|
};
|
|
@@ -79,7 +81,9 @@ var BtnSubmit = function BtnSubmit(_ref) {
|
|
|
79
81
|
integrationSt = _ref.integrationSt,
|
|
80
82
|
multiplicitySt = _ref.multiplicitySt,
|
|
81
83
|
allIntegrationSt = _ref.allIntegrationSt,
|
|
82
|
-
waveLengthSt = _ref.waveLengthSt
|
|
84
|
+
waveLengthSt = _ref.waveLengthSt,
|
|
85
|
+
cyclicvoltaSt = _ref.cyclicvoltaSt,
|
|
86
|
+
curveSt = _ref.curveSt;
|
|
83
87
|
|
|
84
88
|
var peaksEdit = (0, _extractPeaksEdit.extractPeaksEdit)(feature, editPeakSt, thresSt, shiftSt, layoutSt);
|
|
85
89
|
// const disBtn = peaksEdit.length === 0 || statusSt.btnSubmit || disabled;
|
|
@@ -101,7 +105,7 @@ var BtnSubmit = function BtnSubmit(_ref) {
|
|
|
101
105
|
{
|
|
102
106
|
className: (0, _classnames2.default)('btn-sv-bar-submit'),
|
|
103
107
|
color: 'primary',
|
|
104
|
-
onClick: onClickCb(operation.value, peaksEdit, isAscend, isIntensity, scan, thres, layoutSt, shiftSt, forecastSt.predictions, decimalSt, integrationSt, multiplicitySt, allIntegrationSt, aucValues, waveLengthSt)
|
|
108
|
+
onClick: onClickCb(operation.value, peaksEdit, isAscend, isIntensity, scan, thres, layoutSt, shiftSt, forecastSt.predictions, decimalSt, integrationSt, multiplicitySt, allIntegrationSt, aucValues, waveLengthSt, cyclicvoltaSt, curveSt)
|
|
105
109
|
},
|
|
106
110
|
_react2.default.createElement(_PlayCircleOutline2.default, { className: classes.icon })
|
|
107
111
|
)
|
|
@@ -121,7 +125,9 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
121
125
|
integrationSt: state.integration.present,
|
|
122
126
|
multiplicitySt: state.multiplicity.present,
|
|
123
127
|
allIntegrationSt: state.integration.past.concat(state.integration.present),
|
|
124
|
-
waveLengthSt: state.wavelength
|
|
128
|
+
waveLengthSt: state.wavelength,
|
|
129
|
+
cyclicvoltaSt: state.cyclicvolta,
|
|
130
|
+
curveSt: state.curve
|
|
125
131
|
}
|
|
126
132
|
);
|
|
127
133
|
};
|
|
@@ -146,7 +152,8 @@ BtnSubmit.propTypes = {
|
|
|
146
152
|
integrationSt: _propTypes2.default.object.isRequired,
|
|
147
153
|
multiplicitySt: _propTypes2.default.object.isRequired,
|
|
148
154
|
allIntegrationSt: _propTypes2.default.object.isRequired,
|
|
149
|
-
waveLengthSt: _propTypes2.default.object.isRequired
|
|
155
|
+
waveLengthSt: _propTypes2.default.object.isRequired,
|
|
156
|
+
cyclicvoltaSt: _propTypes2.default.object.isRequired
|
|
150
157
|
};
|
|
151
158
|
|
|
152
159
|
exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), (0, _styles.withStyles)(styles))(BtnSubmit);
|
|
@@ -48,7 +48,6 @@ var styles = function styles() {
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
var wavelengthSelect = function wavelengthSelect(classes, waveLengthSt, layoutSt, updateWaveLengthAct) {
|
|
51
|
-
|
|
52
51
|
if (!_format2.default.isXRDLayout(layoutSt)) {
|
|
53
52
|
return _react2.default.createElement('i', null);
|
|
54
53
|
}
|
|
@@ -79,6 +78,7 @@ var wavelengthSelect = function wavelengthSelect(classes, waveLengthSt, layoutSt
|
|
|
79
78
|
})
|
|
80
79
|
},
|
|
81
80
|
_list_wavelength.LIST_WAVE_LENGTH.map(function (item) {
|
|
81
|
+
// eslint-disable-line
|
|
82
82
|
return _react2.default.createElement(
|
|
83
83
|
_core.MenuItem,
|
|
84
84
|
{ value: item },
|
|
@@ -32,6 +32,8 @@ var _draw = require('../common/draw');
|
|
|
32
32
|
|
|
33
33
|
var _list_ui = require('../../constants/list_ui');
|
|
34
34
|
|
|
35
|
+
var _cyclic_voltammetry = require('../../actions/cyclic_voltammetry');
|
|
36
|
+
|
|
35
37
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
36
38
|
|
|
37
39
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -213,7 +215,10 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
|
213
215
|
resetAllAct: _manager.resetAll,
|
|
214
216
|
clickUiTargetAct: _ui.clickUiTarget,
|
|
215
217
|
selectUiSweepAct: _ui.selectUiSweep,
|
|
216
|
-
scrollUiWheelAct: _ui.scrollUiWheel
|
|
218
|
+
scrollUiWheelAct: _ui.scrollUiWheel,
|
|
219
|
+
addNewCylicVoltaPairPeakAct: _cyclic_voltammetry.addNewCylicVoltaPairPeak,
|
|
220
|
+
addCylicVoltaMaxPeakAct: _cyclic_voltammetry.addCylicVoltaMaxPeak,
|
|
221
|
+
addCylicVoltaMinPeakAct: _cyclic_voltammetry.addCylicVoltaMinPeak
|
|
217
222
|
}, dispatch);
|
|
218
223
|
};
|
|
219
224
|
|
|
@@ -61,6 +61,7 @@ var LineFocus = function () {
|
|
|
61
61
|
scrollUiWheelAct = props.scrollUiWheelAct;
|
|
62
62
|
|
|
63
63
|
|
|
64
|
+
this.jcampIdx = 0;
|
|
64
65
|
this.rootKlass = '.d3Line';
|
|
65
66
|
this.margin = {
|
|
66
67
|
t: 5,
|
|
@@ -374,7 +375,8 @@ var LineFocus = function () {
|
|
|
374
375
|
sameDtPk = _shouldUpdate3.sameDtPk,
|
|
375
376
|
sameSfPk = _shouldUpdate3.sameSfPk;
|
|
376
377
|
|
|
377
|
-
|
|
378
|
+
|
|
379
|
+
if (!_format2.default.isCyclicVoltaLayout(this.layout) && sameXY && sameEpSt && sameDtPk && sameSfPk) return;
|
|
378
380
|
|
|
379
381
|
// rescale for zoom
|
|
380
382
|
|
|
@@ -753,7 +755,7 @@ var LineFocus = function () {
|
|
|
753
755
|
}, {
|
|
754
756
|
key: 'reverseXAxis',
|
|
755
757
|
value: function reverseXAxis(layoutSt) {
|
|
756
|
-
return [_list_layout.LIST_LAYOUT.UVVIS, _list_layout.LIST_LAYOUT.HPLC_UVVIS, _list_layout.LIST_LAYOUT.TGA, _list_layout.LIST_LAYOUT.XRD].indexOf(layoutSt) < 0;
|
|
758
|
+
return [_list_layout.LIST_LAYOUT.UVVIS, _list_layout.LIST_LAYOUT.HPLC_UVVIS, _list_layout.LIST_LAYOUT.TGA, _list_layout.LIST_LAYOUT.XRD, _list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY].indexOf(layoutSt) < 0;
|
|
757
759
|
}
|
|
758
760
|
}, {
|
|
759
761
|
key: 'create',
|