@complat/react-spectra-editor 0.10.13-alpha.5
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/LICENSE +662 -0
- package/README.md +37 -0
- package/dist/actions/edit_peak.js +25 -0
- package/dist/actions/forecast.js +41 -0
- package/dist/actions/integration.js +33 -0
- package/dist/actions/jcamp.js +41 -0
- package/dist/actions/layout.js +17 -0
- package/dist/actions/manager.js +49 -0
- package/dist/actions/meta.js +17 -0
- package/dist/actions/multiplicity.js +57 -0
- package/dist/actions/scan.js +33 -0
- package/dist/actions/shift.js +25 -0
- package/dist/actions/status.js +33 -0
- package/dist/actions/submit.js +41 -0
- package/dist/actions/threshold.js +33 -0
- package/dist/actions/ui.js +50 -0
- package/dist/app.js +125 -0
- package/dist/components/cmd_bar/01_viewer.js +133 -0
- package/dist/components/cmd_bar/02_zoom.js +119 -0
- package/dist/components/cmd_bar/03_peak.js +176 -0
- package/dist/components/cmd_bar/04_integration.js +273 -0
- package/dist/components/cmd_bar/05_multiplicity.js +228 -0
- package/dist/components/cmd_bar/06_undo_redo.js +137 -0
- package/dist/components/cmd_bar/common.js +104 -0
- package/dist/components/cmd_bar/index.js +113 -0
- package/dist/components/cmd_bar/r01_layout.js +351 -0
- package/dist/components/cmd_bar/r02_scan.js +226 -0
- package/dist/components/cmd_bar/r03_threshold.js +209 -0
- package/dist/components/cmd_bar/r04_submit.js +349 -0
- package/dist/components/cmd_bar/r05_submit_btn.js +147 -0
- package/dist/components/cmd_bar/r06_predict_btn.js +307 -0
- package/dist/components/cmd_bar/tri_btn.js +202 -0
- package/dist/components/common/chem.js +115 -0
- package/dist/components/common/comps.js +29 -0
- package/dist/components/common/draw.js +41 -0
- package/dist/components/d3_line/index.js +236 -0
- package/dist/components/d3_line/line_focus.js +765 -0
- package/dist/components/d3_rect/index.js +200 -0
- package/dist/components/d3_rect/rect_focus.js +301 -0
- package/dist/components/forecast/comps.js +337 -0
- package/dist/components/forecast/ir_comps.js +224 -0
- package/dist/components/forecast/ir_viewer.js +172 -0
- package/dist/components/forecast/nmr_comps.js +253 -0
- package/dist/components/forecast/nmr_viewer.js +170 -0
- package/dist/components/forecast/section_loading.js +95 -0
- package/dist/components/forecast_viewer.js +190 -0
- package/dist/components/panel/compare.js +370 -0
- package/dist/components/panel/index.js +191 -0
- package/dist/components/panel/info.js +335 -0
- package/dist/components/panel/multiplicity.js +405 -0
- package/dist/components/panel/multiplicity_coupling.js +195 -0
- package/dist/components/panel/multiplicity_select.js +114 -0
- package/dist/components/panel/peaks.js +296 -0
- package/dist/constants/action_type.js +140 -0
- package/dist/constants/list_layout.js +23 -0
- package/dist/constants/list_shift.js +480 -0
- package/dist/constants/list_ui.js +33 -0
- package/dist/fn.js +31 -0
- package/dist/helpers/brush.js +109 -0
- package/dist/helpers/calc.js +10 -0
- package/dist/helpers/carbonFeatures.js +47 -0
- package/dist/helpers/cfg.js +89 -0
- package/dist/helpers/chem.js +594 -0
- package/dist/helpers/compass.js +91 -0
- package/dist/helpers/converter.js +74 -0
- package/dist/helpers/extractParams.js +77 -0
- package/dist/helpers/extractPeaksEdit.js +69 -0
- package/dist/helpers/focus.js +15 -0
- package/dist/helpers/format.js +403 -0
- package/dist/helpers/init.js +80 -0
- package/dist/helpers/integration.js +30 -0
- package/dist/helpers/mount.js +112 -0
- package/dist/helpers/multiplicity.js +44 -0
- package/dist/helpers/multiplicity_calc.js +117 -0
- package/dist/helpers/multiplicity_complat.js +126 -0
- package/dist/helpers/multiplicity_manual.js +94 -0
- package/dist/helpers/multiplicity_verify_basic.js +196 -0
- package/dist/helpers/shift.js +48 -0
- package/dist/helpers/zoom.js +32 -0
- package/dist/index.js +705 -0
- package/dist/layer_content.js +125 -0
- package/dist/layer_init.js +231 -0
- package/dist/layer_prism.js +186 -0
- package/dist/reducers/index.js +89 -0
- package/dist/reducers/reducer_edit_peak.js +111 -0
- package/dist/reducers/reducer_forecast.js +113 -0
- package/dist/reducers/reducer_integration.js +136 -0
- package/dist/reducers/reducer_jcamp.js +74 -0
- package/dist/reducers/reducer_layout.js +27 -0
- package/dist/reducers/reducer_manager.js +20 -0
- package/dist/reducers/reducer_meta.js +30 -0
- package/dist/reducers/reducer_multiplicity.js +131 -0
- package/dist/reducers/reducer_scan.js +55 -0
- package/dist/reducers/reducer_shift.js +99 -0
- package/dist/reducers/reducer_simulation.js +30 -0
- package/dist/reducers/reducer_status.js +41 -0
- package/dist/reducers/reducer_submit.js +54 -0
- package/dist/reducers/reducer_threshold.js +34 -0
- package/dist/reducers/reducer_ui.js +46 -0
- package/dist/reducers/undo_redo_config.js +24 -0
- package/dist/sagas/index.js +50 -0
- package/dist/sagas/saga_edit_peak.js +84 -0
- package/dist/sagas/saga_manager.js +116 -0
- package/dist/sagas/saga_meta.js +46 -0
- package/dist/sagas/saga_multiplicity.js +387 -0
- package/dist/sagas/saga_ui.js +392 -0
- package/dist/third_party/jAnalyzer.js +596 -0
- package/dist/third_party/peakInterval.js +107 -0
- package/package.json +77 -0
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _effects = require('redux-saga/effects');
|
|
8
|
+
|
|
9
|
+
var _action_type = require('../constants/action_type');
|
|
10
|
+
|
|
11
|
+
var _multiplicity_calc = require('../helpers/multiplicity_calc');
|
|
12
|
+
|
|
13
|
+
var _multiplicity_manual = require('../helpers/multiplicity_manual');
|
|
14
|
+
|
|
15
|
+
var _marked = /*#__PURE__*/regeneratorRuntime.mark(selectMpy),
|
|
16
|
+
_marked2 = /*#__PURE__*/regeneratorRuntime.mark(addUiPeakToStack),
|
|
17
|
+
_marked3 = /*#__PURE__*/regeneratorRuntime.mark(rmPanelPeakFromStack),
|
|
18
|
+
_marked4 = /*#__PURE__*/regeneratorRuntime.mark(rmUiPeakFromStack),
|
|
19
|
+
_marked5 = /*#__PURE__*/regeneratorRuntime.mark(resetInitNmr),
|
|
20
|
+
_marked6 = /*#__PURE__*/regeneratorRuntime.mark(resetOne),
|
|
21
|
+
_marked7 = /*#__PURE__*/regeneratorRuntime.mark(selectMpyType);
|
|
22
|
+
|
|
23
|
+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
24
|
+
|
|
25
|
+
var getMetaSt = function getMetaSt(state) {
|
|
26
|
+
return state.meta;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var getMultiplicitySt = function getMultiplicitySt(state) {
|
|
30
|
+
return state.multiplicity.present;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
function selectMpy(action) {
|
|
34
|
+
var metaSt, mpySt, _action$payload, xExtent, yExtent, dataPks, shift, stack, xL, xU, yL, yU, peaks, newXExtemt, coupling, m, newStack, payload;
|
|
35
|
+
|
|
36
|
+
return regeneratorRuntime.wrap(function selectMpy$(_context) {
|
|
37
|
+
while (1) {
|
|
38
|
+
switch (_context.prev = _context.next) {
|
|
39
|
+
case 0:
|
|
40
|
+
_context.next = 2;
|
|
41
|
+
return (0, _effects.select)(getMetaSt);
|
|
42
|
+
|
|
43
|
+
case 2:
|
|
44
|
+
metaSt = _context.sent;
|
|
45
|
+
_context.next = 5;
|
|
46
|
+
return (0, _effects.select)(getMultiplicitySt);
|
|
47
|
+
|
|
48
|
+
case 5:
|
|
49
|
+
mpySt = _context.sent;
|
|
50
|
+
_action$payload = action.payload, xExtent = _action$payload.xExtent, yExtent = _action$payload.yExtent, dataPks = _action$payload.dataPks;
|
|
51
|
+
shift = mpySt.shift, stack = mpySt.stack;
|
|
52
|
+
xL = xExtent.xL, xU = xExtent.xU;
|
|
53
|
+
yL = yExtent.yL, yU = yExtent.yU;
|
|
54
|
+
peaks = dataPks.filter(function (p) {
|
|
55
|
+
return xL <= p.x && p.x <= xU && yL <= p.y && p.y <= yU;
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
peaks = peaks.map(function (pk) {
|
|
59
|
+
return { x: pk.x + shift, y: pk.y };
|
|
60
|
+
});
|
|
61
|
+
newXExtemt = { xL: xL + shift, xU: xU + shift };
|
|
62
|
+
coupling = (0, _multiplicity_calc.calcMpyCoup)(peaks, metaSt);
|
|
63
|
+
m = {
|
|
64
|
+
peaks: peaks,
|
|
65
|
+
xExtent: newXExtemt,
|
|
66
|
+
yExtent: yExtent,
|
|
67
|
+
mpyType: coupling.type,
|
|
68
|
+
js: coupling.js
|
|
69
|
+
};
|
|
70
|
+
newStack = [].concat(_toConsumableArray(stack), [m]);
|
|
71
|
+
payload = Object.assign({}, mpySt, { stack: newStack, smExtext: newXExtemt });
|
|
72
|
+
_context.next = 19;
|
|
73
|
+
return (0, _effects.put)({
|
|
74
|
+
type: _action_type.UI.SWEEP.SELECT_MULTIPLICITY_RDC,
|
|
75
|
+
payload: payload
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
case 19:
|
|
79
|
+
case 'end':
|
|
80
|
+
return _context.stop();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}, _marked);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function addUiPeakToStack(action) {
|
|
87
|
+
var metaSt, mpySt, shift, stack, smExtext, _action$payload2, x, y, newPeak, xL, xU, isDuplicate, newStack, payload;
|
|
88
|
+
|
|
89
|
+
return regeneratorRuntime.wrap(function addUiPeakToStack$(_context2) {
|
|
90
|
+
while (1) {
|
|
91
|
+
switch (_context2.prev = _context2.next) {
|
|
92
|
+
case 0:
|
|
93
|
+
_context2.next = 2;
|
|
94
|
+
return (0, _effects.select)(getMetaSt);
|
|
95
|
+
|
|
96
|
+
case 2:
|
|
97
|
+
metaSt = _context2.sent;
|
|
98
|
+
_context2.next = 5;
|
|
99
|
+
return (0, _effects.select)(getMultiplicitySt);
|
|
100
|
+
|
|
101
|
+
case 5:
|
|
102
|
+
mpySt = _context2.sent;
|
|
103
|
+
shift = mpySt.shift, stack = mpySt.stack, smExtext = mpySt.smExtext;
|
|
104
|
+
_action$payload2 = action.payload, x = _action$payload2.x, y = _action$payload2.y; // eslint-disable-line
|
|
105
|
+
|
|
106
|
+
if (!(!x || !y)) {
|
|
107
|
+
_context2.next = 10;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return _context2.abrupt('return');
|
|
112
|
+
|
|
113
|
+
case 10:
|
|
114
|
+
|
|
115
|
+
x += shift;
|
|
116
|
+
newPeak = { x: x, y: y };
|
|
117
|
+
xL = smExtext.xL, xU = smExtext.xU;
|
|
118
|
+
|
|
119
|
+
if (!(x < xL || xU < x)) {
|
|
120
|
+
_context2.next = 15;
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return _context2.abrupt('return');
|
|
125
|
+
|
|
126
|
+
case 15:
|
|
127
|
+
isDuplicate = false;
|
|
128
|
+
newStack = stack.map(function (k) {
|
|
129
|
+
if (k.xExtent.xL === xL && k.xExtent.xU === xU) {
|
|
130
|
+
var existXs = k.peaks.map(function (pk) {
|
|
131
|
+
return pk.x;
|
|
132
|
+
});
|
|
133
|
+
if (existXs.indexOf(newPeak.x) >= 0) {
|
|
134
|
+
isDuplicate = true;
|
|
135
|
+
return k;
|
|
136
|
+
}
|
|
137
|
+
var newPks = [].concat(_toConsumableArray(k.peaks), [newPeak]);
|
|
138
|
+
var coupling = (0, _multiplicity_calc.calcMpyCoup)(newPks, metaSt);
|
|
139
|
+
return Object.assign({}, k, {
|
|
140
|
+
peaks: newPks,
|
|
141
|
+
mpyType: coupling.type,
|
|
142
|
+
js: coupling.js
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return k;
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
if (!isDuplicate) {
|
|
149
|
+
_context2.next = 19;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return _context2.abrupt('return');
|
|
154
|
+
|
|
155
|
+
case 19:
|
|
156
|
+
payload = Object.assign({}, mpySt, { stack: newStack });
|
|
157
|
+
_context2.next = 22;
|
|
158
|
+
return (0, _effects.put)({
|
|
159
|
+
type: _action_type.MULTIPLICITY.PEAK_ADD_BY_UI_RDC,
|
|
160
|
+
payload: payload
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
case 22:
|
|
164
|
+
case 'end':
|
|
165
|
+
return _context2.stop();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}, _marked2);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
var rmPeakFromStack = function rmPeakFromStack(action, metaSt, mpySt) {
|
|
172
|
+
var _action$payload3 = action.payload,
|
|
173
|
+
peak = _action$payload3.peak,
|
|
174
|
+
xExtent = _action$payload3.xExtent;
|
|
175
|
+
var stack = mpySt.stack;
|
|
176
|
+
|
|
177
|
+
var newStack = stack.map(function (k) {
|
|
178
|
+
if (k.xExtent.xL === xExtent.xL && k.xExtent.xU === xExtent.xU) {
|
|
179
|
+
var newPks = k.peaks.filter(function (pk) {
|
|
180
|
+
return pk.x !== peak.x;
|
|
181
|
+
});
|
|
182
|
+
var coupling = (0, _multiplicity_calc.calcMpyCoup)(newPks, metaSt);
|
|
183
|
+
return Object.assign({}, k, {
|
|
184
|
+
peaks: newPks,
|
|
185
|
+
mpyType: coupling.type,
|
|
186
|
+
js: coupling.js
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
return k;
|
|
190
|
+
});
|
|
191
|
+
newStack = newStack.filter(function (k) {
|
|
192
|
+
return k.peaks.length !== 0;
|
|
193
|
+
});
|
|
194
|
+
if (newStack.length === 0) return Object.assign({}, mpySt, { stack: newStack, smExtext: false });
|
|
195
|
+
var noSmExtext = newStack.map(function (k) {
|
|
196
|
+
return k.xExtent.xL === xExtent.xL && k.xExtent.xU === xExtent.xU ? 1 : 0;
|
|
197
|
+
}).reduce(function (a, s) {
|
|
198
|
+
return a + s;
|
|
199
|
+
}) === 0;
|
|
200
|
+
var newSmExtext = noSmExtext ? newStack[0].xExtent : xExtent;
|
|
201
|
+
return Object.assign({}, mpySt, { stack: newStack, smExtext: newSmExtext });
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
function rmPanelPeakFromStack(action) {
|
|
205
|
+
var metaSt, mpySt, payload;
|
|
206
|
+
return regeneratorRuntime.wrap(function rmPanelPeakFromStack$(_context3) {
|
|
207
|
+
while (1) {
|
|
208
|
+
switch (_context3.prev = _context3.next) {
|
|
209
|
+
case 0:
|
|
210
|
+
_context3.next = 2;
|
|
211
|
+
return (0, _effects.select)(getMetaSt);
|
|
212
|
+
|
|
213
|
+
case 2:
|
|
214
|
+
metaSt = _context3.sent;
|
|
215
|
+
_context3.next = 5;
|
|
216
|
+
return (0, _effects.select)(getMultiplicitySt);
|
|
217
|
+
|
|
218
|
+
case 5:
|
|
219
|
+
mpySt = _context3.sent;
|
|
220
|
+
payload = rmPeakFromStack(action, metaSt, mpySt);
|
|
221
|
+
_context3.next = 9;
|
|
222
|
+
return (0, _effects.put)({
|
|
223
|
+
type: _action_type.MULTIPLICITY.PEAK_RM_BY_PANEL_RDC,
|
|
224
|
+
payload: payload
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
case 9:
|
|
228
|
+
case 'end':
|
|
229
|
+
return _context3.stop();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}, _marked3);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function rmUiPeakFromStack(action) {
|
|
236
|
+
var metaSt, mpySt, peak, xExtent, newAction, payload;
|
|
237
|
+
return regeneratorRuntime.wrap(function rmUiPeakFromStack$(_context4) {
|
|
238
|
+
while (1) {
|
|
239
|
+
switch (_context4.prev = _context4.next) {
|
|
240
|
+
case 0:
|
|
241
|
+
_context4.next = 2;
|
|
242
|
+
return (0, _effects.select)(getMetaSt);
|
|
243
|
+
|
|
244
|
+
case 2:
|
|
245
|
+
metaSt = _context4.sent;
|
|
246
|
+
_context4.next = 5;
|
|
247
|
+
return (0, _effects.select)(getMultiplicitySt);
|
|
248
|
+
|
|
249
|
+
case 5:
|
|
250
|
+
mpySt = _context4.sent;
|
|
251
|
+
peak = action.payload;
|
|
252
|
+
xExtent = mpySt.smExtext;
|
|
253
|
+
newAction = Object.assign({}, action, { payload: { peak: peak, xExtent: xExtent } });
|
|
254
|
+
payload = rmPeakFromStack(newAction, metaSt, mpySt);
|
|
255
|
+
_context4.next = 12;
|
|
256
|
+
return (0, _effects.put)({
|
|
257
|
+
type: _action_type.MULTIPLICITY.PEAK_RM_BY_UI_RDC,
|
|
258
|
+
payload: payload
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
case 12:
|
|
262
|
+
case 'end':
|
|
263
|
+
return _context4.stop();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}, _marked4);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function resetInitNmr(action) {
|
|
270
|
+
var multiplicity, mpySt;
|
|
271
|
+
return regeneratorRuntime.wrap(function resetInitNmr$(_context5) {
|
|
272
|
+
while (1) {
|
|
273
|
+
switch (_context5.prev = _context5.next) {
|
|
274
|
+
case 0:
|
|
275
|
+
multiplicity = action.payload.multiplicity;
|
|
276
|
+
_context5.next = 3;
|
|
277
|
+
return (0, _effects.select)(getMultiplicitySt);
|
|
278
|
+
|
|
279
|
+
case 3:
|
|
280
|
+
mpySt = _context5.sent;
|
|
281
|
+
|
|
282
|
+
if (!multiplicity) {
|
|
283
|
+
_context5.next = 7;
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
_context5.next = 7;
|
|
288
|
+
return (0, _effects.put)({
|
|
289
|
+
type: _action_type.MULTIPLICITY.RESET_ALL_RDC,
|
|
290
|
+
payload: Object.assign({}, mpySt, multiplicity)
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
case 7:
|
|
294
|
+
case 'end':
|
|
295
|
+
return _context5.stop();
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}, _marked5);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function resetOne(action) {
|
|
302
|
+
var xExtent, metaSt, mpySt, stack, newStack, payload;
|
|
303
|
+
return regeneratorRuntime.wrap(function resetOne$(_context6) {
|
|
304
|
+
while (1) {
|
|
305
|
+
switch (_context6.prev = _context6.next) {
|
|
306
|
+
case 0:
|
|
307
|
+
xExtent = action.payload;
|
|
308
|
+
_context6.next = 3;
|
|
309
|
+
return (0, _effects.select)(getMetaSt);
|
|
310
|
+
|
|
311
|
+
case 3:
|
|
312
|
+
metaSt = _context6.sent;
|
|
313
|
+
_context6.next = 6;
|
|
314
|
+
return (0, _effects.select)(getMultiplicitySt);
|
|
315
|
+
|
|
316
|
+
case 6:
|
|
317
|
+
mpySt = _context6.sent;
|
|
318
|
+
stack = mpySt.stack;
|
|
319
|
+
newStack = stack.map(function (k) {
|
|
320
|
+
if (k.xExtent.xL === xExtent.xL && k.xExtent.xU === xExtent.xU) {
|
|
321
|
+
var peaks = k.peaks;
|
|
322
|
+
|
|
323
|
+
var coupling = (0, _multiplicity_calc.calcMpyCoup)(peaks, metaSt);
|
|
324
|
+
return Object.assign({}, k, {
|
|
325
|
+
peaks: peaks,
|
|
326
|
+
mpyType: coupling.type,
|
|
327
|
+
js: coupling.js
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
return k;
|
|
331
|
+
});
|
|
332
|
+
payload = Object.assign({}, mpySt, { stack: newStack });
|
|
333
|
+
_context6.next = 12;
|
|
334
|
+
return (0, _effects.put)({
|
|
335
|
+
type: _action_type.MULTIPLICITY.RESET_ONE_RDC,
|
|
336
|
+
payload: payload
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
case 12:
|
|
340
|
+
case 'end':
|
|
341
|
+
return _context6.stop();
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}, _marked6);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
function selectMpyType(action) {
|
|
348
|
+
var mpySt, metaSt, _action$payload4, mpyType, xExtent, stack, newStack;
|
|
349
|
+
|
|
350
|
+
return regeneratorRuntime.wrap(function selectMpyType$(_context7) {
|
|
351
|
+
while (1) {
|
|
352
|
+
switch (_context7.prev = _context7.next) {
|
|
353
|
+
case 0:
|
|
354
|
+
_context7.next = 2;
|
|
355
|
+
return (0, _effects.select)(getMultiplicitySt);
|
|
356
|
+
|
|
357
|
+
case 2:
|
|
358
|
+
mpySt = _context7.sent;
|
|
359
|
+
_context7.next = 5;
|
|
360
|
+
return (0, _effects.select)(getMetaSt);
|
|
361
|
+
|
|
362
|
+
case 5:
|
|
363
|
+
metaSt = _context7.sent;
|
|
364
|
+
_action$payload4 = action.payload, mpyType = _action$payload4.mpyType, xExtent = _action$payload4.xExtent;
|
|
365
|
+
stack = mpySt.stack;
|
|
366
|
+
newStack = stack.map(function (k) {
|
|
367
|
+
var isTargetStack = k.xExtent.xL === xExtent.xL && k.xExtent.xU === xExtent.xU;
|
|
368
|
+
if (isTargetStack) return (0, _multiplicity_manual.calcMpyManual)(k, mpyType, metaSt);
|
|
369
|
+
return k;
|
|
370
|
+
});
|
|
371
|
+
_context7.next = 11;
|
|
372
|
+
return (0, _effects.put)({
|
|
373
|
+
type: _action_type.MULTIPLICITY.TYPE_SELECT_RDC,
|
|
374
|
+
payload: Object.assign({}, mpySt, { stack: newStack })
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
case 11:
|
|
378
|
+
case 'end':
|
|
379
|
+
return _context7.stop();
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}, _marked7);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
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)];
|
|
386
|
+
|
|
387
|
+
exports.default = multiplicitySagas;
|