@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
package/dist/helpers/brush.js
CHANGED
|
@@ -1,70 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
7
|
var d3 = _interopRequireWildcard(require("d3"));
|
|
11
8
|
var _compass = require("./compass");
|
|
12
|
-
function _getRequireWildcardCache(
|
|
13
|
-
function _interopRequireWildcard(
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
11
|
/* eslint-disable prefer-object-spread */
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
const wheeled = focus => {
|
|
14
|
+
const {
|
|
15
|
+
currentExtent,
|
|
16
|
+
scrollUiWheelAct
|
|
17
|
+
} = focus;
|
|
19
18
|
// WORKAROUND: firefox wheel compatibilty
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const wheelEvent = focus.isFirefox ? -d3.event.deltaY : d3.event.wheelDelta; // eslint-disable-line
|
|
20
|
+
const direction = wheelEvent > 0;
|
|
22
21
|
scrollUiWheelAct(Object.assign({}, currentExtent, {
|
|
23
|
-
direction
|
|
22
|
+
direction
|
|
24
23
|
}));
|
|
25
24
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
const brushed = (focus, isUiAddIntgSt) => {
|
|
26
|
+
const {
|
|
27
|
+
selectUiSweepAct,
|
|
28
|
+
data,
|
|
29
|
+
dataPks,
|
|
30
|
+
brush,
|
|
31
|
+
w,
|
|
32
|
+
h,
|
|
33
|
+
scales
|
|
34
|
+
} = focus;
|
|
35
|
+
const selection = d3.event.selection && d3.event.selection.reverse();
|
|
35
36
|
if (!selection) return;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var yes = [h, 0].map(scales.y.invert).sort(function (a, b) {
|
|
40
|
-
return a - b;
|
|
41
|
-
});
|
|
42
|
-
var xExtent = {
|
|
37
|
+
let xes = [w, 0].map(scales.x.invert).sort((a, b) => a - b);
|
|
38
|
+
let yes = [h, 0].map(scales.y.invert).sort((a, b) => a - b);
|
|
39
|
+
let xExtent = {
|
|
43
40
|
xL: xes[0],
|
|
44
41
|
xU: xes[1]
|
|
45
42
|
};
|
|
46
|
-
|
|
43
|
+
let yExtent = {
|
|
47
44
|
yL: yes[0],
|
|
48
45
|
yU: yes[1]
|
|
49
46
|
};
|
|
50
47
|
if (isUiAddIntgSt) {
|
|
51
|
-
xes = selection.map(scales.x.invert).sort(
|
|
52
|
-
return a - b;
|
|
53
|
-
});
|
|
48
|
+
xes = selection.map(scales.x.invert).sort((a, b) => a - b);
|
|
54
49
|
xExtent = {
|
|
55
50
|
xL: xes[0],
|
|
56
51
|
xU: xes[1]
|
|
57
52
|
};
|
|
58
53
|
} else {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
xes = [begPt[0], endPt[0]].map(scales.x.invert).sort(function (a, b) {
|
|
63
|
-
return a - b;
|
|
64
|
-
});
|
|
65
|
-
yes = [begPt[1], endPt[1]].map(scales.y.invert).sort(function (a, b) {
|
|
66
|
-
return a - b;
|
|
67
|
-
});
|
|
54
|
+
const [begPt, endPt] = selection;
|
|
55
|
+
xes = [begPt[0], endPt[0]].map(scales.x.invert).sort((a, b) => a - b);
|
|
56
|
+
yes = [begPt[1], endPt[1]].map(scales.y.invert).sort((a, b) => a - b);
|
|
68
57
|
xExtent = {
|
|
69
58
|
xL: xes[0],
|
|
70
59
|
xU: xes[1]
|
|
@@ -75,44 +64,39 @@ var brushed = function brushed(focus, isUiAddIntgSt) {
|
|
|
75
64
|
};
|
|
76
65
|
}
|
|
77
66
|
selectUiSweepAct({
|
|
78
|
-
xExtent
|
|
79
|
-
yExtent
|
|
80
|
-
data
|
|
81
|
-
dataPks
|
|
67
|
+
xExtent,
|
|
68
|
+
yExtent,
|
|
69
|
+
data,
|
|
70
|
+
dataPks
|
|
82
71
|
});
|
|
83
72
|
d3.select('.d3Svg').selectAll('.brush').call(brush.move, null);
|
|
84
73
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
74
|
+
const MountBrush = (focus, isUiAddIntgSt, isUiNoBrushSt) => {
|
|
75
|
+
const {
|
|
76
|
+
root,
|
|
77
|
+
svg,
|
|
78
|
+
brush,
|
|
79
|
+
brushX,
|
|
80
|
+
w,
|
|
81
|
+
h
|
|
82
|
+
} = focus;
|
|
92
83
|
svg.selectAll('.brush').remove();
|
|
93
84
|
svg.selectAll('.brushX').remove();
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
};
|
|
97
|
-
var wheeledCb = function wheeledCb() {
|
|
98
|
-
return wheeled(focus);
|
|
99
|
-
};
|
|
85
|
+
const brushedCb = () => brushed(focus, isUiAddIntgSt);
|
|
86
|
+
const wheeledCb = () => wheeled(focus);
|
|
100
87
|
if (isUiNoBrushSt) {
|
|
101
|
-
|
|
88
|
+
const target = isUiAddIntgSt ? brushX : brush;
|
|
102
89
|
target.handleSize(10).extent([[0, 0], [w, h]]).on('end', brushedCb);
|
|
103
90
|
|
|
104
91
|
// append brush components
|
|
105
|
-
|
|
106
|
-
root.append('g').attr('class', klass).on('mousemove',
|
|
107
|
-
return (0, _compass.MouseMove)(focus);
|
|
108
|
-
}).call(target);
|
|
92
|
+
const klass = isUiAddIntgSt ? 'brushX' : 'brush';
|
|
93
|
+
root.append('g').attr('class', klass).on('mousemove', () => (0, _compass.MouseMove)(focus)).call(target);
|
|
109
94
|
}
|
|
110
95
|
svg.on('wheel', wheeledCb);
|
|
111
96
|
};
|
|
112
|
-
var _default = MountBrush; // const resetedCb = () => reseted(main);
|
|
97
|
+
var _default = exports.default = MountBrush; // const resetedCb = () => reseted(main);
|
|
113
98
|
// main.svg.on('dblclick', resetedCb);
|
|
114
99
|
// const reseted = (main) => {
|
|
115
100
|
// const { selectUiSweepAct } = main;
|
|
116
101
|
// selectUiSweepAct({ xExtent: false, yExtent: false });
|
|
117
|
-
// };
|
|
118
|
-
exports.default = _default;
|
|
102
|
+
// };
|
package/dist/helpers/calc.js
CHANGED
|
@@ -4,11 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.calcSlope = exports.almostEqual = void 0;
|
|
7
|
-
|
|
8
|
-
return Math.abs(a - b) < 0.00000001 * Math.abs(a + b);
|
|
9
|
-
};
|
|
7
|
+
const almostEqual = (a, b) => Math.abs(a - b) < 0.00000001 * Math.abs(a + b);
|
|
10
8
|
exports.almostEqual = almostEqual;
|
|
11
|
-
|
|
9
|
+
const calcSlope = (x1, y1, x2, y2) => {
|
|
12
10
|
if (x2 === x1) {
|
|
13
11
|
return 0;
|
|
14
12
|
}
|
|
@@ -1,45 +1,47 @@
|
|
|
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.carbonFeatures = void 0;
|
|
8
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
7
|
var _multiplicity_calc = require("./multiplicity_calc");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
const carbonFeatures = (peaksEdit, multiplicitySt) => {
|
|
9
|
+
const {
|
|
10
|
+
selectedIdx,
|
|
11
|
+
multiplicities
|
|
12
|
+
} = multiplicitySt;
|
|
13
|
+
const selectedMultiplicity = multiplicities[selectedIdx];
|
|
14
|
+
const {
|
|
15
|
+
stack,
|
|
16
|
+
shift
|
|
17
|
+
} = selectedMultiplicity;
|
|
18
|
+
const nmrMpyCenters = stack.map(stk => {
|
|
17
19
|
// eslint-disable-line
|
|
18
20
|
return {
|
|
19
21
|
x: (0, _multiplicity_calc.calcMpyCenter)(stk.peaks, shift, stk.mpyType),
|
|
20
22
|
y: 0
|
|
21
23
|
};
|
|
22
24
|
});
|
|
23
|
-
|
|
24
|
-
stack.forEach(
|
|
25
|
+
let targetIdxs = [];
|
|
26
|
+
stack.forEach(stk => {
|
|
25
27
|
// find peak idxs to be removed
|
|
26
|
-
stk.peaks.forEach(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
peaksEdit.forEach(
|
|
30
|
-
|
|
28
|
+
stk.peaks.forEach(p => {
|
|
29
|
+
let targetIdx = -1;
|
|
30
|
+
let minDiff = 999999999;
|
|
31
|
+
peaksEdit.forEach((pe, idx) => {
|
|
32
|
+
const xDiff = Math.abs(pe.x - p.x);
|
|
31
33
|
if (xDiff < minDiff) {
|
|
32
34
|
targetIdx = idx;
|
|
33
35
|
minDiff = xDiff;
|
|
34
36
|
}
|
|
35
37
|
});
|
|
36
|
-
targetIdxs = [
|
|
38
|
+
targetIdxs = [...targetIdxs, targetIdx];
|
|
37
39
|
});
|
|
38
40
|
});
|
|
39
|
-
|
|
40
|
-
peaksEdit.forEach(
|
|
41
|
+
let features = [...nmrMpyCenters];
|
|
42
|
+
peaksEdit.forEach((pe, idx) => {
|
|
41
43
|
if (targetIdxs.indexOf(idx) < 0) {
|
|
42
|
-
features = [
|
|
44
|
+
features = [...features, pe];
|
|
43
45
|
}
|
|
44
46
|
});
|
|
45
47
|
return features;
|
package/dist/helpers/cfg.js
CHANGED
|
@@ -6,77 +6,59 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _format = _interopRequireDefault(require("./format"));
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var btnCmdAddPeak = function btnCmdAddPeak(layoutSt) {
|
|
16
|
-
return _format.default.isMsLayout(layoutSt);
|
|
17
|
-
};
|
|
18
|
-
var btnCmdRmPeak = function btnCmdRmPeak(layoutSt) {
|
|
19
|
-
return _format.default.isMsLayout(layoutSt);
|
|
20
|
-
};
|
|
21
|
-
var btnCmdSetRef = function btnCmdSetRef(layoutSt) {
|
|
22
|
-
return !_format.default.isNmrLayout(layoutSt);
|
|
23
|
-
};
|
|
24
|
-
var btnCmdIntg = function btnCmdIntg(layoutSt) {
|
|
25
|
-
return !(_format.default.isNmrLayout(layoutSt) || _format.default.isHplcUvVisLayout(layoutSt));
|
|
26
|
-
}; // eslint-disable-line
|
|
9
|
+
const btnCmdAnaViewer = layoutSt => _format.default.isMsLayout(layoutSt) || _format.default.isRamanLayout(layoutSt) || _format.default.is19FLayout(layoutSt) || _format.default.isUvVisLayout(layoutSt) || _format.default.isHplcUvVisLayout(layoutSt) || _format.default.isTGALayout(layoutSt) || _format.default.isXRDLayout(layoutSt) || _format.default.is31PLayout(layoutSt) || _format.default.is15NLayout(layoutSt) || _format.default.is29SiLayout(layoutSt) || _format.default.isCyclicVoltaLayout(layoutSt) || _format.default.isCDSLayout(layoutSt) || _format.default.isSECLayout(layoutSt);
|
|
10
|
+
const hideCmdAnaViewer = () => false;
|
|
11
|
+
const btnCmdAddPeak = layoutSt => _format.default.isMsLayout(layoutSt);
|
|
12
|
+
const btnCmdRmPeak = layoutSt => _format.default.isMsLayout(layoutSt);
|
|
13
|
+
const btnCmdSetRef = layoutSt => !_format.default.isNmrLayout(layoutSt);
|
|
14
|
+
const btnCmdIntg = layoutSt => !(_format.default.isNmrLayout(layoutSt) || _format.default.isHplcUvVisLayout(layoutSt)); // eslint-disable-line
|
|
27
15
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
16
|
+
const btnCmdMpy = layoutSt => !_format.default.isNmrLayout(layoutSt);
|
|
17
|
+
const btnCmdMpyPeak = function (layoutSt, mpySt) {
|
|
18
|
+
let curveIdx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
19
|
+
const {
|
|
20
|
+
multiplicities
|
|
21
|
+
} = mpySt;
|
|
22
|
+
let smExtextVal = false;
|
|
23
|
+
if (multiplicities) {
|
|
24
|
+
const selectedMultiplicity = multiplicities[curveIdx];
|
|
25
|
+
if (selectedMultiplicity) {
|
|
26
|
+
const {
|
|
27
|
+
smExtext
|
|
28
|
+
} = selectedMultiplicity;
|
|
29
|
+
smExtextVal = smExtext;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return btnCmdMpy(layoutSt) || !smExtextVal;
|
|
40
33
|
};
|
|
34
|
+
const hideCmdThres = layoutSt => _format.default.isMsLayout(layoutSt);
|
|
35
|
+
const btnCmdThres = thresVal => !thresVal;
|
|
41
36
|
|
|
42
37
|
// const hidePanelPeak = layoutSt => Format.isMsLayout(layoutSt);
|
|
43
|
-
|
|
44
|
-
return !_format.default.isSECLayout(layoutSt);
|
|
45
|
-
}; // eslint-disable-line
|
|
38
|
+
const hidePanelPeak = layoutSt => !_format.default.isSECLayout(layoutSt); // eslint-disable-line
|
|
46
39
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
var hidePanelCompare = function hidePanelCompare(layoutSt) {
|
|
51
|
-
return !(_format.default.isIrLayout(layoutSt) || _format.default.isHplcUvVisLayout(layoutSt) || _format.default.isXRDLayout(layoutSt));
|
|
52
|
-
}; // eslint-disable-line
|
|
40
|
+
const hidePanelMpy = layoutSt => !_format.default.isNmrLayout(layoutSt);
|
|
41
|
+
const hidePanelCompare = layoutSt => !(_format.default.isIrLayout(layoutSt) || _format.default.isHplcUvVisLayout(layoutSt) || _format.default.isXRDLayout(layoutSt)); // eslint-disable-line
|
|
53
42
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
hidePanelPeak: hidePanelPeak,
|
|
75
|
-
hidePanelMpy: hidePanelMpy,
|
|
76
|
-
hidePanelCompare: hidePanelCompare,
|
|
77
|
-
hideSolvent: hideSolvent,
|
|
78
|
-
showTwoThreshold: showTwoThreshold,
|
|
79
|
-
hidePanelCyclicVolta: hidePanelCyclicVolta
|
|
43
|
+
const hideSolvent = layoutSt => !_format.default.isNmrLayout(layoutSt);
|
|
44
|
+
const showTwoThreshold = layoutSt => _format.default.isCyclicVoltaLayout(layoutSt);
|
|
45
|
+
const hidePanelCyclicVolta = layoutSt => !_format.default.isCyclicVoltaLayout(layoutSt);
|
|
46
|
+
const Config = {
|
|
47
|
+
btnCmdAnaViewer,
|
|
48
|
+
hideCmdAnaViewer,
|
|
49
|
+
btnCmdAddPeak,
|
|
50
|
+
btnCmdRmPeak,
|
|
51
|
+
btnCmdSetRef,
|
|
52
|
+
btnCmdIntg,
|
|
53
|
+
btnCmdMpy,
|
|
54
|
+
btnCmdMpyPeak,
|
|
55
|
+
hideCmdThres,
|
|
56
|
+
btnCmdThres,
|
|
57
|
+
hidePanelPeak,
|
|
58
|
+
hidePanelMpy,
|
|
59
|
+
hidePanelCompare,
|
|
60
|
+
hideSolvent,
|
|
61
|
+
showTwoThreshold,
|
|
62
|
+
hidePanelCyclicVolta
|
|
80
63
|
};
|
|
81
|
-
var _default = Config;
|
|
82
|
-
exports.default = _default;
|
|
64
|
+
var _default = exports.default = Config;
|