@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,15 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
8
|
var d3 = _interopRequireWildcard(require("d3"));
|
|
14
9
|
var _init = require("../../helpers/init");
|
|
15
10
|
var _brush = _interopRequireDefault(require("../../helpers/brush"));
|
|
@@ -17,16 +12,17 @@ var _mount = require("../../helpers/mount");
|
|
|
17
12
|
var _compass = require("../../helpers/compass");
|
|
18
13
|
var _converter = require("../../helpers/converter");
|
|
19
14
|
var _list_layout = require("../../constants/list_layout");
|
|
20
|
-
function _getRequireWildcardCache(
|
|
21
|
-
function _interopRequireWildcard(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
H
|
|
27
|
-
clickUiTargetAct
|
|
28
|
-
selectUiSweepAct
|
|
29
|
-
scrollUiWheelAct
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
class RectFocus {
|
|
18
|
+
constructor(props) {
|
|
19
|
+
const {
|
|
20
|
+
W,
|
|
21
|
+
H,
|
|
22
|
+
clickUiTargetAct,
|
|
23
|
+
selectUiSweepAct,
|
|
24
|
+
scrollUiWheelAct
|
|
25
|
+
} = props;
|
|
30
26
|
this.rootKlass = '.d3Rect';
|
|
31
27
|
this.margin = {
|
|
32
28
|
t: 5,
|
|
@@ -70,203 +66,162 @@ var RectFocus = /*#__PURE__*/function () {
|
|
|
70
66
|
this.mergedPeaks = this.mergedPeaks.bind(this);
|
|
71
67
|
this.isFirefox = typeof InstallTrigger !== 'undefined';
|
|
72
68
|
}
|
|
73
|
-
(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
69
|
+
setTip() {
|
|
70
|
+
this.tip = (0, _init.InitTip)();
|
|
71
|
+
this.root.call(this.tip);
|
|
72
|
+
}
|
|
73
|
+
setDataParams(data, peaks, tTrEndPts, tSfPeaks) {
|
|
74
|
+
this.data = [...data];
|
|
75
|
+
this.dataPks = [...peaks];
|
|
76
|
+
this.tTrEndPts = tTrEndPts;
|
|
77
|
+
this.tSfPeaks = tSfPeaks;
|
|
78
|
+
}
|
|
79
|
+
updatePathCall(xt, yt) {
|
|
80
|
+
this.pathCall = d3.line().x(d => xt(d.x)).y(d => yt(d.y));
|
|
81
|
+
}
|
|
82
|
+
setConfig(sweepExtentSt) {
|
|
83
|
+
// Domain Calculate
|
|
84
|
+
let {
|
|
85
|
+
xExtent,
|
|
86
|
+
yExtent
|
|
87
|
+
} = sweepExtentSt || {
|
|
88
|
+
xExtent: false,
|
|
89
|
+
yExtent: false
|
|
90
|
+
};
|
|
91
|
+
if (!xExtent || !yExtent) {
|
|
92
|
+
const xes = d3.extent(this.data, d => d.x).sort((a, b) => a - b);
|
|
93
|
+
xExtent = {
|
|
94
|
+
xL: xes[0] - 10,
|
|
95
|
+
xU: xes[1] + 10
|
|
96
|
+
};
|
|
97
|
+
const btm = 0; // MS baseline is always 0.
|
|
98
|
+
const top = d3.max(this.data, d => d.y);
|
|
99
|
+
const height = top - btm;
|
|
100
|
+
yExtent = {
|
|
101
|
+
yL: btm - this.factor * height,
|
|
102
|
+
yU: top + this.factor * height
|
|
103
|
+
};
|
|
95
104
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
value: function setConfig(sweepExtentSt) {
|
|
99
|
-
// Domain Calculate
|
|
100
|
-
var _ref = sweepExtentSt || {
|
|
101
|
-
xExtent: false,
|
|
102
|
-
yExtent: false
|
|
103
|
-
},
|
|
104
|
-
xExtent = _ref.xExtent,
|
|
105
|
-
yExtent = _ref.yExtent;
|
|
106
|
-
if (!xExtent || !yExtent) {
|
|
107
|
-
var xes = d3.extent(this.data, function (d) {
|
|
108
|
-
return d.x;
|
|
109
|
-
}).sort(function (a, b) {
|
|
110
|
-
return a - b;
|
|
111
|
-
});
|
|
112
|
-
xExtent = {
|
|
113
|
-
xL: xes[0] - 10,
|
|
114
|
-
xU: xes[1] + 10
|
|
115
|
-
};
|
|
116
|
-
var btm = 0; // MS baseline is always 0.
|
|
117
|
-
var top = d3.max(this.data, function (d) {
|
|
118
|
-
return d.y;
|
|
119
|
-
});
|
|
120
|
-
var height = top - btm;
|
|
121
|
-
yExtent = {
|
|
122
|
-
yL: btm - this.factor * height,
|
|
123
|
-
yU: top + this.factor * height
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
this.scales.x.domain([xExtent.xL, xExtent.xU]);
|
|
127
|
-
this.scales.y.domain([yExtent.yL, yExtent.yU]);
|
|
105
|
+
this.scales.x.domain([xExtent.xL, xExtent.xU]);
|
|
106
|
+
this.scales.y.domain([yExtent.yL, yExtent.yU]);
|
|
128
107
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
108
|
+
// rescale for zoom
|
|
109
|
+
const {
|
|
110
|
+
xt,
|
|
111
|
+
yt
|
|
112
|
+
} = (0, _compass.TfRescale)(this);
|
|
133
113
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
114
|
+
// Axis Call
|
|
115
|
+
this.axisCall.x.scale(xt);
|
|
116
|
+
this.axisCall.y.scale(yt);
|
|
117
|
+
this.currentExtent = {
|
|
118
|
+
xExtent,
|
|
119
|
+
yExtent
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
posHeight(gnd, val) {
|
|
123
|
+
const h = gnd - val;
|
|
124
|
+
return h >= 0 ? h : 0;
|
|
125
|
+
}
|
|
126
|
+
barColor(y, yRef) {
|
|
127
|
+
return y >= yRef ? 'steelblue' : '#aaa';
|
|
128
|
+
}
|
|
129
|
+
drawBar() {
|
|
130
|
+
const {
|
|
131
|
+
xt,
|
|
132
|
+
yt
|
|
133
|
+
} = (0, _compass.TfRescale)(this);
|
|
134
|
+
this.updatePathCall(xt, yt);
|
|
135
|
+
const yRef = this.tTrEndPts[0].y;
|
|
136
|
+
const bars = this.bars.selectAll('rect').data(this.data);
|
|
137
|
+
bars.exit().attr('class', 'exit').remove();
|
|
138
|
+
const gnd = yt(0);
|
|
139
|
+
bars.enter().append('rect').attr('class', 'enter-bar').attr('width', 1.5).merge(bars).attr('fill', d => this.barColor(d.y, yRef)).attr('height', d => this.posHeight(gnd, yt(d.y))).attr('id', d => `mpp${Math.round(1000 * d.x)}`).attr('transform', d => `translate(${xt(d.x)}, ${yt(d.y)})`).on('mouseover', (d, i, n) => {
|
|
140
|
+
d3.select(`#mpp${Math.round(1000 * d.x)}`).attr('stroke-opacity', '1.0');
|
|
141
|
+
d3.select(`#bpt${Math.round(1000 * d.x)}`).style('fill', 'blue');
|
|
142
|
+
const tipParams = {
|
|
143
|
+
d,
|
|
144
|
+
layout: this.layout
|
|
140
145
|
};
|
|
146
|
+
this.tip.show(tipParams, n[i]);
|
|
147
|
+
}).on('mouseout', (d, i, n) => {
|
|
148
|
+
d3.select(`#mpp${Math.round(1000 * d.x)}`).attr('stroke-opacity', '1.0');
|
|
149
|
+
d3.select(`#bpt${Math.round(1000 * d.x)}`).style('fill', 'red');
|
|
150
|
+
const tipParams = {
|
|
151
|
+
d,
|
|
152
|
+
layout: this.layout
|
|
153
|
+
};
|
|
154
|
+
this.tip.hide(tipParams, n[i]);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
drawThres() {
|
|
158
|
+
if (this.tTrEndPts.length > 0) {
|
|
159
|
+
this.thresLine.attr('d', this.pathCall(this.tTrEndPts));
|
|
160
|
+
this.thresLine.attr('visibility', 'visible');
|
|
161
|
+
} else {
|
|
162
|
+
this.thresLine.attr('visibility', 'hidden');
|
|
141
163
|
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}).on('mouseout', function (d, i, n) {
|
|
182
|
-
d3.select("#mpp".concat(Math.round(1000 * d.x))).attr('stroke-opacity', '1.0');
|
|
183
|
-
d3.select("#bpt".concat(Math.round(1000 * d.x))).style('fill', 'red');
|
|
184
|
-
var tipParams = {
|
|
185
|
-
d: d,
|
|
186
|
-
layout: _this.layout
|
|
187
|
-
};
|
|
188
|
-
_this.tip.hide(tipParams, n[i]);
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
}, {
|
|
192
|
-
key: "drawThres",
|
|
193
|
-
value: function drawThres() {
|
|
194
|
-
if (this.tTrEndPts.length > 0) {
|
|
195
|
-
this.thresLine.attr('d', this.pathCall(this.tTrEndPts));
|
|
196
|
-
this.thresLine.attr('visibility', 'visible');
|
|
197
|
-
} else {
|
|
198
|
-
this.thresLine.attr('visibility', 'hidden');
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}, {
|
|
202
|
-
key: "drawGrid",
|
|
203
|
-
value: function drawGrid() {
|
|
204
|
-
this.grid.x.call(this.axisCall.x.tickSize(-this.h, 0, 0)).selectAll('line').attr('stroke', '#ddd').attr('stroke-opacity', 0.6).attr('fill', 'none');
|
|
205
|
-
this.grid.y.call(this.axisCall.y.tickSize(-this.w, 0, 0)).selectAll('line').attr('stroke', '#ddd').attr('stroke-opacity', 0.6).attr('fill', 'none');
|
|
206
|
-
}
|
|
207
|
-
}, {
|
|
208
|
-
key: "mergedPeaks",
|
|
209
|
-
value: function mergedPeaks(editPeakSt) {
|
|
210
|
-
if (!editPeakSt) return this.dataPks;
|
|
211
|
-
this.dataPks = (0, _converter.PksEdit)(this.dataPks, editPeakSt);
|
|
212
|
-
return this.dataPks;
|
|
213
|
-
}
|
|
214
|
-
}, {
|
|
215
|
-
key: "create",
|
|
216
|
-
value: function create(_ref2) {
|
|
217
|
-
var filterSeed = _ref2.filterSeed,
|
|
218
|
-
filterPeak = _ref2.filterPeak,
|
|
219
|
-
tTrEndPts = _ref2.tTrEndPts,
|
|
220
|
-
tSfPeaks = _ref2.tSfPeaks,
|
|
221
|
-
sweepExtentSt = _ref2.sweepExtentSt,
|
|
222
|
-
isUiAddIntgSt = _ref2.isUiAddIntgSt,
|
|
223
|
-
isUiNoBrushSt = _ref2.isUiNoBrushSt;
|
|
224
|
-
this.svg = d3.select('.d3Svg');
|
|
225
|
-
(0, _mount.MountMainFrame)(this, 'focus');
|
|
226
|
-
(0, _mount.MountClip)(this);
|
|
227
|
-
this.root = d3.select(this.rootKlass).selectAll('.focus-main');
|
|
228
|
-
this.setTip();
|
|
229
|
-
this.setDataParams(filterSeed, filterPeak, tTrEndPts, tSfPeaks);
|
|
230
|
-
(0, _compass.MountCompass)(this);
|
|
231
|
-
this.axis = (0, _mount.MountAxis)(this);
|
|
232
|
-
var _MountThresLine = (0, _mount.MountThresLine)(this, 'green');
|
|
233
|
-
var _MountThresLine2 = (0, _slicedToArray2.default)(_MountThresLine, 1);
|
|
234
|
-
this.thresLine = _MountThresLine2[0];
|
|
235
|
-
this.grid = (0, _mount.MountGrid)(this);
|
|
236
|
-
this.ref = (0, _mount.MountRef)(this);
|
|
237
|
-
this.bars = (0, _mount.MountBars)(this);
|
|
238
|
-
(0, _mount.MountAxisLabelX)(this);
|
|
239
|
-
(0, _mount.MountAxisLabelY)(this);
|
|
240
|
-
if (this.data && this.data.length > 0) {
|
|
241
|
-
this.setConfig(sweepExtentSt);
|
|
242
|
-
this.drawBar();
|
|
243
|
-
this.drawThres();
|
|
244
|
-
this.drawGrid();
|
|
245
|
-
}
|
|
246
|
-
(0, _brush.default)(this, isUiAddIntgSt, isUiNoBrushSt);
|
|
164
|
+
}
|
|
165
|
+
drawGrid() {
|
|
166
|
+
this.grid.x.call(this.axisCall.x.tickSize(-this.h, 0, 0)).selectAll('line').attr('stroke', '#ddd').attr('stroke-opacity', 0.6).attr('fill', 'none');
|
|
167
|
+
this.grid.y.call(this.axisCall.y.tickSize(-this.w, 0, 0)).selectAll('line').attr('stroke', '#ddd').attr('stroke-opacity', 0.6).attr('fill', 'none');
|
|
168
|
+
}
|
|
169
|
+
mergedPeaks(editPeakSt) {
|
|
170
|
+
if (!editPeakSt) return this.dataPks;
|
|
171
|
+
this.dataPks = (0, _converter.PksEdit)(this.dataPks, editPeakSt);
|
|
172
|
+
return this.dataPks;
|
|
173
|
+
}
|
|
174
|
+
create(_ref) {
|
|
175
|
+
let {
|
|
176
|
+
filterSeed,
|
|
177
|
+
filterPeak,
|
|
178
|
+
tTrEndPts,
|
|
179
|
+
tSfPeaks,
|
|
180
|
+
sweepExtentSt,
|
|
181
|
+
isUiAddIntgSt,
|
|
182
|
+
isUiNoBrushSt
|
|
183
|
+
} = _ref;
|
|
184
|
+
this.svg = d3.select('.d3Svg');
|
|
185
|
+
(0, _mount.MountMainFrame)(this, 'focus');
|
|
186
|
+
(0, _mount.MountClip)(this);
|
|
187
|
+
this.root = d3.select(this.rootKlass).selectAll('.focus-main');
|
|
188
|
+
this.setTip();
|
|
189
|
+
this.setDataParams(filterSeed, filterPeak, tTrEndPts, tSfPeaks);
|
|
190
|
+
(0, _compass.MountCompass)(this);
|
|
191
|
+
this.axis = (0, _mount.MountAxis)(this);
|
|
192
|
+
[this.thresLine] = (0, _mount.MountThresLine)(this, 'green');
|
|
193
|
+
this.grid = (0, _mount.MountGrid)(this);
|
|
194
|
+
this.ref = (0, _mount.MountRef)(this);
|
|
195
|
+
this.bars = (0, _mount.MountBars)(this);
|
|
196
|
+
(0, _mount.MountAxisLabelX)(this);
|
|
197
|
+
(0, _mount.MountAxisLabelY)(this);
|
|
198
|
+
if (this.data && this.data.length > 0) {
|
|
199
|
+
this.setConfig(sweepExtentSt);
|
|
200
|
+
this.drawBar();
|
|
201
|
+
this.drawThres();
|
|
202
|
+
this.drawGrid();
|
|
247
203
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
204
|
+
(0, _brush.default)(this, isUiAddIntgSt, isUiNoBrushSt);
|
|
205
|
+
}
|
|
206
|
+
update(_ref2) {
|
|
207
|
+
let {
|
|
208
|
+
filterSeed,
|
|
209
|
+
filterPeak,
|
|
210
|
+
tTrEndPts,
|
|
211
|
+
tSfPeaks,
|
|
212
|
+
sweepExtentSt,
|
|
213
|
+
isUiAddIntgSt,
|
|
214
|
+
isUiNoBrushSt
|
|
215
|
+
} = _ref2;
|
|
216
|
+
this.root = d3.select(this.rootKlass).selectAll('.focus-main');
|
|
217
|
+
this.setDataParams(filterSeed, filterPeak, tTrEndPts, tSfPeaks);
|
|
218
|
+
if (this.data && this.data.length > 0) {
|
|
219
|
+
this.setConfig(sweepExtentSt);
|
|
220
|
+
this.drawBar();
|
|
221
|
+
this.drawThres();
|
|
222
|
+
this.drawGrid();
|
|
267
223
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
var _default = RectFocus;
|
|
272
|
-
exports.default = _default;
|
|
224
|
+
(0, _brush.default)(this, isUiAddIntgSt, isUiNoBrushSt);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
var _default = exports.default = RectFocus;
|
|
@@ -22,7 +22,7 @@ var _section_loading = _interopRequireDefault(require("./section_loading"));
|
|
|
22
22
|
/* eslint-disable react/function-component-definition, react/destructuring-assignment,
|
|
23
23
|
max-len */
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
const titleStyle = {
|
|
26
26
|
backgroundColor: '#f5f5f5',
|
|
27
27
|
border: '2px solid #e3e3e3',
|
|
28
28
|
borderRadius: '10px',
|
|
@@ -33,17 +33,17 @@ var titleStyle = {
|
|
|
33
33
|
textAlign: 'center',
|
|
34
34
|
width: '70%'
|
|
35
35
|
};
|
|
36
|
-
|
|
36
|
+
const txtStyle = {
|
|
37
37
|
lineHeight: '20px'
|
|
38
38
|
};
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
const TxtLabel = function (classes, label) {
|
|
40
|
+
let extClsName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'txt-label';
|
|
41
41
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
42
42
|
className: (0, _classnames.default)(classes.txtLabel, extClsName)
|
|
43
43
|
}, label);
|
|
44
44
|
};
|
|
45
45
|
exports.TxtLabel = TxtLabel;
|
|
46
|
-
|
|
46
|
+
const StatusIcon = status => {
|
|
47
47
|
switch (status) {
|
|
48
48
|
case 'accept':
|
|
49
49
|
return /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
@@ -105,16 +105,16 @@ var StatusIcon = function StatusIcon(status) {
|
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
107
|
exports.StatusIcon = StatusIcon;
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
const ConfidenceLabel = function (classes, confidence) {
|
|
109
|
+
let extClsName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'txt-label';
|
|
110
110
|
if (!confidence) return /*#__PURE__*/_react.default.createElement("span", null, " - - ");
|
|
111
|
-
|
|
111
|
+
const confidenceDp = parseFloat(Math.round(confidence * 100) / 100).toFixed(2);
|
|
112
112
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
113
113
|
className: (0, _classnames.default)(classes.txtLabel, extClsName)
|
|
114
|
-
},
|
|
114
|
+
}, `${confidenceDp} %`);
|
|
115
115
|
};
|
|
116
116
|
exports.ConfidenceLabel = ConfidenceLabel;
|
|
117
|
-
|
|
117
|
+
const sectionInput = (classes, molecule, inputFuncCb) => {
|
|
118
118
|
if (!inputFuncCb) return null;
|
|
119
119
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
120
120
|
className: (0, _classnames.default)(classes.inputRoot)
|
|
@@ -135,61 +135,53 @@ var sectionInput = function sectionInput(classes, molecule, inputFuncCb) {
|
|
|
135
135
|
}))));
|
|
136
136
|
};
|
|
137
137
|
exports.sectionInput = sectionInput;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}, /*#__PURE__*/_react.default.createElement(_HelpOutline.default, {
|
|
186
|
-
style: {
|
|
187
|
-
color: 'purple',
|
|
188
|
-
fontSize: 50
|
|
189
|
-
}
|
|
190
|
-
}), /*#__PURE__*/_react.default.createElement("p", null, "Unknown state.")));
|
|
191
|
-
};
|
|
192
|
-
var notToRenderAnalysis = function notToRenderAnalysis(pds) {
|
|
138
|
+
const SectionRunning = () => /*#__PURE__*/_react.default.createElement("div", {
|
|
139
|
+
style: titleStyle
|
|
140
|
+
}, /*#__PURE__*/_react.default.createElement("h2", {
|
|
141
|
+
style: txtStyle
|
|
142
|
+
}, /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
|
|
143
|
+
style: {
|
|
144
|
+
color: 'blue',
|
|
145
|
+
fontSize: 50
|
|
146
|
+
}
|
|
147
|
+
}), /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("p", null, "The server is making predictions...")));
|
|
148
|
+
const SectionMissMatch = () => /*#__PURE__*/_react.default.createElement("div", {
|
|
149
|
+
style: titleStyle
|
|
150
|
+
}, /*#__PURE__*/_react.default.createElement("h2", {
|
|
151
|
+
style: txtStyle
|
|
152
|
+
}, /*#__PURE__*/_react.default.createElement(_ErrorOutline.default, {
|
|
153
|
+
style: {
|
|
154
|
+
color: 'red',
|
|
155
|
+
fontSize: 50
|
|
156
|
+
}
|
|
157
|
+
}), /*#__PURE__*/_react.default.createElement("p", {
|
|
158
|
+
className: "txt-predict-fail"
|
|
159
|
+
}, "Peak & Element count mismatch!"), /*#__PURE__*/_react.default.createElement("p", {
|
|
160
|
+
className: "txt-predict-fail"
|
|
161
|
+
}, /*#__PURE__*/_react.default.createElement("sup", null, "1"), "H multiplicity count should not be more than the proton group count. Multiplicity must be assigned manulally before predictions."), /*#__PURE__*/_react.default.createElement("p", {
|
|
162
|
+
className: "txt-predict-fail"
|
|
163
|
+
}, /*#__PURE__*/_react.default.createElement("sup", null, "13"), "C peak count should not be more than the carbon count, and solvent peaks should be excluded.")));
|
|
164
|
+
const SectionNoService = () => /*#__PURE__*/_react.default.createElement("div", {
|
|
165
|
+
style: titleStyle
|
|
166
|
+
}, /*#__PURE__*/_react.default.createElement("h2", {
|
|
167
|
+
style: txtStyle
|
|
168
|
+
}, /*#__PURE__*/_react.default.createElement(_CloudOff.default, {
|
|
169
|
+
style: {
|
|
170
|
+
color: 'red',
|
|
171
|
+
fontSize: 50
|
|
172
|
+
}
|
|
173
|
+
}), /*#__PURE__*/_react.default.createElement("p", null, "Service is not available."), /*#__PURE__*/_react.default.createElement("p", null, "Please try it again later.")));
|
|
174
|
+
const SectionUnknown = () => /*#__PURE__*/_react.default.createElement("div", {
|
|
175
|
+
style: titleStyle
|
|
176
|
+
}, /*#__PURE__*/_react.default.createElement("h2", {
|
|
177
|
+
style: txtStyle
|
|
178
|
+
}, /*#__PURE__*/_react.default.createElement(_HelpOutline.default, {
|
|
179
|
+
style: {
|
|
180
|
+
color: 'purple',
|
|
181
|
+
fontSize: 50
|
|
182
|
+
}
|
|
183
|
+
}), /*#__PURE__*/_react.default.createElement("p", null, "Unknown state.")));
|
|
184
|
+
const notToRenderAnalysis = pds => {
|
|
193
185
|
if (pds.running) return /*#__PURE__*/_react.default.createElement(SectionRunning, null);
|
|
194
186
|
if (!pds.outline || !pds.outline.code) return /*#__PURE__*/_react.default.createElement("div", null);
|
|
195
187
|
if (pds.outline.code >= 500) return /*#__PURE__*/_react.default.createElement(SectionNoService, null);
|
|
@@ -198,11 +190,11 @@ var notToRenderAnalysis = function notToRenderAnalysis(pds) {
|
|
|
198
190
|
return false;
|
|
199
191
|
};
|
|
200
192
|
exports.notToRenderAnalysis = notToRenderAnalysis;
|
|
201
|
-
|
|
202
|
-
|
|
193
|
+
const sectionSvg = (classes, predictions) => {
|
|
194
|
+
const renderMsg = notToRenderAnalysis(predictions);
|
|
203
195
|
if (renderMsg) return null;
|
|
204
196
|
if (!predictions.output) return null;
|
|
205
|
-
|
|
197
|
+
const targetSvg = predictions.output.result[0].svgs[0];
|
|
206
198
|
if (!targetSvg) return /*#__PURE__*/_react.default.createElement(_section_loading.default, null);
|
|
207
199
|
return /*#__PURE__*/_react.default.createElement(_reactSvgFileZoomPan.default, {
|
|
208
200
|
svg: targetSvg,
|