@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
|
@@ -9,7 +9,7 @@ var _action_type = require("../constants/action_type");
|
|
|
9
9
|
var _format = _interopRequireDefault(require("../helpers/format"));
|
|
10
10
|
/* eslint-disable prefer-object-spread, default-param-last */
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const initialState = {
|
|
13
13
|
isAscend: false,
|
|
14
14
|
isIntensity: true,
|
|
15
15
|
decimal: 2,
|
|
@@ -17,14 +17,12 @@ var initialState = {
|
|
|
17
17
|
name: 'empty'
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
27
|
-
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
20
|
+
const updateOperation = action => ({
|
|
21
|
+
operation: action.payload || initialState.operation
|
|
22
|
+
});
|
|
23
|
+
const submitReducer = function () {
|
|
24
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
25
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
28
26
|
switch (action.type) {
|
|
29
27
|
case _action_type.SUBMIT.TOGGLE_IS_ASCEND:
|
|
30
28
|
return Object.assign({}, state, {
|
|
@@ -42,16 +40,16 @@ var submitReducer = function submitReducer() {
|
|
|
42
40
|
});
|
|
43
41
|
case _action_type.LAYOUT.UPDATE:
|
|
44
42
|
{
|
|
45
|
-
|
|
43
|
+
const decimal = _format.default.spectraDigit(action.payload);
|
|
46
44
|
return Object.assign({}, state, {
|
|
47
|
-
decimal
|
|
45
|
+
decimal
|
|
48
46
|
});
|
|
49
47
|
}
|
|
50
48
|
case _action_type.MANAGER.RESETALL:
|
|
51
49
|
{
|
|
52
|
-
|
|
50
|
+
const decimal = _format.default.spectraDigit(action.payload.operation.layout);
|
|
53
51
|
return Object.assign({}, state, {
|
|
54
|
-
decimal
|
|
52
|
+
decimal,
|
|
55
53
|
isIntensity: true,
|
|
56
54
|
isAscend: false
|
|
57
55
|
});
|
|
@@ -60,5 +58,4 @@ var submitReducer = function submitReducer() {
|
|
|
60
58
|
return state;
|
|
61
59
|
}
|
|
62
60
|
};
|
|
63
|
-
var _default = submitReducer;
|
|
64
|
-
exports.default = _default;
|
|
61
|
+
var _default = exports.default = submitReducer;
|
|
@@ -7,15 +7,15 @@ 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
|
isEdit: true,
|
|
12
12
|
value: false,
|
|
13
13
|
upper: false,
|
|
14
14
|
lower: false
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const thresholdReducer = function () {
|
|
17
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
18
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
19
19
|
switch (action.type) {
|
|
20
20
|
case _action_type.THRESHOLD.UPDATE_VALUE:
|
|
21
21
|
return Object.assign({}, state, {
|
|
@@ -49,5 +49,4 @@ var thresholdReducer = function thresholdReducer() {
|
|
|
49
49
|
return state;
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
var _default = thresholdReducer;
|
|
53
|
-
exports.default = _default;
|
|
52
|
+
var _default = exports.default = thresholdReducer;
|
|
@@ -8,7 +8,7 @@ var _action_type = require("../constants/action_type");
|
|
|
8
8
|
var _list_ui = require("../constants/list_ui");
|
|
9
9
|
/* eslint-disable prefer-object-spread, default-param-last */
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const initialState = {
|
|
12
12
|
viewer: _list_ui.LIST_UI_VIEWER_TYPE.SPECTRUM,
|
|
13
13
|
sweepType: _list_ui.LIST_UI_SWEEP_TYPE.ZOOMIN,
|
|
14
14
|
sweepExtent: {
|
|
@@ -17,9 +17,9 @@ var initialState = {
|
|
|
17
17
|
},
|
|
18
18
|
jcampIdx: 0
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const uiReducer = function () {
|
|
21
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
22
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
23
23
|
switch (action.type) {
|
|
24
24
|
case _action_type.UI.VIEWER.SET_TYPE:
|
|
25
25
|
return Object.assign({}, state, {
|
|
@@ -48,5 +48,4 @@ var uiReducer = function uiReducer() {
|
|
|
48
48
|
return state;
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
var _default = uiReducer;
|
|
52
|
-
exports.default = _default;
|
|
51
|
+
var _default = exports.default = uiReducer;
|
|
@@ -1,40 +1,45 @@
|
|
|
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 _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
7
|
var _action_type = require("../constants/action_type");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
/* eslint-disable prefer-object-spread, default-param-last */
|
|
9
|
+
|
|
10
|
+
const initialState = {
|
|
13
11
|
spectraList: []
|
|
14
12
|
};
|
|
15
|
-
|
|
13
|
+
const initSpectra = {
|
|
16
14
|
list: [],
|
|
17
15
|
selectedIdx: -1,
|
|
18
16
|
isWorkMaxPeak: true,
|
|
19
17
|
jcampIdx: -1
|
|
20
18
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const addPairPeak = (state, action) => {
|
|
20
|
+
const {
|
|
21
|
+
payload
|
|
22
|
+
} = action;
|
|
23
|
+
const {
|
|
24
|
+
spectraList
|
|
25
|
+
} = state;
|
|
24
26
|
if (payload !== undefined) {
|
|
25
|
-
|
|
27
|
+
let spectra = spectraList[payload];
|
|
26
28
|
if (!spectra) {
|
|
27
29
|
spectra = initSpectra;
|
|
28
30
|
spectraList.push(spectra);
|
|
29
31
|
}
|
|
30
|
-
|
|
31
|
-
list
|
|
32
|
-
selectedIdx
|
|
33
|
-
|
|
32
|
+
const {
|
|
33
|
+
list,
|
|
34
|
+
selectedIdx
|
|
35
|
+
} = spectra;
|
|
36
|
+
let index = selectedIdx;
|
|
34
37
|
index += 1;
|
|
35
|
-
|
|
38
|
+
const newList = list.map(item => {
|
|
36
39
|
// eslint-disable-line
|
|
37
|
-
return
|
|
40
|
+
return {
|
|
41
|
+
...item
|
|
42
|
+
};
|
|
38
43
|
});
|
|
39
44
|
newList.push({
|
|
40
45
|
min: null,
|
|
@@ -45,48 +50,66 @@ var addPairPeak = function addPairPeak(state, action) {
|
|
|
45
50
|
selectedIdx: index
|
|
46
51
|
});
|
|
47
52
|
return Object.assign({}, state, {
|
|
48
|
-
spectraList
|
|
53
|
+
spectraList
|
|
49
54
|
});
|
|
50
55
|
}
|
|
51
56
|
return state;
|
|
52
57
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
const removePairPeak = (state, action) => {
|
|
59
|
+
const {
|
|
60
|
+
payload
|
|
61
|
+
} = action;
|
|
62
|
+
const {
|
|
63
|
+
spectraList
|
|
64
|
+
} = state;
|
|
56
65
|
if (payload !== undefined) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
const {
|
|
67
|
+
index,
|
|
68
|
+
jcampIdx
|
|
69
|
+
} = payload;
|
|
70
|
+
const spectra = spectraList[jcampIdx];
|
|
60
71
|
if (spectra) {
|
|
61
|
-
|
|
72
|
+
const {
|
|
73
|
+
list
|
|
74
|
+
} = spectra;
|
|
62
75
|
list.splice(index, 1);
|
|
63
76
|
spectraList[jcampIdx] = Object.assign({}, spectra, {
|
|
64
|
-
list
|
|
77
|
+
list,
|
|
65
78
|
selectedIdx: index
|
|
66
79
|
});
|
|
67
80
|
return Object.assign({}, state, {
|
|
68
|
-
spectraList
|
|
81
|
+
spectraList
|
|
69
82
|
});
|
|
70
83
|
}
|
|
71
84
|
return state;
|
|
72
85
|
}
|
|
73
86
|
return state;
|
|
74
87
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
88
|
+
const addPeak = function (state, action) {
|
|
89
|
+
let isMax = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
90
|
+
const {
|
|
91
|
+
payload
|
|
92
|
+
} = action;
|
|
93
|
+
const {
|
|
94
|
+
spectraList
|
|
95
|
+
} = state;
|
|
79
96
|
if (payload) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
97
|
+
const {
|
|
98
|
+
peak,
|
|
99
|
+
index,
|
|
100
|
+
jcampIdx
|
|
101
|
+
} = payload;
|
|
102
|
+
const spectra = spectraList[jcampIdx];
|
|
103
|
+
const {
|
|
104
|
+
list
|
|
105
|
+
} = spectra;
|
|
106
|
+
const newList = list.map(item => {
|
|
86
107
|
// eslint-disable-line
|
|
87
|
-
return
|
|
108
|
+
return {
|
|
109
|
+
...item
|
|
110
|
+
};
|
|
88
111
|
});
|
|
89
|
-
|
|
112
|
+
let pairPeak = newList[index];
|
|
90
113
|
if (isMax) {
|
|
91
114
|
pairPeak = Object.assign({}, pairPeak, {
|
|
92
115
|
max: peak
|
|
@@ -100,25 +123,33 @@ var addPeak = function addPeak(state, action) {
|
|
|
100
123
|
spectraList[jcampIdx] = Object.assign({}, spectra, {
|
|
101
124
|
list: newList,
|
|
102
125
|
selectedIdx: index,
|
|
103
|
-
jcampIdx
|
|
126
|
+
jcampIdx
|
|
104
127
|
});
|
|
105
128
|
return Object.assign({}, state, {
|
|
106
|
-
spectraList
|
|
129
|
+
spectraList
|
|
107
130
|
});
|
|
108
131
|
}
|
|
109
132
|
return state;
|
|
110
133
|
};
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
134
|
+
const removePeak = function (state, action) {
|
|
135
|
+
let isMax = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
136
|
+
const {
|
|
137
|
+
payload
|
|
138
|
+
} = action;
|
|
139
|
+
const {
|
|
140
|
+
spectraList
|
|
141
|
+
} = state;
|
|
115
142
|
if (payload) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
143
|
+
const {
|
|
144
|
+
index,
|
|
145
|
+
jcampIdx
|
|
146
|
+
} = payload;
|
|
147
|
+
const spectra = spectraList[jcampIdx];
|
|
148
|
+
const {
|
|
149
|
+
list
|
|
150
|
+
} = spectra;
|
|
151
|
+
const newList = list;
|
|
152
|
+
const pairPeak = newList[index];
|
|
122
153
|
if (isMax) {
|
|
123
154
|
pairPeak.max = null;
|
|
124
155
|
} else {
|
|
@@ -128,101 +159,131 @@ var removePeak = function removePeak(state, action) {
|
|
|
128
159
|
spectraList[jcampIdx] = Object.assign({}, spectra, {
|
|
129
160
|
list: newList,
|
|
130
161
|
selectedIdx: index,
|
|
131
|
-
jcampIdx
|
|
162
|
+
jcampIdx
|
|
132
163
|
});
|
|
133
164
|
return Object.assign({}, state, {
|
|
134
|
-
spectraList
|
|
165
|
+
spectraList
|
|
135
166
|
});
|
|
136
167
|
}
|
|
137
168
|
return state;
|
|
138
169
|
};
|
|
139
|
-
|
|
140
|
-
|
|
170
|
+
const selectPairPeak = (state, action) => {
|
|
171
|
+
const {
|
|
172
|
+
payload
|
|
173
|
+
} = action;
|
|
141
174
|
if (payload !== undefined) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
175
|
+
const {
|
|
176
|
+
spectraList
|
|
177
|
+
} = state;
|
|
178
|
+
const {
|
|
179
|
+
index,
|
|
180
|
+
jcampIdx
|
|
181
|
+
} = payload;
|
|
182
|
+
const spectra = spectraList[jcampIdx];
|
|
146
183
|
if (spectra) {
|
|
147
184
|
spectraList[jcampIdx] = Object.assign({}, spectra, {
|
|
148
185
|
selectedIdx: index
|
|
149
186
|
});
|
|
150
187
|
return Object.assign({}, state, {
|
|
151
|
-
spectraList
|
|
188
|
+
spectraList
|
|
152
189
|
});
|
|
153
190
|
}
|
|
154
191
|
return state;
|
|
155
192
|
}
|
|
156
193
|
return state;
|
|
157
194
|
};
|
|
158
|
-
|
|
159
|
-
|
|
195
|
+
const setWorkWithMaxPeak = (state, action) => {
|
|
196
|
+
const {
|
|
197
|
+
payload
|
|
198
|
+
} = action;
|
|
160
199
|
if (payload !== undefined) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
200
|
+
const {
|
|
201
|
+
spectraList
|
|
202
|
+
} = state;
|
|
203
|
+
const {
|
|
204
|
+
isMax,
|
|
205
|
+
jcampIdx
|
|
206
|
+
} = payload;
|
|
207
|
+
const spectra = spectraList[jcampIdx];
|
|
165
208
|
if (spectra) {
|
|
166
209
|
spectraList[jcampIdx] = Object.assign({}, spectra, {
|
|
167
210
|
isWorkMaxPeak: isMax
|
|
168
211
|
});
|
|
169
212
|
return Object.assign({}, state, {
|
|
170
|
-
spectraList
|
|
213
|
+
spectraList
|
|
171
214
|
});
|
|
172
215
|
}
|
|
173
216
|
return state;
|
|
174
217
|
}
|
|
175
218
|
return state;
|
|
176
219
|
};
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
220
|
+
const addPecker = (state, action) => {
|
|
221
|
+
const {
|
|
222
|
+
payload
|
|
223
|
+
} = action;
|
|
224
|
+
const {
|
|
225
|
+
spectraList
|
|
226
|
+
} = state;
|
|
180
227
|
if (payload) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
228
|
+
const {
|
|
229
|
+
peak,
|
|
230
|
+
index,
|
|
231
|
+
jcampIdx
|
|
232
|
+
} = payload;
|
|
233
|
+
const spectra = spectraList[jcampIdx];
|
|
234
|
+
const {
|
|
235
|
+
list
|
|
236
|
+
} = spectra;
|
|
237
|
+
const newList = list;
|
|
238
|
+
const pairPeak = newList[index];
|
|
188
239
|
pairPeak.pecker = peak;
|
|
189
240
|
newList[index] = pairPeak;
|
|
190
241
|
spectraList[jcampIdx] = Object.assign({}, spectra, {
|
|
191
242
|
list: newList,
|
|
192
243
|
selectedIdx: index,
|
|
193
|
-
jcampIdx
|
|
244
|
+
jcampIdx
|
|
194
245
|
});
|
|
195
246
|
return Object.assign({}, state, {
|
|
196
|
-
spectraList
|
|
247
|
+
spectraList
|
|
197
248
|
});
|
|
198
249
|
}
|
|
199
250
|
return state;
|
|
200
251
|
};
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
252
|
+
const removePecker = (state, action) => {
|
|
253
|
+
const {
|
|
254
|
+
payload
|
|
255
|
+
} = action;
|
|
256
|
+
const {
|
|
257
|
+
spectraList
|
|
258
|
+
} = state;
|
|
204
259
|
if (payload) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
260
|
+
const {
|
|
261
|
+
index,
|
|
262
|
+
jcampIdx
|
|
263
|
+
} = payload;
|
|
264
|
+
const spectra = spectraList[jcampIdx];
|
|
265
|
+
const {
|
|
266
|
+
list
|
|
267
|
+
} = spectra;
|
|
268
|
+
const newList = list;
|
|
269
|
+
const pairPeak = newList[index];
|
|
211
270
|
pairPeak.pecker = null;
|
|
212
271
|
newList[index] = pairPeak;
|
|
213
272
|
spectraList[jcampIdx] = Object.assign({}, spectra, {
|
|
214
273
|
list: newList,
|
|
215
274
|
selectedIdx: index,
|
|
216
|
-
jcampIdx
|
|
275
|
+
jcampIdx
|
|
217
276
|
});
|
|
218
277
|
return Object.assign({}, state, {
|
|
219
|
-
spectraList
|
|
278
|
+
spectraList
|
|
220
279
|
});
|
|
221
280
|
}
|
|
222
281
|
return state;
|
|
223
282
|
};
|
|
224
|
-
|
|
225
|
-
|
|
283
|
+
const setRef = (state, action) => {
|
|
284
|
+
const {
|
|
285
|
+
payload
|
|
286
|
+
} = action;
|
|
226
287
|
// const { spectraList } = state;
|
|
227
288
|
if (payload) {
|
|
228
289
|
// const { index, jcampIdx } = payload;
|
|
@@ -245,9 +306,9 @@ var setRef = function setRef(state, action) {
|
|
|
245
306
|
}
|
|
246
307
|
return state;
|
|
247
308
|
};
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
309
|
+
const cyclicVoltaReducer = function () {
|
|
310
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
311
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
251
312
|
switch (action.type) {
|
|
252
313
|
case _action_type.CYCLIC_VOLTA_METRY.ADD_PAIR_PEAKS:
|
|
253
314
|
return addPairPeak(state, action);
|
|
@@ -279,5 +340,4 @@ var cyclicVoltaReducer = function cyclicVoltaReducer() {
|
|
|
279
340
|
return state;
|
|
280
341
|
}
|
|
281
342
|
};
|
|
282
|
-
var _default = cyclicVoltaReducer;
|
|
283
|
-
exports.default = _default;
|
|
343
|
+
var _default = exports.default = cyclicVoltaReducer;
|
|
@@ -8,10 +8,10 @@ var _list_wavelength = require("../constants/list_wavelength");
|
|
|
8
8
|
var _action_type = require("../constants/action_type");
|
|
9
9
|
/* eslint-disable default-param-last */
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const initialState = _list_wavelength.LIST_WAVE_LENGTH[0];
|
|
12
|
+
const wavelengthReducer = 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.XRD.UPDATE_WAVE_LENGTH:
|
|
17
17
|
return action.payload;
|
|
@@ -19,5 +19,4 @@ var wavelengthReducer = function wavelengthReducer() {
|
|
|
19
19
|
return state;
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
var _default = wavelengthReducer;
|
|
23
|
-
exports.default = _default;
|
|
22
|
+
var _default = exports.default = wavelengthReducer;
|
|
@@ -6,14 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.undoRedoConfig = exports.undoRedoActions = void 0;
|
|
7
7
|
var _reduxUndo = require("redux-undo");
|
|
8
8
|
var _action_type = require("../constants/action_type");
|
|
9
|
-
|
|
10
|
-
exports.
|
|
11
|
-
var undoRedoConfig = {
|
|
9
|
+
const undoRedoActions = exports.undoRedoActions = [_action_type.EDITPEAK.ADD_POSITIVE, _action_type.EDITPEAK.ADD_NEGATIVE, _action_type.EDITPEAK.RM_POSITIVE, _action_type.EDITPEAK.RM_NEGATIVE, _action_type.EDITPEAK.SHIFT, _action_type.MANAGER.RESETALL, _action_type.MANAGER.RESETSHIFT, _action_type.MANAGER.RESET_INIT_COMMON, _action_type.MANAGER.RESET_INIT_NMR, _action_type.MANAGER.RESET_INIT_MS, _action_type.MANAGER.RESET_INIT_COMMON_WITH_INTERGATION, _action_type.UI.SWEEP.SELECT_INTEGRATION, _action_type.UI.SWEEP.SELECT_MULTIPLICITY_RDC, _action_type.INTEGRATION.RM_ONE, _action_type.INTEGRATION.SET_REF, _action_type.INTEGRATION.SET_FKR, _action_type.INTEGRATION.RESET_ALL, _action_type.INTEGRATION.CLEAR_ALL, _action_type.MULTIPLICITY.PEAK_RM_BY_PANEL_RDC, _action_type.MULTIPLICITY.PEAK_RM_BY_UI_RDC, _action_type.MULTIPLICITY.PEAK_ADD_BY_UI_RDC, _action_type.MULTIPLICITY.RESET_ONE_RDC, _action_type.MULTIPLICITY.UPDATE_J, _action_type.MULTIPLICITY.TYPE_SELECT_RDC, _action_type.MULTIPLICITY.ONE_CLICK, _action_type.MULTIPLICITY.ONE_CLICK_BY_UI, _action_type.MULTIPLICITY.RESET_ALL_RDC, _action_type.MULTIPLICITY.CLEAR_ALL];
|
|
10
|
+
const undoRedoConfig = exports.undoRedoConfig = {
|
|
12
11
|
debug: false,
|
|
13
12
|
limit: 10,
|
|
14
13
|
ignoreInitialState: true,
|
|
15
14
|
filter: (0, _reduxUndo.includeAction)(undoRedoActions),
|
|
16
15
|
clearHistoryType: [_action_type.EDITPEAK.SHIFT, _action_type.MANAGER.RESETALL, _action_type.MANAGER.RESETSHIFT, _action_type.MANAGER.RESET_INIT_COMMON, _action_type.MANAGER.RESET_INIT_NMR, _action_type.MANAGER.RESET_INIT_MS, _action_type.MANAGER.RESET_INIT_COMMON_WITH_INTERGATION],
|
|
17
16
|
neverSkipReducer: [_action_type.EDITPEAK.SHIFT, _action_type.MANAGER.RESETALL, _action_type.MANAGER.RESETSHIFT, _action_type.MANAGER.RESET_INIT_COMMON, _action_type.MANAGER.RESET_INIT_NMR, _action_type.MANAGER.RESET_INIT_MS, _action_type.MANAGER.RESET_INIT_COMMON_WITH_INTERGATION]
|
|
18
|
-
};
|
|
19
|
-
exports.undoRedoConfig = undoRedoConfig;
|
|
17
|
+
};
|
package/dist/sagas/index.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _regeneratorRuntime2 = require("@babel/runtime/regenerator");
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = rootSaga;
|
|
9
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
8
|
var _effects = require("redux-saga/effects");
|
|
12
9
|
var _saga_edit_peak = _interopRequireDefault(require("./saga_edit_peak"));
|
|
13
10
|
var _saga_manager = _interopRequireDefault(require("./saga_manager"));
|
|
@@ -15,16 +12,6 @@ var _saga_ui = _interopRequireDefault(require("./saga_ui"));
|
|
|
15
12
|
var _saga_meta = _interopRequireDefault(require("./saga_meta"));
|
|
16
13
|
var _saga_multiplicity = _interopRequireDefault(require("./saga_multiplicity"));
|
|
17
14
|
var _saga_multi_entities = _interopRequireDefault(require("./saga_multi_entities"));
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return _regenerator.default.wrap(function rootSaga$(_context) {
|
|
21
|
-
while (1) switch (_context.prev = _context.next) {
|
|
22
|
-
case 0:
|
|
23
|
-
_context.next = 2;
|
|
24
|
-
return (0, _effects.all)([].concat((0, _toConsumableArray2.default)(_saga_edit_peak.default), (0, _toConsumableArray2.default)(_saga_manager.default), (0, _toConsumableArray2.default)(_saga_ui.default), (0, _toConsumableArray2.default)(_saga_meta.default), (0, _toConsumableArray2.default)(_saga_multiplicity.default), (0, _toConsumableArray2.default)(_saga_multi_entities.default)));
|
|
25
|
-
case 2:
|
|
26
|
-
case "end":
|
|
27
|
-
return _context.stop();
|
|
28
|
-
}
|
|
29
|
-
}, _marked);
|
|
15
|
+
function* rootSaga() {
|
|
16
|
+
yield (0, _effects.all)([..._saga_edit_peak.default, ..._saga_manager.default, ..._saga_ui.default, ..._saga_meta.default, ..._saga_multiplicity.default, ..._saga_multi_entities.default]);
|
|
30
17
|
}
|