@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
|
@@ -1,80 +1,67 @@
|
|
|
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 _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
7
|
var _effects = require("redux-saga/effects");
|
|
10
8
|
var _action_type = require("../constants/action_type");
|
|
11
9
|
var _shift = require("../helpers/shift");
|
|
12
10
|
var _list_shift = require("../constants/list_shift");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
// eslint-disable-line
|
|
65
|
-
prevOffset: absOffset,
|
|
66
|
-
pos: nextPos,
|
|
67
|
-
neg: nextNeg
|
|
68
|
-
})
|
|
69
|
-
});
|
|
70
|
-
case 22:
|
|
71
|
-
case "end":
|
|
72
|
-
return _context.stop();
|
|
73
|
-
}
|
|
74
|
-
}, _marked);
|
|
11
|
+
const getShift = state => state.shift;
|
|
12
|
+
const getEditPeak = state => state.editPeak.present;
|
|
13
|
+
function* addVirtualFactor(action) {
|
|
14
|
+
const originShift = yield (0, _effects.select)(getShift);
|
|
15
|
+
const origEPeak = yield (0, _effects.select)(getEditPeak);
|
|
16
|
+
const {
|
|
17
|
+
payload
|
|
18
|
+
} = action;
|
|
19
|
+
const {
|
|
20
|
+
curveIdx
|
|
21
|
+
} = payload;
|
|
22
|
+
const {
|
|
23
|
+
peaks
|
|
24
|
+
} = origEPeak;
|
|
25
|
+
let currentOriginPeaks = peaks[curveIdx];
|
|
26
|
+
if (currentOriginPeaks === false || currentOriginPeaks === undefined) {
|
|
27
|
+
currentOriginPeaks = {
|
|
28
|
+
prevOffset: 0,
|
|
29
|
+
pos: [],
|
|
30
|
+
neg: []
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
let currentOriginShift = originShift.shifts[curveIdx];
|
|
34
|
+
if (currentOriginShift === false || currentOriginShift === undefined) {
|
|
35
|
+
const shiftNone = _list_shift.LIST_SHIFT_1H[0];
|
|
36
|
+
currentOriginShift = {
|
|
37
|
+
ref: shiftNone,
|
|
38
|
+
peak: false,
|
|
39
|
+
enable: true
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const origRef = currentOriginShift.ref;
|
|
43
|
+
const origApex = currentOriginShift.peak;
|
|
44
|
+
const {
|
|
45
|
+
prevOffset,
|
|
46
|
+
pos,
|
|
47
|
+
neg
|
|
48
|
+
} = currentOriginPeaks;
|
|
49
|
+
const absOffset = (0, _shift.FromManualToOffset)(origRef, origApex);
|
|
50
|
+
const relOffset = prevOffset - absOffset;
|
|
51
|
+
const nextPos = (0, _shift.VirtalPts)(pos, relOffset);
|
|
52
|
+
const nextNeg = (0, _shift.VirtalPts)(neg, relOffset);
|
|
53
|
+
yield (0, _effects.put)({
|
|
54
|
+
type: _action_type.EDITPEAK.SHIFT,
|
|
55
|
+
payload: Object.assign({}, payload, {
|
|
56
|
+
// eslint-disable-line
|
|
57
|
+
prevOffset: absOffset,
|
|
58
|
+
pos: nextPos,
|
|
59
|
+
neg: nextNeg
|
|
60
|
+
})
|
|
61
|
+
});
|
|
75
62
|
}
|
|
76
|
-
|
|
77
|
-
var _default = editPeakSagas;
|
|
63
|
+
const editPeakSagas = [(0, _effects.takeEvery)(_action_type.SHIFT.SET_REF, addVirtualFactor), (0, _effects.takeEvery)(_action_type.SHIFT.SET_PEAK, addVirtualFactor)];
|
|
64
|
+
var _default = exports.default = editPeakSagas;
|
|
78
65
|
/* LOGIC
|
|
79
66
|
-no po - tg
|
|
80
67
|
| picked | another | absoffset | prevOffset | relative | newOffset
|
|
@@ -85,5 +72,4 @@ var _default = editPeakSagas;
|
|
|
85
72
|
3 | 20 0 +20 -100 -120
|
|
86
73
|
-------------------------------------------------------------------
|
|
87
74
|
|
|
88
|
-
*/
|
|
89
|
-
exports.default = _default;
|
|
75
|
+
*/
|
|
@@ -1,141 +1,97 @@
|
|
|
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 _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
7
|
var _effects = require("redux-saga/effects");
|
|
10
8
|
var _action_type = require("../constants/action_type");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// const { curveIdx } = curveSt;
|
|
39
|
-
// const { shifts } = shiftSt;
|
|
40
|
-
// shifts[curveIdx] = shift;
|
|
41
|
-
// const newPayload = Object.assign({}, shiftSt, { shifts, selectedIdx: curveIdx })
|
|
42
|
-
_context.next = 6;
|
|
43
|
-
return (0, _effects.put)({
|
|
44
|
-
type: _action_type.MANAGER.RESETSHIFT,
|
|
45
|
-
payload: Object.assign(
|
|
46
|
-
// eslint-disable-line
|
|
47
|
-
{}, payload, {
|
|
48
|
-
layout: layout
|
|
49
|
-
})
|
|
50
|
-
});
|
|
51
|
-
case 6:
|
|
52
|
-
case "end":
|
|
53
|
-
return _context.stop();
|
|
54
|
-
}
|
|
55
|
-
}, _marked);
|
|
9
|
+
const getLayout = state => state.layout;
|
|
10
|
+
const getCurveSt = state => state.curve;
|
|
11
|
+
const getIntegrationSt = state => state.integration.present;
|
|
12
|
+
function* resetShift(action) {
|
|
13
|
+
const curveSt = yield (0, _effects.select)(getCurveSt);
|
|
14
|
+
const layout = yield (0, _effects.select)(getLayout);
|
|
15
|
+
const {
|
|
16
|
+
payload
|
|
17
|
+
} = action;
|
|
18
|
+
const {
|
|
19
|
+
curveIdx,
|
|
20
|
+
listCurves
|
|
21
|
+
} = curveSt;
|
|
22
|
+
const numberOfCurve = listCurves.length;
|
|
23
|
+
yield (0, _effects.put)({
|
|
24
|
+
type: _action_type.MANAGER.RESETSHIFT,
|
|
25
|
+
payload: Object.assign(
|
|
26
|
+
// eslint-disable-line
|
|
27
|
+
{}, payload, {
|
|
28
|
+
layout,
|
|
29
|
+
curvesInfo: {
|
|
30
|
+
isMultiCurve: numberOfCurve > 0,
|
|
31
|
+
curveIdx,
|
|
32
|
+
numberOfCurve
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
});
|
|
56
36
|
}
|
|
57
|
-
function resetInitNmr(action) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
_context2.next = 17;
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
_context2.next = 17;
|
|
93
|
-
return (0, _effects.put)({
|
|
94
|
-
type: _action_type.SIMULATION.RESET_ALL_RDC,
|
|
95
|
-
payload: simulation
|
|
96
|
-
});
|
|
97
|
-
case 17:
|
|
98
|
-
case "end":
|
|
99
|
-
return _context2.stop();
|
|
100
|
-
}
|
|
101
|
-
}, _marked2);
|
|
37
|
+
function* resetInitNmr(action) {
|
|
38
|
+
const curveSt = yield (0, _effects.select)(getCurveSt);
|
|
39
|
+
const integationSt = yield (0, _effects.select)(getIntegrationSt);
|
|
40
|
+
const {
|
|
41
|
+
curveIdx
|
|
42
|
+
} = curveSt;
|
|
43
|
+
const {
|
|
44
|
+
integration,
|
|
45
|
+
simulation
|
|
46
|
+
} = action.payload;
|
|
47
|
+
const {
|
|
48
|
+
integrations
|
|
49
|
+
} = integationSt;
|
|
50
|
+
const newArrIntegration = [...integrations];
|
|
51
|
+
newArrIntegration[curveIdx] = integration;
|
|
52
|
+
const payload = Object.assign({}, integationSt, {
|
|
53
|
+
integrations: newArrIntegration,
|
|
54
|
+
selectedIdx: curveIdx
|
|
55
|
+
}); // eslint-disable-line
|
|
56
|
+
|
|
57
|
+
if (integration) {
|
|
58
|
+
yield (0, _effects.put)({
|
|
59
|
+
type: _action_type.INTEGRATION.RESET_ALL_RDC,
|
|
60
|
+
payload
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (simulation) {
|
|
64
|
+
yield (0, _effects.put)({
|
|
65
|
+
type: _action_type.SIMULATION.RESET_ALL_RDC,
|
|
66
|
+
payload: simulation
|
|
67
|
+
});
|
|
68
|
+
}
|
|
102
69
|
}
|
|
103
|
-
function resetInitCommonWithIntergation(action) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
_context3.next = 14;
|
|
129
|
-
return (0, _effects.put)({
|
|
130
|
-
type: _action_type.INTEGRATION.RESET_ALL_RDC,
|
|
131
|
-
payload: payload
|
|
132
|
-
});
|
|
133
|
-
case 14:
|
|
134
|
-
case "end":
|
|
135
|
-
return _context3.stop();
|
|
136
|
-
}
|
|
137
|
-
}, _marked3);
|
|
70
|
+
function* resetInitCommonWithIntergation(action) {
|
|
71
|
+
const curveSt = yield (0, _effects.select)(getCurveSt);
|
|
72
|
+
const integationSt = yield (0, _effects.select)(getIntegrationSt);
|
|
73
|
+
const {
|
|
74
|
+
curveIdx
|
|
75
|
+
} = curveSt;
|
|
76
|
+
const {
|
|
77
|
+
integration
|
|
78
|
+
} = action.payload;
|
|
79
|
+
const {
|
|
80
|
+
integrations
|
|
81
|
+
} = integationSt;
|
|
82
|
+
const newArrIntegration = [...integrations];
|
|
83
|
+
newArrIntegration[curveIdx] = integration;
|
|
84
|
+
const payload = Object.assign({}, integationSt, {
|
|
85
|
+
integrations: newArrIntegration,
|
|
86
|
+
selectedIdx: curveIdx
|
|
87
|
+
}); // eslint-disable-line
|
|
88
|
+
|
|
89
|
+
if (integration) {
|
|
90
|
+
yield (0, _effects.put)({
|
|
91
|
+
type: _action_type.INTEGRATION.RESET_ALL_RDC,
|
|
92
|
+
payload
|
|
93
|
+
});
|
|
94
|
+
}
|
|
138
95
|
}
|
|
139
|
-
|
|
140
|
-
var _default = managerSagas;
|
|
141
|
-
exports.default = _default;
|
|
96
|
+
const managerSagas = [(0, _effects.takeEvery)(_action_type.MANAGER.RESETALL, resetShift), (0, _effects.takeEvery)(_action_type.MANAGER.RESET_INIT_NMR, resetInitNmr), (0, _effects.takeEvery)(_action_type.MANAGER.RESET_INIT_COMMON_WITH_INTERGATION, resetInitCommonWithIntergation)];
|
|
97
|
+
var _default = exports.default = managerSagas;
|
package/dist/sagas/saga_meta.js
CHANGED
|
@@ -1,42 +1,36 @@
|
|
|
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 _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
7
|
var _effects = require("redux-saga/effects");
|
|
10
8
|
var _action_type = require("../constants/action_type");
|
|
11
9
|
var _peakInterval = require("../third_party/peakInterval");
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
case 6:
|
|
35
|
-
case "end":
|
|
36
|
-
return _context.stop();
|
|
10
|
+
function* updateMetaPeaks(action) {
|
|
11
|
+
const {
|
|
12
|
+
payload
|
|
13
|
+
} = action;
|
|
14
|
+
const {
|
|
15
|
+
intervalL,
|
|
16
|
+
intervalR
|
|
17
|
+
} = (0, _peakInterval.getPeakIntervals)(payload);
|
|
18
|
+
const {
|
|
19
|
+
observeFrequency,
|
|
20
|
+
data
|
|
21
|
+
} = payload.spectra[0];
|
|
22
|
+
const deltaX = Math.abs(data[0].x[0] - data[0].x[1]);
|
|
23
|
+
yield (0, _effects.put)({
|
|
24
|
+
type: _action_type.META.UPDATE_PEAKS_RDC,
|
|
25
|
+
payload: {
|
|
26
|
+
peaks: {
|
|
27
|
+
intervalL,
|
|
28
|
+
intervalR,
|
|
29
|
+
observeFrequency,
|
|
30
|
+
deltaX
|
|
31
|
+
}
|
|
37
32
|
}
|
|
38
|
-
}
|
|
33
|
+
});
|
|
39
34
|
}
|
|
40
|
-
|
|
41
|
-
var _default = metaSagas;
|
|
42
|
-
exports.default = _default;
|
|
35
|
+
const metaSagas = [(0, _effects.takeEvery)(_action_type.META.UPDATE_PEAKS, updateMetaPeaks)];
|
|
36
|
+
var _default = exports.default = metaSagas;
|
|
@@ -1,85 +1,48 @@
|
|
|
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 _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
7
|
var _effects = require("redux-saga/effects");
|
|
10
8
|
var _action_type = require("../constants/action_type");
|
|
11
9
|
var _list_layout = require("../constants/list_layout");
|
|
12
|
-
var _marked = /*#__PURE__*/_regenerator.default.mark(setCyclicVoltametry);
|
|
13
10
|
/* eslint-disable no-plusplus */
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var getLayoutSt = function getLayoutSt(state) {
|
|
18
|
-
return state.layout;
|
|
19
|
-
};
|
|
11
|
+
|
|
12
|
+
const getCurveSt = state => state.curve;
|
|
13
|
+
const getLayoutSt = state => state.layout;
|
|
20
14
|
function getMaxMinPeak(curve) {
|
|
21
15
|
return curve.maxminPeak;
|
|
22
16
|
}
|
|
23
|
-
function setCyclicVoltametry(action) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
case 12:
|
|
53
|
-
numberOfCurves = listCurves.length;
|
|
54
|
-
if (!(numberOfCurves <= 0)) {
|
|
55
|
-
_context.next = 15;
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
return _context.abrupt("return");
|
|
59
|
-
case 15:
|
|
60
|
-
index = 0;
|
|
61
|
-
case 16:
|
|
62
|
-
if (!(index < listCurves.length)) {
|
|
63
|
-
_context.next = 38;
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
curve = listCurves[index];
|
|
67
|
-
maxminPeak = getMaxMinPeak(curve);
|
|
68
|
-
_context.next = 21;
|
|
69
|
-
return (0, _effects.put)({
|
|
70
|
-
type: _action_type.CYCLIC_VOLTA_METRY.ADD_PAIR_PEAKS,
|
|
71
|
-
payload: index
|
|
72
|
-
});
|
|
73
|
-
case 21:
|
|
74
|
-
pidx = 0;
|
|
75
|
-
case 22:
|
|
76
|
-
if (!(pidx < maxminPeak.max.length)) {
|
|
77
|
-
_context.next = 35;
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
maxPeak = maxminPeak.max[pidx];
|
|
81
|
-
_context.next = 26;
|
|
82
|
-
return (0, _effects.put)({
|
|
17
|
+
function* setCyclicVoltametry(action) {
|
|
18
|
+
// eslint-disable-line
|
|
19
|
+
const layoutSt = yield (0, _effects.select)(getLayoutSt);
|
|
20
|
+
if (layoutSt !== _list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const curveSt = yield (0, _effects.select)(getCurveSt);
|
|
24
|
+
const {
|
|
25
|
+
listCurves
|
|
26
|
+
} = curveSt;
|
|
27
|
+
if (listCurves) {
|
|
28
|
+
yield (0, _effects.put)({
|
|
29
|
+
type: _action_type.CYCLIC_VOLTA_METRY.RESETALL,
|
|
30
|
+
payload: null
|
|
31
|
+
});
|
|
32
|
+
const numberOfCurves = listCurves.length;
|
|
33
|
+
if (numberOfCurves <= 0) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
for (let index = 0; index < listCurves.length; index++) {
|
|
37
|
+
const curve = listCurves[index];
|
|
38
|
+
const maxminPeak = getMaxMinPeak(curve);
|
|
39
|
+
yield (0, _effects.put)({
|
|
40
|
+
type: _action_type.CYCLIC_VOLTA_METRY.ADD_PAIR_PEAKS,
|
|
41
|
+
payload: index
|
|
42
|
+
});
|
|
43
|
+
for (let pidx = 0; pidx < maxminPeak.max.length; pidx++) {
|
|
44
|
+
const maxPeak = maxminPeak.max[pidx];
|
|
45
|
+
yield (0, _effects.put)({
|
|
83
46
|
type: _action_type.CYCLIC_VOLTA_METRY.ADD_MAX_PEAK,
|
|
84
47
|
payload: {
|
|
85
48
|
peak: maxPeak,
|
|
@@ -87,10 +50,8 @@ function setCyclicVoltametry(action) {
|
|
|
87
50
|
jcampIdx: index
|
|
88
51
|
}
|
|
89
52
|
});
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
_context.next = 29;
|
|
93
|
-
return (0, _effects.put)({
|
|
53
|
+
const minPeak = maxminPeak.min[pidx];
|
|
54
|
+
yield (0, _effects.put)({
|
|
94
55
|
type: _action_type.CYCLIC_VOLTA_METRY.ADD_MIN_PEAK,
|
|
95
56
|
payload: {
|
|
96
57
|
peak: minPeak,
|
|
@@ -98,10 +59,8 @@ function setCyclicVoltametry(action) {
|
|
|
98
59
|
jcampIdx: index
|
|
99
60
|
}
|
|
100
61
|
});
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
_context.next = 32;
|
|
104
|
-
return (0, _effects.put)({
|
|
62
|
+
const pecker = maxminPeak.pecker[pidx];
|
|
63
|
+
yield (0, _effects.put)({
|
|
105
64
|
type: _action_type.CYCLIC_VOLTA_METRY.ADD_PECKER,
|
|
106
65
|
payload: {
|
|
107
66
|
peak: pecker,
|
|
@@ -109,31 +68,9 @@ function setCyclicVoltametry(action) {
|
|
|
109
68
|
jcampIdx: index
|
|
110
69
|
}
|
|
111
70
|
});
|
|
112
|
-
|
|
113
|
-
pidx++;
|
|
114
|
-
_context.next = 22;
|
|
115
|
-
break;
|
|
116
|
-
case 35:
|
|
117
|
-
index++;
|
|
118
|
-
_context.next = 16;
|
|
119
|
-
break;
|
|
120
|
-
case 38:
|
|
121
|
-
case "end":
|
|
122
|
-
return _context.stop();
|
|
71
|
+
}
|
|
123
72
|
}
|
|
124
|
-
}
|
|
73
|
+
}
|
|
125
74
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
// const layoutSt = yield select(getLayoutSt);
|
|
129
|
-
// console.log(layoutSt);
|
|
130
|
-
// const curveSt = yield select(getCurveSt);
|
|
131
|
-
// const { listCurves } = curveSt;
|
|
132
|
-
// console.log(listCurves);
|
|
133
|
-
// }
|
|
134
|
-
|
|
135
|
-
var multiEntitiesSagas = [(0, _effects.takeEvery)(_action_type.CURVE.SET_ALL_CURVES, setCyclicVoltametry)
|
|
136
|
-
// takeEvery(CURVE.SET_ALL_CURVES, setInitData),
|
|
137
|
-
];
|
|
138
|
-
var _default = multiEntitiesSagas;
|
|
139
|
-
exports.default = _default;
|
|
75
|
+
const multiEntitiesSagas = [(0, _effects.takeEvery)(_action_type.CURVE.SET_ALL_CURVES, setCyclicVoltametry)];
|
|
76
|
+
var _default = exports.default = multiEntitiesSagas;
|