@complat/react-spectra-editor 1.0.0-rc2 → 1.0.0-rc20.patch-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/README.md +16 -0
- package/dist/__tests__/fixtures/aif_jcamp_1.js +136 -0
- package/dist/__tests__/fixtures/aif_jcamp_2.js +122 -0
- package/dist/__tests__/fixtures/backup/nmr1h_a.js +3518 -0
- package/dist/__tests__/fixtures/backup/xrd_jcamp_1.js +10705 -0
- package/dist/__tests__/fixtures/cds_jcamp.js +861 -0
- package/dist/__tests__/fixtures/compare_ir_1_jcamp.js +585 -0
- package/dist/__tests__/fixtures/compare_ir_2_jcamp.js +515 -0
- package/dist/__tests__/fixtures/compare_uv_vis_jcamp.js +640 -0
- package/dist/__tests__/fixtures/cyclic_voltammetry_1.js +778 -0
- package/dist/__tests__/fixtures/cyclic_voltammetry_2.js +758 -0
- package/dist/__tests__/fixtures/cyclic_voltammetry_3.js +759 -0
- package/dist/__tests__/fixtures/dls_acf_jcamp.js +148 -0
- package/dist/__tests__/fixtures/dls_intensity_jcamp.js +151 -0
- package/dist/__tests__/fixtures/emissions_jcamp.js +883 -0
- package/dist/__tests__/fixtures/hplc_uvvis_jcamp.js +638 -0
- package/dist/__tests__/fixtures/hplc_uvvis_jcamp_2.js +221 -0
- package/dist/__tests__/fixtures/ir_jcamp.js +148 -0
- package/dist/__tests__/fixtures/ir_result.js +46 -0
- package/dist/__tests__/fixtures/ir_svg.js +8 -0
- package/dist/__tests__/fixtures/ms_jcamp.js +64 -0
- package/dist/__tests__/fixtures/nmr13c_dept_jcamp.js +3543 -0
- package/dist/__tests__/fixtures/nmr13c_jcamp.js +1229 -0
- package/dist/__tests__/fixtures/nmr15n_jcamp.js +7177 -0
- package/dist/__tests__/fixtures/nmr19f_jcamp.js +6560 -0
- package/dist/__tests__/fixtures/nmr1h_2_jcamp.js +2005 -0
- package/dist/__tests__/fixtures/nmr1h_jcamp.js +4516 -0
- package/dist/__tests__/fixtures/nmr29si_jcamp.js +3029 -0
- package/dist/__tests__/fixtures/nmr31p_jcamp.js +3418 -0
- package/dist/__tests__/fixtures/nmr_result.js +68 -0
- package/dist/__tests__/fixtures/nmr_svg.js +8 -0
- package/dist/__tests__/fixtures/phenylalanin.js +142 -0
- package/dist/__tests__/fixtures/qDescValue.js +65 -0
- package/dist/__tests__/fixtures/raman_jcamp.js +410 -0
- package/dist/__tests__/fixtures/sec_1_jcamp.js +425 -0
- package/dist/__tests__/fixtures/sec_2_jcamp.js +407 -0
- package/dist/__tests__/fixtures/sec_3_jcamp.js +408 -0
- package/dist/__tests__/fixtures/sec_4_jcamp.js +407 -0
- package/dist/__tests__/fixtures/tga_jcamp.js +4157 -0
- package/dist/__tests__/fixtures/uv_vis_jcamp.js +249 -0
- package/dist/__tests__/fixtures/xrd_jcamp_1.js +436 -0
- package/dist/__tests__/fixtures/xrd_jcamp_2.js +955 -0
- package/dist/__tests__/fixtures/xrd_jcamp_3.js +1871 -0
- package/dist/__tests__/units/components/panel/graph_selection.test.js +72 -0
- package/dist/__tests__/units/components/panel/peaks.test.js +87 -0
- package/dist/actions/curve.js +15 -14
- package/dist/actions/cyclic_voltammetry.js +40 -60
- package/dist/actions/edit_peak.js +8 -12
- package/dist/actions/forecast.js +16 -24
- package/dist/actions/integration.js +12 -18
- package/dist/actions/jcamp.js +16 -24
- package/dist/actions/layout.js +4 -6
- package/dist/actions/manager.js +20 -30
- package/dist/actions/meta.js +4 -6
- package/dist/actions/multiplicity.js +24 -36
- package/dist/actions/scan.js +12 -18
- package/dist/actions/shift.js +8 -12
- package/dist/actions/status.js +12 -18
- package/dist/actions/submit.js +16 -24
- package/dist/actions/threshold.js +20 -30
- package/dist/actions/ui.js +25 -31
- package/dist/actions/wavelength.js +4 -6
- package/dist/app.js +25 -23
- package/dist/components/cmd_bar/01_viewer.js +24 -34
- package/dist/components/cmd_bar/02_zoom.js +18 -28
- package/dist/components/cmd_bar/03_peak.js +50 -66
- package/dist/components/cmd_bar/04_integration.js +70 -84
- package/dist/components/cmd_bar/05_multiplicity.js +42 -56
- package/dist/components/cmd_bar/06_undo_redo.js +22 -36
- package/dist/components/cmd_bar/07_pecker.js +24 -34
- package/dist/components/cmd_bar/common.js +11 -7
- package/dist/components/cmd_bar/index.js +17 -23
- package/dist/components/cmd_bar/r01_layout.js +79 -56
- package/dist/components/cmd_bar/r02_scan.js +70 -87
- package/dist/components/cmd_bar/r03_threshold.js +54 -68
- package/dist/components/cmd_bar/r04_submit.js +71 -83
- package/dist/components/cmd_bar/r05_submit_btn.js +64 -72
- package/dist/components/cmd_bar/r06_predict_btn.js +142 -152
- package/dist/components/cmd_bar/r07_wavelength_btn.js +28 -36
- package/dist/components/cmd_bar/tri_btn.js +91 -113
- package/dist/components/common/chem.js +2 -3
- package/dist/components/common/comps.js +2 -2
- package/dist/components/common/draw.js +30 -11
- package/dist/components/d3_line/index.js +154 -176
- package/dist/components/d3_line/line_focus.js +595 -739
- package/dist/components/d3_multi/index.js +153 -174
- package/dist/components/d3_multi/multi_focus.js +725 -850
- package/dist/components/d3_rect/index.js +112 -134
- package/dist/components/d3_rect/rect_focus.js +163 -208
- package/dist/components/forecast/comps.js +60 -68
- package/dist/components/forecast/ir_comps.js +49 -56
- package/dist/components/forecast/ir_viewer.js +61 -68
- package/dist/components/forecast/nmr_comps.js +62 -72
- package/dist/components/forecast/nmr_viewer.js +59 -68
- package/dist/components/forecast/section_loading.js +39 -63
- package/dist/components/forecast_viewer.js +109 -119
- package/dist/components/multi_jcamps_viewer.js +97 -113
- package/dist/components/panel/compare.js +183 -192
- package/dist/components/panel/cyclic_voltamery_data.js +149 -165
- package/dist/components/panel/graph_selection.js +143 -132
- package/dist/components/panel/index.js +112 -144
- package/dist/components/panel/info.js +125 -132
- package/dist/components/panel/multiplicity.js +215 -223
- package/dist/components/panel/multiplicity_coupling.js +108 -136
- package/dist/components/panel/multiplicity_select.js +43 -51
- package/dist/components/panel/peaks.js +130 -132
- package/dist/constants/action_type.js +23 -39
- package/dist/constants/list_layout.js +7 -4
- package/dist/constants/list_shift.js +117 -103
- package/dist/constants/list_ui.js +3 -6
- package/dist/constants/list_wavelength.js +7 -8
- package/dist/fn.js +2 -3
- package/dist/helpers/brush.js +49 -65
- package/dist/helpers/calc.js +2 -4
- package/dist/helpers/carbonFeatures.js +22 -20
- package/dist/helpers/cfg.js +49 -67
- package/dist/helpers/chem.js +450 -393
- package/dist/helpers/compass.js +92 -83
- package/dist/helpers/converter.js +52 -65
- package/dist/helpers/extractParams.js +60 -52
- package/dist/helpers/extractPeaksEdit.js +29 -25
- package/dist/helpers/focus.js +2 -6
- package/dist/helpers/format.js +416 -361
- package/dist/helpers/init.js +41 -37
- package/dist/helpers/integration.js +18 -21
- package/dist/helpers/mount.js +57 -61
- package/dist/helpers/multiplicity.js +19 -24
- package/dist/helpers/multiplicity_calc.js +39 -50
- package/dist/helpers/multiplicity_complat.js +21 -47
- package/dist/helpers/multiplicity_manual.js +49 -55
- package/dist/helpers/multiplicity_verify_basic.js +108 -111
- package/dist/helpers/shift.js +15 -23
- package/dist/helpers/zoom.js +7 -11
- package/dist/index.js +680 -630
- package/dist/layer_content.js +40 -43
- package/dist/layer_init.js +162 -184
- package/dist/layer_prism.js +38 -41
- package/dist/reducers/index.js +2 -3
- package/dist/reducers/reducer_curve.js +35 -26
- package/dist/reducers/reducer_edit_peak.js +122 -98
- package/dist/reducers/reducer_forecast.js +57 -44
- package/dist/reducers/reducer_integration.js +135 -103
- package/dist/reducers/reducer_jcamp.js +49 -44
- package/dist/reducers/reducer_layout.js +5 -6
- package/dist/reducers/reducer_manager.js +5 -6
- package/dist/reducers/reducer_meta.js +5 -6
- package/dist/reducers/reducer_multiplicity.js +100 -77
- package/dist/reducers/reducer_scan.js +17 -20
- package/dist/reducers/reducer_shift.js +115 -70
- package/dist/reducers/reducer_simulation.js +7 -8
- package/dist/reducers/reducer_status.js +5 -6
- package/dist/reducers/reducer_submit.js +12 -15
- package/dist/reducers/reducer_threshold.js +5 -6
- package/dist/reducers/reducer_ui.js +5 -6
- package/dist/reducers/reducer_voltammetry.js +156 -96
- package/dist/reducers/reducer_wavelength.js +5 -6
- package/dist/reducers/undo_redo_config.js +3 -5
- package/dist/sagas/index.js +2 -15
- package/dist/sagas/saga_edit_peak.js +54 -68
- package/dist/sagas/saga_manager.js +86 -130
- package/dist/sagas/saga_meta.js +25 -31
- package/dist/sagas/saga_multi_entities.js +40 -103
- package/dist/sagas/saga_multiplicity.js +336 -406
- package/dist/sagas/saga_ui.js +296 -475
- package/dist/setupTests.js +8 -0
- package/dist/third_party/jAnalyzer.js +66 -67
- package/dist/third_party/peakInterval.js +34 -34
- package/package.json +14 -14
- package/dist/components/cmd_bar/03_peak_bk.js +0 -139
- package/dist/components/cmd_bar/04_integration_bk.js +0 -180
- package/dist/components/cmd_bar/05_multiplicity_bk.js +0 -131
- package/dist/components/cmd_bar/r01_layout_bk.js +0 -186
- package/dist/components/cmd_bar/r06_predict_btn_bk.js +0 -220
- package/dist/components/d3_line/line_focus_bk.js +0 -825
- package/dist/components/d3_multi/index_bk.js +0 -210
- package/dist/components/d3_multi/multi_focus_bk.js +0 -533
- package/dist/components/panel/compare_bk.js +0 -256
- package/dist/components/panel/cyclic_voltamery_data_bk.js +0 -292
- package/dist/components/panel/index_bk.js +0 -178
- package/dist/components/panel/info_bk.js +0 -235
- package/dist/components/panel/multiplicity_bk.js +0 -280
- package/dist/helpers/carbonFeatures_bk.js +0 -45
- package/dist/helpers/cfg_bk.js +0 -80
- package/dist/helpers/chem_bk.js +0 -787
- package/dist/helpers/compass_bk.js +0 -149
- package/dist/helpers/converter_bk.js +0 -96
- package/dist/helpers/extractPeaksEdit_bk.js +0 -53
- package/dist/helpers/format_bk.js +0 -497
- package/dist/index_bk.js +0 -640
- package/dist/layer_content_bk.js +0 -105
- package/dist/layer_init_bk.js +0 -235
- package/dist/layer_prism_bk.js +0 -133
- package/dist/reducers/reducer_edit_peak_bk.js +0 -108
- package/dist/reducers/reducer_integration_bk.js +0 -134
- package/dist/reducers/reducer_jcamp_bk.js +0 -71
- package/dist/reducers/reducer_multiplicity_bk.js +0 -126
- package/dist/reducers/reducer_shift_bk.js +0 -88
- package/dist/reducers/reducer_voltammetry_bk.js +0 -287
- package/dist/sagas/saga_edit_peak_bk.js +0 -73
- package/dist/sagas/saga_multi_entities_bk.js +0 -106
- package/dist/sagas/saga_multiplicity_bk.js +0 -351
- package/dist/sagas/saga_ui_bk.js +0 -453
|
@@ -5,14 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
8
|
var _reduxUndo = _interopRequireDefault(require("redux-undo"));
|
|
10
9
|
var _action_type = require("../constants/action_type");
|
|
11
10
|
var _integration = require("../helpers/integration");
|
|
12
11
|
var _undo_redo_config = require("./undo_redo_config");
|
|
13
12
|
/* eslint-disable prefer-object-spread, default-param-last */
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
const initialState = {
|
|
16
15
|
selectedIdx: 0,
|
|
17
16
|
integrations: [{
|
|
18
17
|
stack: [],
|
|
@@ -22,162 +21,196 @@ var initialState = {
|
|
|
22
21
|
edited: false
|
|
23
22
|
}]
|
|
24
23
|
};
|
|
25
|
-
|
|
24
|
+
const defaultEmptyIntegration = {
|
|
26
25
|
stack: [],
|
|
27
26
|
refArea: 1,
|
|
28
27
|
refFactor: 1,
|
|
29
28
|
shift: 0,
|
|
30
29
|
edited: false
|
|
31
30
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
newData
|
|
35
|
-
curveIdx
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
const addToStack = (state, action) => {
|
|
32
|
+
const {
|
|
33
|
+
newData,
|
|
34
|
+
curveIdx
|
|
35
|
+
} = action.payload;
|
|
36
|
+
const {
|
|
37
|
+
integrations
|
|
38
|
+
} = state;
|
|
39
|
+
let selectedIntegration = integrations[curveIdx];
|
|
38
40
|
if (selectedIntegration === false || selectedIntegration === undefined) {
|
|
39
41
|
selectedIntegration = defaultEmptyIntegration;
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
stack
|
|
43
|
-
refArea
|
|
44
|
-
shift
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
const {
|
|
44
|
+
stack,
|
|
45
|
+
refArea,
|
|
46
|
+
shift
|
|
47
|
+
} = selectedIntegration;
|
|
48
|
+
const {
|
|
49
|
+
xExtent,
|
|
50
|
+
data
|
|
51
|
+
} = newData;
|
|
52
|
+
const {
|
|
53
|
+
xL,
|
|
54
|
+
xU
|
|
55
|
+
} = xExtent;
|
|
49
56
|
if (!xL || !xU || xU - xL === 0) {
|
|
50
57
|
return state;
|
|
51
58
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
const area = (0, _integration.getArea)(xL, xU, data);
|
|
60
|
+
const defaultRefArea = stack.length === 0 ? area : refArea;
|
|
61
|
+
const absoluteArea = (0, _integration.getAbsoluteArea)(xL, xU, data); // area depends on y baseline
|
|
62
|
+
const newStack = [...stack, {
|
|
56
63
|
xL: xL + shift,
|
|
57
64
|
xU: xU + shift,
|
|
58
|
-
area
|
|
59
|
-
absoluteArea
|
|
60
|
-
}]
|
|
61
|
-
|
|
65
|
+
area,
|
|
66
|
+
absoluteArea
|
|
67
|
+
}];
|
|
68
|
+
const newIntegration = Object.assign({}, selectedIntegration, {
|
|
62
69
|
stack: newStack,
|
|
63
70
|
refArea: defaultRefArea
|
|
64
71
|
});
|
|
65
|
-
|
|
72
|
+
const newArrIntegration = [...integrations];
|
|
73
|
+
newArrIntegration[curveIdx] = newIntegration;
|
|
66
74
|
return Object.assign({}, state, {
|
|
67
|
-
integrations:
|
|
75
|
+
integrations: newArrIntegration,
|
|
68
76
|
selectedIdx: curveIdx
|
|
69
77
|
});
|
|
70
78
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
dataToRemove
|
|
74
|
-
curveIdx
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
const rmFromStack = (state, action) => {
|
|
80
|
+
const {
|
|
81
|
+
dataToRemove,
|
|
82
|
+
curveIdx
|
|
83
|
+
} = action.payload;
|
|
84
|
+
const {
|
|
85
|
+
xL,
|
|
86
|
+
xU,
|
|
87
|
+
xExtent
|
|
88
|
+
} = dataToRemove;
|
|
89
|
+
const {
|
|
90
|
+
integrations
|
|
91
|
+
} = state;
|
|
92
|
+
const selectedIntegration = integrations[curveIdx];
|
|
93
|
+
const {
|
|
94
|
+
stack
|
|
95
|
+
} = selectedIntegration;
|
|
96
|
+
let [txL, txU] = [0, 0];
|
|
83
97
|
if (xL && xU) {
|
|
84
98
|
// rm click integration
|
|
85
|
-
txL = xL;
|
|
86
|
-
txU = xU;
|
|
99
|
+
[txL, txU] = [xL, xU];
|
|
87
100
|
} else if (xExtent) {
|
|
88
101
|
// rm click multiplicity
|
|
89
|
-
|
|
90
|
-
txL = _ref[0];
|
|
91
|
-
txU = _ref[1];
|
|
102
|
+
[txL, txU] = [xExtent.xL, xExtent.xU];
|
|
92
103
|
} else {
|
|
93
104
|
return state;
|
|
94
105
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
});
|
|
98
|
-
var newIntegration = Object.assign({}, selectedIntegration, {
|
|
106
|
+
const newStack = stack.filter(k => k.xL !== txL && k.xU !== txU);
|
|
107
|
+
const newIntegration = Object.assign({}, selectedIntegration, {
|
|
99
108
|
stack: newStack
|
|
100
109
|
});
|
|
101
|
-
|
|
110
|
+
const newArrIntegration = [...integrations];
|
|
111
|
+
newArrIntegration[curveIdx] = newIntegration;
|
|
102
112
|
return Object.assign({}, state, {
|
|
103
|
-
integrations:
|
|
113
|
+
integrations: newArrIntegration,
|
|
104
114
|
selectedIdx: curveIdx
|
|
105
115
|
});
|
|
106
116
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
refData
|
|
110
|
-
curveIdx
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
117
|
+
const setRef = (state, action) => {
|
|
118
|
+
const {
|
|
119
|
+
refData,
|
|
120
|
+
curveIdx
|
|
121
|
+
} = action.payload;
|
|
122
|
+
const {
|
|
123
|
+
integrations
|
|
124
|
+
} = state;
|
|
125
|
+
const selectedIntegration = integrations[curveIdx];
|
|
126
|
+
const {
|
|
127
|
+
stack
|
|
128
|
+
} = selectedIntegration;
|
|
129
|
+
const {
|
|
130
|
+
xL,
|
|
131
|
+
xU
|
|
132
|
+
} = refData;
|
|
133
|
+
const ref = stack.filter(k => k.xL === xL && k.xU === xU)[0];
|
|
119
134
|
if (!ref) {
|
|
120
135
|
return state;
|
|
121
136
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
refArea
|
|
137
|
+
const refArea = ref.area;
|
|
138
|
+
const newIntegration = Object.assign({}, selectedIntegration, {
|
|
139
|
+
refArea
|
|
125
140
|
});
|
|
126
|
-
|
|
141
|
+
const newArrIntegration = [...integrations];
|
|
142
|
+
newArrIntegration[curveIdx] = newIntegration;
|
|
127
143
|
return Object.assign({}, state, {
|
|
128
|
-
integrations:
|
|
144
|
+
integrations: newArrIntegration,
|
|
129
145
|
selectedIdx: curveIdx
|
|
130
146
|
});
|
|
131
147
|
};
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
148
|
+
const setFkr = (state, action) => {
|
|
149
|
+
const {
|
|
150
|
+
payload
|
|
151
|
+
} = action;
|
|
152
|
+
const {
|
|
153
|
+
curveIdx,
|
|
154
|
+
factor
|
|
155
|
+
} = payload;
|
|
156
|
+
const {
|
|
157
|
+
integrations
|
|
158
|
+
} = state;
|
|
159
|
+
const selectedIntegration = integrations[curveIdx];
|
|
160
|
+
const val = parseFloat(factor);
|
|
161
|
+
const refFactor = val < 0.01 ? 0.01 : val;
|
|
162
|
+
const newIntegration = Object.assign({}, selectedIntegration, {
|
|
163
|
+
refFactor
|
|
142
164
|
});
|
|
143
|
-
|
|
165
|
+
const newArrIntegration = [...integrations];
|
|
166
|
+
newArrIntegration[curveIdx] = newIntegration;
|
|
144
167
|
return Object.assign({}, state, {
|
|
145
|
-
integrations:
|
|
168
|
+
integrations: newArrIntegration
|
|
146
169
|
});
|
|
147
170
|
};
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
171
|
+
const setShift = (state, action) => {
|
|
172
|
+
const {
|
|
173
|
+
selectedIdx,
|
|
174
|
+
integrations
|
|
175
|
+
} = state;
|
|
176
|
+
const selectedIntegration = integrations[selectedIdx];
|
|
177
|
+
const shift = action.payload.prevOffset;
|
|
178
|
+
const newIntegration = Object.assign({}, selectedIntegration, {
|
|
179
|
+
shift
|
|
155
180
|
});
|
|
156
|
-
|
|
181
|
+
const newArrIntegration = [...integrations];
|
|
182
|
+
newArrIntegration[selectedIdx] = newIntegration;
|
|
157
183
|
return Object.assign({}, state, {
|
|
158
|
-
integrations:
|
|
184
|
+
integrations: newArrIntegration
|
|
159
185
|
});
|
|
160
186
|
};
|
|
161
|
-
|
|
162
|
-
|
|
187
|
+
const resetAll = (state, action) => {
|
|
188
|
+
const newState = action.payload;
|
|
163
189
|
return Object.assign({}, state, newState);
|
|
164
190
|
};
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
191
|
+
const clearAll = (state, action) => {
|
|
192
|
+
const {
|
|
193
|
+
payload
|
|
194
|
+
} = action;
|
|
195
|
+
const {
|
|
196
|
+
curveIdx
|
|
197
|
+
} = payload;
|
|
198
|
+
const {
|
|
199
|
+
integrations
|
|
200
|
+
} = state;
|
|
201
|
+
const newIntegration = Object.assign({}, defaultEmptyIntegration, {
|
|
170
202
|
edited: true
|
|
171
203
|
});
|
|
172
|
-
|
|
204
|
+
const newArrIntegration = [...integrations];
|
|
205
|
+
newArrIntegration[curveIdx] = newIntegration;
|
|
173
206
|
return Object.assign({}, state, {
|
|
174
|
-
integrations:
|
|
207
|
+
integrations: newArrIntegration,
|
|
175
208
|
selectedIdx: curveIdx
|
|
176
209
|
});
|
|
177
210
|
};
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
211
|
+
const integrationReducer = function () {
|
|
212
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
213
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
181
214
|
switch (action.type) {
|
|
182
215
|
case _action_type.UI.SWEEP.SELECT_INTEGRATION:
|
|
183
216
|
return addToStack(state, action);
|
|
@@ -199,6 +232,5 @@ var integrationReducer = function integrationReducer() {
|
|
|
199
232
|
return _undo_redo_config.undoRedoActions.indexOf(action.type) >= 0 ? Object.assign({}, state) : state;
|
|
200
233
|
}
|
|
201
234
|
};
|
|
202
|
-
|
|
203
|
-
var _default = undoableIntegrationReducer;
|
|
204
|
-
exports.default = _default;
|
|
235
|
+
const undoableIntegrationReducer = (0, _reduxUndo.default)(integrationReducer, _undo_redo_config.undoRedoConfig);
|
|
236
|
+
var _default = exports.default = undoableIntegrationReducer;
|
|
@@ -1,83 +1,89 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
7
|
var _action_type = require("../constants/action_type");
|
|
10
8
|
/* eslint-disable prefer-object-spread, default-param-last */
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
const initialState = {
|
|
13
11
|
selectedIdx: 0,
|
|
14
12
|
jcamps: [{
|
|
15
13
|
others: [],
|
|
16
14
|
addOthersCb: false
|
|
17
15
|
}]
|
|
18
16
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
const addOthers = (state, _ref) => {
|
|
18
|
+
let {
|
|
19
|
+
others,
|
|
20
|
+
addOthersCb
|
|
21
|
+
} = _ref;
|
|
22
|
+
const {
|
|
23
|
+
selectedIdx,
|
|
24
|
+
jcamps
|
|
25
|
+
} = state;
|
|
26
|
+
const selectedJcamp = jcamps[selectedIdx];
|
|
25
27
|
if (selectedJcamp.others.length > 5) return state;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
others: [].concat((0, _toConsumableArray2.default)(selectedJcamp.others), (0, _toConsumableArray2.default)(decoOthers)).slice(0, 5),
|
|
33
|
-
addOthersCb: addOthersCb
|
|
28
|
+
const decoOthers = others.map(o => Object.assign({}, o, {
|
|
29
|
+
show: true
|
|
30
|
+
}));
|
|
31
|
+
const newJcamp = Object.assign({}, selectedJcamp, {
|
|
32
|
+
others: [...decoOthers].slice(0, 5),
|
|
33
|
+
addOthersCb
|
|
34
34
|
});
|
|
35
35
|
jcamps[selectedIdx] = newJcamp;
|
|
36
36
|
return Object.assign({}, state, {
|
|
37
|
-
jcamps
|
|
37
|
+
jcamps
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
const rmOthersOne = (state, payload) => {
|
|
41
|
+
const {
|
|
42
|
+
selectedIdx,
|
|
43
|
+
jcamps
|
|
44
|
+
} = state;
|
|
45
|
+
const selectedJcamp = jcamps[selectedIdx];
|
|
46
|
+
const idx = payload;
|
|
47
|
+
const {
|
|
48
|
+
others
|
|
49
|
+
} = selectedJcamp;
|
|
50
|
+
const nextOther = others.filter((_, i) => i !== idx);
|
|
51
|
+
const newJcamp = Object.assign({}, selectedJcamp, {
|
|
50
52
|
others: nextOther
|
|
51
53
|
});
|
|
52
54
|
jcamps[selectedIdx] = newJcamp;
|
|
53
55
|
return Object.assign({}, state, {
|
|
54
|
-
jcamps
|
|
56
|
+
jcamps
|
|
55
57
|
});
|
|
56
58
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
const toggleShow = (state, payload) => {
|
|
60
|
+
const {
|
|
61
|
+
selectedIdx,
|
|
62
|
+
jcamps
|
|
63
|
+
} = state;
|
|
64
|
+
const selectedJcamp = jcamps[selectedIdx];
|
|
65
|
+
const idx = payload;
|
|
66
|
+
const {
|
|
67
|
+
others
|
|
68
|
+
} = selectedJcamp;
|
|
69
|
+
const nextOthers = others.map((o, i) => {
|
|
64
70
|
if (i !== idx) return o;
|
|
65
|
-
|
|
71
|
+
const currentShow = o.show;
|
|
66
72
|
return Object.assign({}, o, {
|
|
67
73
|
show: !currentShow
|
|
68
74
|
});
|
|
69
75
|
});
|
|
70
|
-
|
|
76
|
+
const newJcamp = Object.assign({}, selectedJcamp, {
|
|
71
77
|
others: nextOthers
|
|
72
78
|
});
|
|
73
79
|
jcamps[selectedIdx] = newJcamp;
|
|
74
80
|
return Object.assign({}, state, {
|
|
75
|
-
jcamps
|
|
81
|
+
jcamps
|
|
76
82
|
});
|
|
77
83
|
};
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
const layoutReducer = function () {
|
|
85
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
86
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
81
87
|
switch (action.type) {
|
|
82
88
|
case _action_type.JCAMP.ADD_OTHERS:
|
|
83
89
|
return addOthers(state, action.payload);
|
|
@@ -93,5 +99,4 @@ var layoutReducer = function layoutReducer() {
|
|
|
93
99
|
return state;
|
|
94
100
|
}
|
|
95
101
|
};
|
|
96
|
-
var _default = layoutReducer;
|
|
97
|
-
exports.default = _default;
|
|
102
|
+
var _default = exports.default = layoutReducer;
|
|
@@ -8,10 +8,10 @@ var _action_type = require("../constants/action_type");
|
|
|
8
8
|
var _list_layout = require("../constants/list_layout");
|
|
9
9
|
/* eslint-disable prefer-object-spread, default-param-last */
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const initialState = _list_layout.LIST_LAYOUT.C13;
|
|
12
|
+
const layoutReducer = function () {
|
|
13
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
14
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
15
15
|
switch (action.type) {
|
|
16
16
|
case _action_type.LAYOUT.UPDATE:
|
|
17
17
|
return action.payload;
|
|
@@ -21,5 +21,4 @@ var layoutReducer = function layoutReducer() {
|
|
|
21
21
|
return state;
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
var _default = layoutReducer;
|
|
25
|
-
exports.default = _default;
|
|
24
|
+
var _default = exports.default = layoutReducer;
|
|
@@ -7,14 +7,13 @@ exports.default = void 0;
|
|
|
7
7
|
/* eslint-disable prefer-object-spread, default-param-last */
|
|
8
8
|
// import { MANAGER } from '../constants/action_type';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const initialState = {};
|
|
11
|
+
const managerReducer = function () {
|
|
12
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
13
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
14
14
|
switch (action.type) {
|
|
15
15
|
default:
|
|
16
16
|
return state;
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
var _default = managerReducer;
|
|
20
|
-
exports.default = _default;
|
|
19
|
+
var _default = exports.default = managerReducer;
|
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _action_type = require("../constants/action_type");
|
|
8
8
|
/* eslint-disable prefer-object-spread, default-param-last */
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const initialState = {
|
|
11
11
|
peaks: {
|
|
12
12
|
intervalL: null,
|
|
13
13
|
intervalR: null,
|
|
@@ -15,9 +15,9 @@ var initialState = {
|
|
|
15
15
|
deltaX: null
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const metaReducer = function () {
|
|
19
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
20
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
21
21
|
switch (action.type) {
|
|
22
22
|
case _action_type.META.UPDATE_PEAKS_RDC:
|
|
23
23
|
return Object.assign({}, state, action.payload);
|
|
@@ -25,5 +25,4 @@ var metaReducer = function metaReducer() {
|
|
|
25
25
|
return state;
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
-
var _default = metaReducer;
|
|
29
|
-
exports.default = _default;
|
|
28
|
+
var _default = exports.default = metaReducer;
|