@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,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
var _effects = require("redux-saga/effects");
|
|
10
|
-
var _action_type = require("../constants/action_type");
|
|
11
|
-
var _shift = require("../helpers/shift");
|
|
12
|
-
var _marked = /*#__PURE__*/_regenerator.default.mark(addVirtualFactor);
|
|
13
|
-
var getShiftRef = function getShiftRef(state) {
|
|
14
|
-
return state.shift.ref;
|
|
15
|
-
};
|
|
16
|
-
var getShiftPeak = function getShiftPeak(state) {
|
|
17
|
-
return state.shift.peak;
|
|
18
|
-
};
|
|
19
|
-
var getEditPeak = function getEditPeak(state) {
|
|
20
|
-
return state.editPeak.present;
|
|
21
|
-
};
|
|
22
|
-
function addVirtualFactor(action) {
|
|
23
|
-
var origRef, origApex, origEPeak, payload, prevOffset, pos, neg, absOffset, relOffset, nextPos, nextNeg;
|
|
24
|
-
return _regenerator.default.wrap(function addVirtualFactor$(_context) {
|
|
25
|
-
while (1) switch (_context.prev = _context.next) {
|
|
26
|
-
case 0:
|
|
27
|
-
_context.next = 2;
|
|
28
|
-
return (0, _effects.select)(getShiftRef);
|
|
29
|
-
case 2:
|
|
30
|
-
origRef = _context.sent;
|
|
31
|
-
_context.next = 5;
|
|
32
|
-
return (0, _effects.select)(getShiftPeak);
|
|
33
|
-
case 5:
|
|
34
|
-
origApex = _context.sent;
|
|
35
|
-
_context.next = 8;
|
|
36
|
-
return (0, _effects.select)(getEditPeak);
|
|
37
|
-
case 8:
|
|
38
|
-
origEPeak = _context.sent;
|
|
39
|
-
payload = action.payload;
|
|
40
|
-
prevOffset = origEPeak.prevOffset, pos = origEPeak.pos, neg = origEPeak.neg;
|
|
41
|
-
absOffset = (0, _shift.FromManualToOffset)(origRef, origApex);
|
|
42
|
-
relOffset = prevOffset - absOffset;
|
|
43
|
-
nextPos = (0, _shift.VirtalPts)(pos, relOffset);
|
|
44
|
-
nextNeg = (0, _shift.VirtalPts)(neg, relOffset);
|
|
45
|
-
_context.next = 17;
|
|
46
|
-
return (0, _effects.put)({
|
|
47
|
-
type: _action_type.EDITPEAK.SHIFT,
|
|
48
|
-
payload: Object.assign({}, payload, {
|
|
49
|
-
prevOffset: absOffset,
|
|
50
|
-
pos: nextPos,
|
|
51
|
-
neg: nextNeg
|
|
52
|
-
})
|
|
53
|
-
});
|
|
54
|
-
case 17:
|
|
55
|
-
case "end":
|
|
56
|
-
return _context.stop();
|
|
57
|
-
}
|
|
58
|
-
}, _marked);
|
|
59
|
-
}
|
|
60
|
-
var editPeakSagas = [(0, _effects.takeEvery)(_action_type.SHIFT.SET_REF, addVirtualFactor), (0, _effects.takeEvery)(_action_type.SHIFT.SET_PEAK, addVirtualFactor)];
|
|
61
|
-
var _default = editPeakSagas;
|
|
62
|
-
/* LOGIC
|
|
63
|
-
-no po - tg
|
|
64
|
-
| picked | another | absoffset | prevOffset | relative | newOffset
|
|
65
|
-
-------------------------------------------------------------------
|
|
66
|
-
0 | 40 20 - - - 0
|
|
67
|
-
1 | 180 160 -140 0 140 140
|
|
68
|
-
2 | 80 60 -40 -140 -100 100
|
|
69
|
-
3 | 20 0 +20 -100 -120
|
|
70
|
-
-------------------------------------------------------------------
|
|
71
|
-
|
|
72
|
-
*/
|
|
73
|
-
exports.default = _default;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
var _effects = require("redux-saga/effects");
|
|
10
|
-
var _action_type = require("../constants/action_type");
|
|
11
|
-
var _marked = /*#__PURE__*/_regenerator.default.mark(setCyclicVoltametry);
|
|
12
|
-
var getCurveSt = function getCurveSt(state) {
|
|
13
|
-
return state.curve;
|
|
14
|
-
};
|
|
15
|
-
function getMaxMinPeak(curve) {
|
|
16
|
-
return curve.maxminPeak;
|
|
17
|
-
}
|
|
18
|
-
function setCyclicVoltametry(action) {
|
|
19
|
-
var curveSt, listCurves, index, curve, maxminPeak, pidx, maxPeak, minPeak, pecker;
|
|
20
|
-
return _regenerator.default.wrap(function setCyclicVoltametry$(_context) {
|
|
21
|
-
while (1) switch (_context.prev = _context.next) {
|
|
22
|
-
case 0:
|
|
23
|
-
_context.next = 2;
|
|
24
|
-
return (0, _effects.select)(getCurveSt);
|
|
25
|
-
case 2:
|
|
26
|
-
curveSt = _context.sent;
|
|
27
|
-
listCurves = curveSt.listCurves;
|
|
28
|
-
if (!listCurves) {
|
|
29
|
-
_context.next = 30;
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
_context.next = 7;
|
|
33
|
-
return (0, _effects.put)({
|
|
34
|
-
type: _action_type.CYCLIC_VOLTA_METRY.RESETALL,
|
|
35
|
-
payload: null
|
|
36
|
-
});
|
|
37
|
-
case 7:
|
|
38
|
-
index = 0;
|
|
39
|
-
case 8:
|
|
40
|
-
if (!(index < listCurves.length)) {
|
|
41
|
-
_context.next = 30;
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
curve = listCurves[index];
|
|
45
|
-
maxminPeak = getMaxMinPeak(curve);
|
|
46
|
-
_context.next = 13;
|
|
47
|
-
return (0, _effects.put)({
|
|
48
|
-
type: _action_type.CYCLIC_VOLTA_METRY.ADD_PAIR_PEAKS,
|
|
49
|
-
payload: index
|
|
50
|
-
});
|
|
51
|
-
case 13:
|
|
52
|
-
pidx = 0;
|
|
53
|
-
case 14:
|
|
54
|
-
if (!(pidx < maxminPeak.max.length)) {
|
|
55
|
-
_context.next = 27;
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
maxPeak = maxminPeak.max[pidx];
|
|
59
|
-
_context.next = 18;
|
|
60
|
-
return (0, _effects.put)({
|
|
61
|
-
type: _action_type.CYCLIC_VOLTA_METRY.ADD_MAX_PEAK,
|
|
62
|
-
payload: {
|
|
63
|
-
peak: maxPeak,
|
|
64
|
-
index: pidx,
|
|
65
|
-
jcampIdx: index
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
case 18:
|
|
69
|
-
minPeak = maxminPeak.min[pidx];
|
|
70
|
-
_context.next = 21;
|
|
71
|
-
return (0, _effects.put)({
|
|
72
|
-
type: _action_type.CYCLIC_VOLTA_METRY.ADD_MIN_PEAK,
|
|
73
|
-
payload: {
|
|
74
|
-
peak: minPeak,
|
|
75
|
-
index: pidx,
|
|
76
|
-
jcampIdx: index
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
case 21:
|
|
80
|
-
pecker = maxminPeak.pecker[pidx];
|
|
81
|
-
_context.next = 24;
|
|
82
|
-
return (0, _effects.put)({
|
|
83
|
-
type: _action_type.CYCLIC_VOLTA_METRY.ADD_PECKER,
|
|
84
|
-
payload: {
|
|
85
|
-
peak: pecker,
|
|
86
|
-
index: pidx,
|
|
87
|
-
jcampIdx: index
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
case 24:
|
|
91
|
-
pidx++;
|
|
92
|
-
_context.next = 14;
|
|
93
|
-
break;
|
|
94
|
-
case 27:
|
|
95
|
-
index++;
|
|
96
|
-
_context.next = 8;
|
|
97
|
-
break;
|
|
98
|
-
case 30:
|
|
99
|
-
case "end":
|
|
100
|
-
return _context.stop();
|
|
101
|
-
}
|
|
102
|
-
}, _marked);
|
|
103
|
-
}
|
|
104
|
-
var multiEntitiesSagas = [(0, _effects.takeEvery)(_action_type.CURVE.SET_ALL_CURVES, setCyclicVoltametry)];
|
|
105
|
-
var _default = multiEntitiesSagas;
|
|
106
|
-
exports.default = _default;
|
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _regeneratorRuntime2 = require("@babel/runtime/regenerator");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
var _effects = require("redux-saga/effects");
|
|
12
|
-
var _action_type = require("../constants/action_type");
|
|
13
|
-
var _multiplicity_calc = require("../helpers/multiplicity_calc");
|
|
14
|
-
var _multiplicity_manual = require("../helpers/multiplicity_manual");
|
|
15
|
-
var _marked = /*#__PURE__*/_regeneratorRuntime2.mark(selectMpy),
|
|
16
|
-
_marked2 = /*#__PURE__*/_regeneratorRuntime2.mark(addUiPeakToStack),
|
|
17
|
-
_marked3 = /*#__PURE__*/_regeneratorRuntime2.mark(rmPanelPeakFromStack),
|
|
18
|
-
_marked4 = /*#__PURE__*/_regeneratorRuntime2.mark(rmUiPeakFromStack),
|
|
19
|
-
_marked5 = /*#__PURE__*/_regeneratorRuntime2.mark(resetInitNmr),
|
|
20
|
-
_marked6 = /*#__PURE__*/_regeneratorRuntime2.mark(resetOne),
|
|
21
|
-
_marked7 = /*#__PURE__*/_regeneratorRuntime2.mark(selectMpyType);
|
|
22
|
-
var getMetaSt = function getMetaSt(state) {
|
|
23
|
-
return state.meta;
|
|
24
|
-
};
|
|
25
|
-
var getMultiplicitySt = function getMultiplicitySt(state) {
|
|
26
|
-
return state.multiplicity.present;
|
|
27
|
-
};
|
|
28
|
-
function selectMpy(action) {
|
|
29
|
-
var metaSt, mpySt, _action$payload, xExtent, yExtent, dataPks, shift, stack, xL, xU, yL, yU, peaks, newXExtemt, coupling, m, newStack, payload;
|
|
30
|
-
return _regenerator.default.wrap(function selectMpy$(_context) {
|
|
31
|
-
while (1) switch (_context.prev = _context.next) {
|
|
32
|
-
case 0:
|
|
33
|
-
_context.next = 2;
|
|
34
|
-
return (0, _effects.select)(getMetaSt);
|
|
35
|
-
case 2:
|
|
36
|
-
metaSt = _context.sent;
|
|
37
|
-
_context.next = 5;
|
|
38
|
-
return (0, _effects.select)(getMultiplicitySt);
|
|
39
|
-
case 5:
|
|
40
|
-
mpySt = _context.sent;
|
|
41
|
-
_action$payload = action.payload, xExtent = _action$payload.xExtent, yExtent = _action$payload.yExtent, dataPks = _action$payload.dataPks;
|
|
42
|
-
shift = mpySt.shift, stack = mpySt.stack;
|
|
43
|
-
xL = xExtent.xL, xU = xExtent.xU;
|
|
44
|
-
yL = yExtent.yL, yU = yExtent.yU;
|
|
45
|
-
peaks = dataPks.filter(function (p) {
|
|
46
|
-
return xL <= p.x && p.x <= xU && yL <= p.y && p.y <= yU;
|
|
47
|
-
});
|
|
48
|
-
peaks = peaks.map(function (pk) {
|
|
49
|
-
return {
|
|
50
|
-
x: pk.x + shift,
|
|
51
|
-
y: pk.y
|
|
52
|
-
};
|
|
53
|
-
});
|
|
54
|
-
newXExtemt = {
|
|
55
|
-
xL: xL + shift,
|
|
56
|
-
xU: xU + shift
|
|
57
|
-
};
|
|
58
|
-
coupling = (0, _multiplicity_calc.calcMpyCoup)(peaks, metaSt);
|
|
59
|
-
m = {
|
|
60
|
-
peaks: peaks,
|
|
61
|
-
xExtent: newXExtemt,
|
|
62
|
-
yExtent: yExtent,
|
|
63
|
-
mpyType: coupling.type,
|
|
64
|
-
js: coupling.js
|
|
65
|
-
};
|
|
66
|
-
newStack = [].concat((0, _toConsumableArray2.default)(stack), [m]);
|
|
67
|
-
payload = Object.assign({}, mpySt, {
|
|
68
|
-
stack: newStack,
|
|
69
|
-
smExtext: newXExtemt
|
|
70
|
-
});
|
|
71
|
-
_context.next = 19;
|
|
72
|
-
return (0, _effects.put)({
|
|
73
|
-
type: _action_type.UI.SWEEP.SELECT_MULTIPLICITY_RDC,
|
|
74
|
-
payload: payload
|
|
75
|
-
});
|
|
76
|
-
case 19:
|
|
77
|
-
case "end":
|
|
78
|
-
return _context.stop();
|
|
79
|
-
}
|
|
80
|
-
}, _marked);
|
|
81
|
-
}
|
|
82
|
-
function addUiPeakToStack(action) {
|
|
83
|
-
var metaSt, mpySt, shift, stack, smExtext, _action$payload2, x, y, newPeak, xL, xU, isDuplicate, newStack, payload;
|
|
84
|
-
return _regenerator.default.wrap(function addUiPeakToStack$(_context2) {
|
|
85
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
86
|
-
case 0:
|
|
87
|
-
_context2.next = 2;
|
|
88
|
-
return (0, _effects.select)(getMetaSt);
|
|
89
|
-
case 2:
|
|
90
|
-
metaSt = _context2.sent;
|
|
91
|
-
_context2.next = 5;
|
|
92
|
-
return (0, _effects.select)(getMultiplicitySt);
|
|
93
|
-
case 5:
|
|
94
|
-
mpySt = _context2.sent;
|
|
95
|
-
shift = mpySt.shift, stack = mpySt.stack, smExtext = mpySt.smExtext;
|
|
96
|
-
_action$payload2 = action.payload, x = _action$payload2.x, y = _action$payload2.y; // eslint-disable-line
|
|
97
|
-
if (!(!x || !y)) {
|
|
98
|
-
_context2.next = 10;
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
return _context2.abrupt("return");
|
|
102
|
-
case 10:
|
|
103
|
-
x += shift;
|
|
104
|
-
newPeak = {
|
|
105
|
-
x: x,
|
|
106
|
-
y: y
|
|
107
|
-
};
|
|
108
|
-
xL = smExtext.xL, xU = smExtext.xU;
|
|
109
|
-
if (!(x < xL || xU < x)) {
|
|
110
|
-
_context2.next = 15;
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
return _context2.abrupt("return");
|
|
114
|
-
case 15:
|
|
115
|
-
isDuplicate = false;
|
|
116
|
-
newStack = stack.map(function (k) {
|
|
117
|
-
if (k.xExtent.xL === xL && k.xExtent.xU === xU) {
|
|
118
|
-
var existXs = k.peaks.map(function (pk) {
|
|
119
|
-
return pk.x;
|
|
120
|
-
});
|
|
121
|
-
if (existXs.indexOf(newPeak.x) >= 0) {
|
|
122
|
-
isDuplicate = true;
|
|
123
|
-
return k;
|
|
124
|
-
}
|
|
125
|
-
var newPks = [].concat((0, _toConsumableArray2.default)(k.peaks), [newPeak]);
|
|
126
|
-
var coupling = (0, _multiplicity_calc.calcMpyCoup)(newPks, metaSt);
|
|
127
|
-
return Object.assign({}, k, {
|
|
128
|
-
peaks: newPks,
|
|
129
|
-
mpyType: coupling.type,
|
|
130
|
-
js: coupling.js
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
return k;
|
|
134
|
-
});
|
|
135
|
-
if (!isDuplicate) {
|
|
136
|
-
_context2.next = 19;
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
return _context2.abrupt("return");
|
|
140
|
-
case 19:
|
|
141
|
-
payload = Object.assign({}, mpySt, {
|
|
142
|
-
stack: newStack
|
|
143
|
-
});
|
|
144
|
-
_context2.next = 22;
|
|
145
|
-
return (0, _effects.put)({
|
|
146
|
-
type: _action_type.MULTIPLICITY.PEAK_ADD_BY_UI_RDC,
|
|
147
|
-
payload: payload
|
|
148
|
-
});
|
|
149
|
-
case 22:
|
|
150
|
-
case "end":
|
|
151
|
-
return _context2.stop();
|
|
152
|
-
}
|
|
153
|
-
}, _marked2);
|
|
154
|
-
}
|
|
155
|
-
var rmPeakFromStack = function rmPeakFromStack(action, metaSt, mpySt) {
|
|
156
|
-
var _action$payload3 = action.payload,
|
|
157
|
-
peak = _action$payload3.peak,
|
|
158
|
-
xExtent = _action$payload3.xExtent;
|
|
159
|
-
var stack = mpySt.stack;
|
|
160
|
-
var newStack = stack.map(function (k) {
|
|
161
|
-
if (k.xExtent.xL === xExtent.xL && k.xExtent.xU === xExtent.xU) {
|
|
162
|
-
var newPks = k.peaks.filter(function (pk) {
|
|
163
|
-
return pk.x !== peak.x;
|
|
164
|
-
});
|
|
165
|
-
var coupling = (0, _multiplicity_calc.calcMpyCoup)(newPks, metaSt);
|
|
166
|
-
return Object.assign({}, k, {
|
|
167
|
-
peaks: newPks,
|
|
168
|
-
mpyType: coupling.type,
|
|
169
|
-
js: coupling.js
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
return k;
|
|
173
|
-
});
|
|
174
|
-
newStack = newStack.filter(function (k) {
|
|
175
|
-
return k.peaks.length !== 0;
|
|
176
|
-
});
|
|
177
|
-
if (newStack.length === 0) return Object.assign({}, mpySt, {
|
|
178
|
-
stack: newStack,
|
|
179
|
-
smExtext: false
|
|
180
|
-
});
|
|
181
|
-
var noSmExtext = newStack.map(function (k) {
|
|
182
|
-
return k.xExtent.xL === xExtent.xL && k.xExtent.xU === xExtent.xU ? 1 : 0;
|
|
183
|
-
}).reduce(function (a, s) {
|
|
184
|
-
return a + s;
|
|
185
|
-
}) === 0;
|
|
186
|
-
var newSmExtext = noSmExtext ? newStack[0].xExtent : xExtent;
|
|
187
|
-
return Object.assign({}, mpySt, {
|
|
188
|
-
stack: newStack,
|
|
189
|
-
smExtext: newSmExtext
|
|
190
|
-
});
|
|
191
|
-
};
|
|
192
|
-
function rmPanelPeakFromStack(action) {
|
|
193
|
-
var metaSt, mpySt, payload;
|
|
194
|
-
return _regenerator.default.wrap(function rmPanelPeakFromStack$(_context3) {
|
|
195
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
196
|
-
case 0:
|
|
197
|
-
_context3.next = 2;
|
|
198
|
-
return (0, _effects.select)(getMetaSt);
|
|
199
|
-
case 2:
|
|
200
|
-
metaSt = _context3.sent;
|
|
201
|
-
_context3.next = 5;
|
|
202
|
-
return (0, _effects.select)(getMultiplicitySt);
|
|
203
|
-
case 5:
|
|
204
|
-
mpySt = _context3.sent;
|
|
205
|
-
payload = rmPeakFromStack(action, metaSt, mpySt);
|
|
206
|
-
_context3.next = 9;
|
|
207
|
-
return (0, _effects.put)({
|
|
208
|
-
type: _action_type.MULTIPLICITY.PEAK_RM_BY_PANEL_RDC,
|
|
209
|
-
payload: payload
|
|
210
|
-
});
|
|
211
|
-
case 9:
|
|
212
|
-
case "end":
|
|
213
|
-
return _context3.stop();
|
|
214
|
-
}
|
|
215
|
-
}, _marked3);
|
|
216
|
-
}
|
|
217
|
-
function rmUiPeakFromStack(action) {
|
|
218
|
-
var metaSt, mpySt, peak, xExtent, newAction, payload;
|
|
219
|
-
return _regenerator.default.wrap(function rmUiPeakFromStack$(_context4) {
|
|
220
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
221
|
-
case 0:
|
|
222
|
-
_context4.next = 2;
|
|
223
|
-
return (0, _effects.select)(getMetaSt);
|
|
224
|
-
case 2:
|
|
225
|
-
metaSt = _context4.sent;
|
|
226
|
-
_context4.next = 5;
|
|
227
|
-
return (0, _effects.select)(getMultiplicitySt);
|
|
228
|
-
case 5:
|
|
229
|
-
mpySt = _context4.sent;
|
|
230
|
-
peak = action.payload;
|
|
231
|
-
xExtent = mpySt.smExtext;
|
|
232
|
-
newAction = Object.assign({}, action, {
|
|
233
|
-
payload: {
|
|
234
|
-
peak: peak,
|
|
235
|
-
xExtent: xExtent
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
payload = rmPeakFromStack(newAction, metaSt, mpySt);
|
|
239
|
-
_context4.next = 12;
|
|
240
|
-
return (0, _effects.put)({
|
|
241
|
-
type: _action_type.MULTIPLICITY.PEAK_RM_BY_UI_RDC,
|
|
242
|
-
payload: payload
|
|
243
|
-
});
|
|
244
|
-
case 12:
|
|
245
|
-
case "end":
|
|
246
|
-
return _context4.stop();
|
|
247
|
-
}
|
|
248
|
-
}, _marked4);
|
|
249
|
-
}
|
|
250
|
-
function resetInitNmr(action) {
|
|
251
|
-
var multiplicity, mpySt;
|
|
252
|
-
return _regenerator.default.wrap(function resetInitNmr$(_context5) {
|
|
253
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
254
|
-
case 0:
|
|
255
|
-
multiplicity = action.payload.multiplicity;
|
|
256
|
-
_context5.next = 3;
|
|
257
|
-
return (0, _effects.select)(getMultiplicitySt);
|
|
258
|
-
case 3:
|
|
259
|
-
mpySt = _context5.sent;
|
|
260
|
-
if (!multiplicity) {
|
|
261
|
-
_context5.next = 7;
|
|
262
|
-
break;
|
|
263
|
-
}
|
|
264
|
-
_context5.next = 7;
|
|
265
|
-
return (0, _effects.put)({
|
|
266
|
-
type: _action_type.MULTIPLICITY.RESET_ALL_RDC,
|
|
267
|
-
payload: Object.assign({}, mpySt, multiplicity)
|
|
268
|
-
});
|
|
269
|
-
case 7:
|
|
270
|
-
case "end":
|
|
271
|
-
return _context5.stop();
|
|
272
|
-
}
|
|
273
|
-
}, _marked5);
|
|
274
|
-
}
|
|
275
|
-
function resetOne(action) {
|
|
276
|
-
var xExtent, metaSt, mpySt, stack, newStack, payload;
|
|
277
|
-
return _regenerator.default.wrap(function resetOne$(_context6) {
|
|
278
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
279
|
-
case 0:
|
|
280
|
-
xExtent = action.payload;
|
|
281
|
-
_context6.next = 3;
|
|
282
|
-
return (0, _effects.select)(getMetaSt);
|
|
283
|
-
case 3:
|
|
284
|
-
metaSt = _context6.sent;
|
|
285
|
-
_context6.next = 6;
|
|
286
|
-
return (0, _effects.select)(getMultiplicitySt);
|
|
287
|
-
case 6:
|
|
288
|
-
mpySt = _context6.sent;
|
|
289
|
-
stack = mpySt.stack;
|
|
290
|
-
newStack = stack.map(function (k) {
|
|
291
|
-
if (k.xExtent.xL === xExtent.xL && k.xExtent.xU === xExtent.xU) {
|
|
292
|
-
var peaks = k.peaks;
|
|
293
|
-
var coupling = (0, _multiplicity_calc.calcMpyCoup)(peaks, metaSt);
|
|
294
|
-
return Object.assign({}, k, {
|
|
295
|
-
peaks: peaks,
|
|
296
|
-
mpyType: coupling.type,
|
|
297
|
-
js: coupling.js
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
return k;
|
|
301
|
-
});
|
|
302
|
-
payload = Object.assign({}, mpySt, {
|
|
303
|
-
stack: newStack
|
|
304
|
-
});
|
|
305
|
-
_context6.next = 12;
|
|
306
|
-
return (0, _effects.put)({
|
|
307
|
-
type: _action_type.MULTIPLICITY.RESET_ONE_RDC,
|
|
308
|
-
payload: payload
|
|
309
|
-
});
|
|
310
|
-
case 12:
|
|
311
|
-
case "end":
|
|
312
|
-
return _context6.stop();
|
|
313
|
-
}
|
|
314
|
-
}, _marked6);
|
|
315
|
-
}
|
|
316
|
-
function selectMpyType(action) {
|
|
317
|
-
var mpySt, metaSt, _action$payload4, mpyType, xExtent, stack, newStack;
|
|
318
|
-
return _regenerator.default.wrap(function selectMpyType$(_context7) {
|
|
319
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
320
|
-
case 0:
|
|
321
|
-
_context7.next = 2;
|
|
322
|
-
return (0, _effects.select)(getMultiplicitySt);
|
|
323
|
-
case 2:
|
|
324
|
-
mpySt = _context7.sent;
|
|
325
|
-
_context7.next = 5;
|
|
326
|
-
return (0, _effects.select)(getMetaSt);
|
|
327
|
-
case 5:
|
|
328
|
-
metaSt = _context7.sent;
|
|
329
|
-
_action$payload4 = action.payload, mpyType = _action$payload4.mpyType, xExtent = _action$payload4.xExtent;
|
|
330
|
-
stack = mpySt.stack;
|
|
331
|
-
newStack = stack.map(function (k) {
|
|
332
|
-
var isTargetStack = k.xExtent.xL === xExtent.xL && k.xExtent.xU === xExtent.xU;
|
|
333
|
-
if (isTargetStack) return (0, _multiplicity_manual.calcMpyManual)(k, mpyType, metaSt);
|
|
334
|
-
return k;
|
|
335
|
-
});
|
|
336
|
-
_context7.next = 11;
|
|
337
|
-
return (0, _effects.put)({
|
|
338
|
-
type: _action_type.MULTIPLICITY.TYPE_SELECT_RDC,
|
|
339
|
-
payload: Object.assign({}, mpySt, {
|
|
340
|
-
stack: newStack
|
|
341
|
-
})
|
|
342
|
-
});
|
|
343
|
-
case 11:
|
|
344
|
-
case "end":
|
|
345
|
-
return _context7.stop();
|
|
346
|
-
}
|
|
347
|
-
}, _marked7);
|
|
348
|
-
}
|
|
349
|
-
var multiplicitySagas = [(0, _effects.takeEvery)(_action_type.UI.SWEEP.SELECT_MULTIPLICITY, selectMpy), (0, _effects.takeEvery)(_action_type.MULTIPLICITY.PEAK_ADD_BY_UI_SAG, addUiPeakToStack), (0, _effects.takeEvery)(_action_type.MULTIPLICITY.PEAK_RM_BY_PANEL, rmPanelPeakFromStack), (0, _effects.takeEvery)(_action_type.MULTIPLICITY.PEAK_RM_BY_UI, rmUiPeakFromStack), (0, _effects.takeEvery)(_action_type.MULTIPLICITY.TYPE_SELECT, selectMpyType), (0, _effects.takeEvery)(_action_type.MULTIPLICITY.RESET_ONE, resetOne), (0, _effects.takeEvery)(_action_type.MANAGER.RESET_INIT_NMR, resetInitNmr)];
|
|
350
|
-
var _default = multiplicitySagas;
|
|
351
|
-
exports.default = _default;
|