@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 _mount = require("../../helpers/mount");
|
|
@@ -23,17 +18,19 @@ var _format = _interopRequireDefault(require("../../helpers/format"));
|
|
|
23
18
|
var _cfg = _interopRequireDefault(require("../../helpers/cfg"));
|
|
24
19
|
var _list_layout = require("../../constants/list_layout");
|
|
25
20
|
var _calc = require("../../helpers/calc");
|
|
26
|
-
function _getRequireWildcardCache(
|
|
27
|
-
function _interopRequireWildcard(
|
|
21
|
+
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); }
|
|
22
|
+
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; }
|
|
28
23
|
/* eslint-disable prefer-object-spread, no-mixed-operators */
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
|
|
25
|
+
class LineFocus {
|
|
26
|
+
constructor(props) {
|
|
27
|
+
const {
|
|
28
|
+
W,
|
|
29
|
+
H,
|
|
30
|
+
clickUiTargetAct,
|
|
31
|
+
selectUiSweepAct,
|
|
32
|
+
scrollUiWheelAct
|
|
33
|
+
} = props;
|
|
37
34
|
this.jcampIdx = 0;
|
|
38
35
|
this.rootKlass = '.d3Line';
|
|
39
36
|
this.margin = {
|
|
@@ -92,741 +89,600 @@ var LineFocus = /*#__PURE__*/function () {
|
|
|
92
89
|
this.isFirefox = typeof InstallTrigger !== 'undefined';
|
|
93
90
|
this.wavelength = null;
|
|
94
91
|
}
|
|
95
|
-
(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}, {
|
|
137
|
-
key: "resetShouldUpdate",
|
|
138
|
-
value: function resetShouldUpdate(prevEpSt, prevItSt, prevMySt) {
|
|
139
|
-
var _TfRescale2 = (0, _compass.TfRescale)(this),
|
|
140
|
-
xt = _TfRescale2.xt,
|
|
141
|
-
yt = _TfRescale2.yt;
|
|
142
|
-
var prevXt = xt(1.1);
|
|
143
|
-
var prevYt = yt(1.1);
|
|
144
|
-
var prevTePt = this.tTrEndPts.length;
|
|
145
|
-
var prevDtPk = this.dataPks.length;
|
|
146
|
-
var prevSfPk = this.tSfPeaks.length;
|
|
147
|
-
var prevData = this.data.length;
|
|
148
|
-
var prevLySt = this.layout;
|
|
149
|
-
this.shouldUpdate = Object.assign({}, this.shouldUpdate, {
|
|
150
|
-
prevXt: prevXt,
|
|
151
|
-
prevYt: prevYt,
|
|
152
|
-
prevEpSt: prevEpSt,
|
|
153
|
-
prevLySt: prevLySt,
|
|
154
|
-
prevItSt: prevItSt,
|
|
155
|
-
prevMySt: prevMySt,
|
|
156
|
-
// eslint-disable-line
|
|
157
|
-
prevTePt: prevTePt,
|
|
158
|
-
prevDtPk: prevDtPk,
|
|
159
|
-
prevSfPk: prevSfPk,
|
|
160
|
-
prevData: prevData // eslint-disable-line
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
}, {
|
|
164
|
-
key: "setTip",
|
|
165
|
-
value: function setTip() {
|
|
166
|
-
this.tip = (0, _init.InitTip)();
|
|
167
|
-
this.root.call(this.tip);
|
|
168
|
-
}
|
|
169
|
-
}, {
|
|
170
|
-
key: "setDataParams",
|
|
171
|
-
value: function setDataParams(data, peaks, tTrEndPts, tSfPeaks, freq, layout, wavelength) {
|
|
172
|
-
this.data = (0, _toConsumableArray2.default)(data);
|
|
173
|
-
this.dataPks = (0, _toConsumableArray2.default)(peaks);
|
|
174
|
-
this.tTrEndPts = tTrEndPts;
|
|
175
|
-
this.tSfPeaks = tSfPeaks;
|
|
176
|
-
this.freq = freq;
|
|
177
|
-
this.layout = layout;
|
|
178
|
-
this.wavelength = wavelength;
|
|
179
|
-
}
|
|
180
|
-
}, {
|
|
181
|
-
key: "updatePathCall",
|
|
182
|
-
value: function updatePathCall(xt, yt) {
|
|
183
|
-
this.pathCall = d3.line().x(function (d) {
|
|
184
|
-
return xt(d.x);
|
|
185
|
-
}).y(function (d) {
|
|
186
|
-
return yt(d.y);
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
}, {
|
|
190
|
-
key: "setConfig",
|
|
191
|
-
value: function setConfig(sweepExtentSt) {
|
|
192
|
-
// Domain Calculate
|
|
193
|
-
var _ref = sweepExtentSt || {
|
|
194
|
-
xExtent: false,
|
|
195
|
-
yExtent: false
|
|
196
|
-
},
|
|
197
|
-
xExtent = _ref.xExtent,
|
|
198
|
-
yExtent = _ref.yExtent;
|
|
199
|
-
if (!xExtent || !yExtent) {
|
|
200
|
-
var xes = d3.extent(this.data, function (d) {
|
|
201
|
-
return d.x;
|
|
202
|
-
}).sort(function (a, b) {
|
|
203
|
-
return a - b;
|
|
204
|
-
});
|
|
205
|
-
xExtent = {
|
|
206
|
-
xL: xes[0],
|
|
207
|
-
xU: xes[1]
|
|
208
|
-
};
|
|
209
|
-
var btm = d3.min(this.data, function (d) {
|
|
210
|
-
return d.y;
|
|
211
|
-
});
|
|
212
|
-
var top = d3.max(this.data, function (d) {
|
|
213
|
-
return d.y;
|
|
214
|
-
});
|
|
215
|
-
var height = top - btm;
|
|
216
|
-
yExtent = {
|
|
217
|
-
yL: btm - this.factor * height,
|
|
218
|
-
yU: top + this.factor * height
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
this.scales.x.domain([xExtent.xL, xExtent.xU]);
|
|
222
|
-
this.scales.y.domain([yExtent.yL, yExtent.yU]);
|
|
92
|
+
getShouldUpdate(nextEpSt, nextItSt, nextMySt) {
|
|
93
|
+
const {
|
|
94
|
+
prevXt,
|
|
95
|
+
prevYt,
|
|
96
|
+
prevEpSt,
|
|
97
|
+
prevLySt,
|
|
98
|
+
prevItSt,
|
|
99
|
+
prevMySt,
|
|
100
|
+
prevTePt,
|
|
101
|
+
prevDtPk,
|
|
102
|
+
prevSfPk,
|
|
103
|
+
prevData
|
|
104
|
+
} = this.shouldUpdate;
|
|
105
|
+
const {
|
|
106
|
+
xt,
|
|
107
|
+
yt
|
|
108
|
+
} = (0, _compass.TfRescale)(this);
|
|
109
|
+
const sameXY = xt(1.1) === prevXt && prevYt === yt(1.1);
|
|
110
|
+
const sameEpSt = prevEpSt === nextEpSt;
|
|
111
|
+
const sameLySt = prevLySt === this.layout;
|
|
112
|
+
const sameItSt = prevItSt === nextItSt;
|
|
113
|
+
const sameMySt = prevMySt === nextMySt;
|
|
114
|
+
const sameTePt = prevTePt === this.tTrEndPts.length;
|
|
115
|
+
const sameDtPk = prevDtPk === this.dataPks.length;
|
|
116
|
+
const sameSfPk = JSON.stringify(prevSfPk) === JSON.stringify(this.tSfPeaks);
|
|
117
|
+
const sameData = prevData === this.data.length;
|
|
118
|
+
const sameRef = prevEpSt.prevOffset === nextEpSt.prevOffset;
|
|
119
|
+
this.shouldUpdate = Object.assign({}, this.shouldUpdate, {
|
|
120
|
+
sameXY,
|
|
121
|
+
sameEpSt,
|
|
122
|
+
sameLySt,
|
|
123
|
+
sameItSt,
|
|
124
|
+
sameMySt,
|
|
125
|
+
// eslint-disable-line
|
|
126
|
+
sameTePt,
|
|
127
|
+
sameDtPk,
|
|
128
|
+
sameSfPk,
|
|
129
|
+
sameData,
|
|
130
|
+
sameRef // eslint-disable-line
|
|
131
|
+
});
|
|
132
|
+
}
|
|
223
133
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
134
|
+
resetShouldUpdate(prevEpSt, prevItSt, prevMySt) {
|
|
135
|
+
const {
|
|
136
|
+
xt,
|
|
137
|
+
yt
|
|
138
|
+
} = (0, _compass.TfRescale)(this);
|
|
139
|
+
const prevXt = xt(1.1);
|
|
140
|
+
const prevYt = yt(1.1);
|
|
141
|
+
const prevTePt = this.tTrEndPts.length;
|
|
142
|
+
const prevDtPk = this.dataPks.length;
|
|
143
|
+
const prevSfPk = this.tSfPeaks;
|
|
144
|
+
const prevData = this.data.length;
|
|
145
|
+
const prevLySt = this.layout;
|
|
146
|
+
this.shouldUpdate = Object.assign({}, this.shouldUpdate, {
|
|
147
|
+
prevXt,
|
|
148
|
+
prevYt,
|
|
149
|
+
prevEpSt,
|
|
150
|
+
prevLySt,
|
|
151
|
+
prevItSt,
|
|
152
|
+
prevMySt,
|
|
153
|
+
// eslint-disable-line
|
|
154
|
+
prevTePt,
|
|
155
|
+
prevDtPk,
|
|
156
|
+
prevSfPk,
|
|
157
|
+
prevData // eslint-disable-line
|
|
158
|
+
});
|
|
159
|
+
}
|
|
228
160
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
161
|
+
setTip() {
|
|
162
|
+
this.tip = (0, _init.InitTip)();
|
|
163
|
+
this.root.call(this.tip);
|
|
164
|
+
}
|
|
165
|
+
setDataParams(data, peaks, tTrEndPts, tSfPeaks, freq, layout, wavelength) {
|
|
166
|
+
this.data = [...data];
|
|
167
|
+
this.dataPks = [...peaks];
|
|
168
|
+
this.tTrEndPts = tTrEndPts;
|
|
169
|
+
this.tSfPeaks = tSfPeaks;
|
|
170
|
+
this.freq = freq;
|
|
171
|
+
this.layout = layout;
|
|
172
|
+
this.wavelength = wavelength;
|
|
173
|
+
}
|
|
174
|
+
updatePathCall(xt, yt) {
|
|
175
|
+
this.pathCall = d3.line().x(d => xt(d.x)).y(d => yt(d.y));
|
|
176
|
+
}
|
|
177
|
+
setConfig(sweepExtentSt) {
|
|
178
|
+
// Domain Calculate
|
|
179
|
+
let {
|
|
180
|
+
xExtent,
|
|
181
|
+
yExtent
|
|
182
|
+
} = sweepExtentSt || {
|
|
183
|
+
xExtent: false,
|
|
184
|
+
yExtent: false
|
|
185
|
+
};
|
|
186
|
+
if (!xExtent || !yExtent) {
|
|
187
|
+
const xes = d3.extent(this.data, d => d.x).sort((a, b) => a - b);
|
|
188
|
+
xExtent = {
|
|
189
|
+
xL: xes[0],
|
|
190
|
+
xU: xes[1]
|
|
235
191
|
};
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
sameRef = _this$shouldUpdate2.sameRef;
|
|
243
|
-
if (sameXY && sameRef) return;
|
|
244
|
-
var _TfRescale4 = (0, _compass.TfRescale)(this),
|
|
245
|
-
xt = _TfRescale4.xt,
|
|
246
|
-
yt = _TfRescale4.yt;
|
|
247
|
-
this.updatePathCall(xt, yt);
|
|
248
|
-
this.path.attr('d', this.pathCall(this.data));
|
|
249
|
-
}
|
|
250
|
-
}, {
|
|
251
|
-
key: "drawThres",
|
|
252
|
-
value: function drawThres() {
|
|
253
|
-
if (this.tTrEndPts.length > 0) {
|
|
254
|
-
this.thresLineUp.attr('d', this.pathCall(this.tTrEndPts));
|
|
255
|
-
this.thresLineUp.attr('visibility', 'visible');
|
|
256
|
-
var _this$tTrEndPts = (0, _slicedToArray2.default)(this.tTrEndPts, 2),
|
|
257
|
-
left = _this$tTrEndPts[0],
|
|
258
|
-
right = _this$tTrEndPts[1];
|
|
259
|
-
var dwMirrorEndPts = [Object.assign({}, left, {
|
|
260
|
-
y: -left.y
|
|
261
|
-
}), Object.assign({}, right, {
|
|
262
|
-
y: -right.y
|
|
263
|
-
})];
|
|
264
|
-
this.thresLineDw.attr('d', this.pathCall(dwMirrorEndPts));
|
|
265
|
-
this.thresLineDw.attr('visibility', 'visible');
|
|
266
|
-
} else {
|
|
267
|
-
this.thresLineUp.attr('visibility', 'hidden');
|
|
268
|
-
this.thresLineDw.attr('visibility', 'hidden');
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}, {
|
|
272
|
-
key: "drawGrid",
|
|
273
|
-
value: function drawGrid() {
|
|
274
|
-
var sameXY = this.shouldUpdate.sameXY;
|
|
275
|
-
if (sameXY) return;
|
|
276
|
-
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');
|
|
277
|
-
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');
|
|
278
|
-
}
|
|
279
|
-
}, {
|
|
280
|
-
key: "onClickTarget",
|
|
281
|
-
value: function onClickTarget(data) {
|
|
282
|
-
d3.event.stopPropagation();
|
|
283
|
-
d3.event.preventDefault();
|
|
284
|
-
var onPeak = true;
|
|
285
|
-
this.clickUiTargetAct(data, onPeak);
|
|
286
|
-
}
|
|
287
|
-
}, {
|
|
288
|
-
key: "mergedPeaks",
|
|
289
|
-
value: function mergedPeaks(editPeakSt) {
|
|
290
|
-
if (!editPeakSt) return this.dataPks;
|
|
291
|
-
this.dataPks = (0, _converter.PksEdit)(this.dataPks, editPeakSt);
|
|
292
|
-
return this.dataPks;
|
|
293
|
-
}
|
|
294
|
-
}, {
|
|
295
|
-
key: "drawAUC",
|
|
296
|
-
value: function drawAUC(stack) {
|
|
297
|
-
var _this = this;
|
|
298
|
-
var _TfRescale5 = (0, _compass.TfRescale)(this),
|
|
299
|
-
xt = _TfRescale5.xt,
|
|
300
|
-
yt = _TfRescale5.yt;
|
|
301
|
-
var auc = this.tags.aucPath.selectAll('path').data(stack);
|
|
302
|
-
auc.exit().attr('class', 'exit').remove();
|
|
303
|
-
var integCurve = function integCurve(border) {
|
|
304
|
-
var xL = border.xL,
|
|
305
|
-
xU = border.xU;
|
|
306
|
-
var ps = _this.data.filter(function (d) {
|
|
307
|
-
return d.x > xL && d.x < xU;
|
|
308
|
-
});
|
|
309
|
-
if (!ps[0]) return null;
|
|
310
|
-
var point1 = ps[0];
|
|
311
|
-
var point2 = ps[ps.length - 1];
|
|
312
|
-
var slope = (0, _calc.calcSlope)(point1.x, point1.y, point2.x, point2.y);
|
|
313
|
-
var lastDY = point1.y;
|
|
314
|
-
return d3.area().x(function (d) {
|
|
315
|
-
return xt(d.x);
|
|
316
|
-
}).y0(function (d, index) {
|
|
317
|
-
if (index > 0) {
|
|
318
|
-
var lastD = ps[index - 1];
|
|
319
|
-
var y = slope * (d.x - lastD.x) + lastDY;
|
|
320
|
-
lastDY = y;
|
|
321
|
-
return yt(y);
|
|
322
|
-
}
|
|
323
|
-
return yt(0);
|
|
324
|
-
}).y1(function (d) {
|
|
325
|
-
return yt(d.y);
|
|
326
|
-
})(ps);
|
|
192
|
+
const btm = d3.min(this.data, d => d.y);
|
|
193
|
+
const top = d3.max(this.data, d => d.y);
|
|
194
|
+
const height = top - btm;
|
|
195
|
+
yExtent = {
|
|
196
|
+
yL: btm - this.factor * height,
|
|
197
|
+
yU: top + this.factor * height
|
|
327
198
|
};
|
|
328
|
-
auc.enter().append('path').attr('class', 'auc').attr('fill', 'red').attr('stroke', 'none').attr('fill-opacity', 0.2).attr('stroke-width', 2).merge(auc).attr('d', function (d) {
|
|
329
|
-
return integCurve(d);
|
|
330
|
-
}).attr('id', function (d) {
|
|
331
|
-
return "auc".concat((0, _focus.itgIdTag)(d));
|
|
332
|
-
}).on('mouseover', function (d) {
|
|
333
|
-
d3.select("#auc".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'blue');
|
|
334
|
-
d3.select("#auc".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'blue');
|
|
335
|
-
d3.select("#auc".concat((0, _focus.itgIdTag)(d))).style('fill', 'blue');
|
|
336
|
-
}).on('mouseout', function (d) {
|
|
337
|
-
d3.select("#auc".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'none');
|
|
338
|
-
d3.select("#auc".concat((0, _focus.itgIdTag)(d))).style('fill', 'red');
|
|
339
|
-
d3.select("#auc".concat((0, _focus.itgIdTag)(d))).style('fill-opacity', 0.2);
|
|
340
|
-
}).on('click', function (d) {
|
|
341
|
-
return _this.onClickTarget(d);
|
|
342
|
-
});
|
|
343
199
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
value: function drawPeaks(editPeakSt) {
|
|
347
|
-
var _this2 = this;
|
|
348
|
-
var _this$shouldUpdate3 = this.shouldUpdate,
|
|
349
|
-
sameXY = _this$shouldUpdate3.sameXY,
|
|
350
|
-
sameEpSt = _this$shouldUpdate3.sameEpSt,
|
|
351
|
-
sameDtPk = _this$shouldUpdate3.sameDtPk,
|
|
352
|
-
sameSfPk = _this$shouldUpdate3.sameSfPk;
|
|
353
|
-
if (!_format.default.isCyclicVoltaLayout(this.layout) && sameXY && sameEpSt && sameDtPk && sameSfPk) return;
|
|
200
|
+
this.scales.x.domain([xExtent.xL, xExtent.xU]);
|
|
201
|
+
this.scales.y.domain([yExtent.yL, yExtent.yU]);
|
|
354
202
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
layout: _this2.layout
|
|
399
|
-
};
|
|
400
|
-
_this2.tip.hide(tipParams, n[i]);
|
|
401
|
-
}).on('click', function (d) {
|
|
402
|
-
return _this2.onClickTarget(d);
|
|
403
|
-
});
|
|
404
|
-
var ignoreRef = _format.default.isHplcUvVisLayout(this.layout);
|
|
405
|
-
if (ignoreRef) {
|
|
406
|
-
var bpTxt = this.tags.bpTxt.selectAll('text').data(dPks);
|
|
407
|
-
bpTxt.exit().attr('class', 'exit').remove();
|
|
408
|
-
bpTxt.enter().append('text').attr('class', 'peak-text').attr('font-family', 'Helvetica').style('font-size', '12px').attr('fill', '#228B22').style('text-anchor', 'middle').merge(bpTxt).attr('id', function (d) {
|
|
409
|
-
return "mpp".concat(Math.round(1000 * d.x));
|
|
410
|
-
}).text(function (d) {
|
|
411
|
-
return d.x.toFixed(2);
|
|
412
|
-
}).attr('transform', function (d) {
|
|
413
|
-
return "translate(".concat(xt(d.x), ", ").concat(yt(d.y) - 25, ")");
|
|
414
|
-
}).on('click', function (d) {
|
|
415
|
-
return _this2.onClickTarget(d);
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}, {
|
|
420
|
-
key: "drawInteg",
|
|
421
|
-
value: function drawInteg(integationSt) {
|
|
422
|
-
var _this3 = this;
|
|
423
|
-
var _this$shouldUpdate4 = this.shouldUpdate,
|
|
424
|
-
sameXY = _this$shouldUpdate4.sameXY,
|
|
425
|
-
sameLySt = _this$shouldUpdate4.sameLySt,
|
|
426
|
-
sameItSt = _this$shouldUpdate4.sameItSt,
|
|
427
|
-
sameData = _this$shouldUpdate4.sameData;
|
|
428
|
-
if (sameXY && sameLySt && sameItSt && sameData) return;
|
|
429
|
-
var selectedIdx = integationSt.selectedIdx,
|
|
430
|
-
integrations = integationSt.integrations;
|
|
431
|
-
var selectedIntegration = integrations[selectedIdx];
|
|
432
|
-
var stack = selectedIntegration.stack,
|
|
433
|
-
refArea = selectedIntegration.refArea,
|
|
434
|
-
refFactor = selectedIntegration.refFactor,
|
|
435
|
-
shift = selectedIntegration.shift;
|
|
436
|
-
var isDisable = _cfg.default.btnCmdIntg(this.layout);
|
|
437
|
-
var ignoreRef = _format.default.isHplcUvVisLayout(this.layout);
|
|
438
|
-
var itgs = isDisable ? [] : stack;
|
|
439
|
-
var igbp = this.tags.igbPath.selectAll('path').data(itgs);
|
|
440
|
-
igbp.exit().attr('class', 'exit').remove();
|
|
441
|
-
var igcp = this.tags.igcPath.selectAll('path').data(itgs);
|
|
442
|
-
igcp.exit().attr('class', 'exit').remove();
|
|
443
|
-
var igtp = this.tags.igtPath.selectAll('text').data(itgs);
|
|
444
|
-
igtp.exit().attr('class', 'exit').remove();
|
|
445
|
-
if (itgs.length === 0 || isDisable) {
|
|
446
|
-
// remove drawn area under curve
|
|
447
|
-
var auc = this.tags.aucPath.selectAll('path').data(stack);
|
|
448
|
-
auc.exit().attr('class', 'exit').remove();
|
|
449
|
-
auc.merge(auc);
|
|
450
|
-
return;
|
|
451
|
-
}
|
|
452
|
-
if (ignoreRef) {
|
|
453
|
-
this.drawAUC(stack);
|
|
454
|
-
} else {
|
|
455
|
-
// rescale for zoom
|
|
456
|
-
var _TfRescale7 = (0, _compass.TfRescale)(this),
|
|
457
|
-
xt = _TfRescale7.xt;
|
|
458
|
-
var dh = 50;
|
|
459
|
-
var integBar = function integBar(data) {
|
|
460
|
-
return d3.line()([[xt(data.xL - shift), dh], [xt(data.xL - shift), dh - 10], [xt(data.xL - shift), dh - 5], [xt(data.xU - shift), dh - 5], [xt(data.xU - shift), dh - 10], [xt(data.xU - shift), dh]]);
|
|
461
|
-
};
|
|
462
|
-
igbp.enter().append('path').attr('class', 'igbp').attr('fill', 'none').attr('stroke', '#228B22').attr('stroke-width', 2).merge(igbp).attr('id', function (d) {
|
|
463
|
-
return "igbp".concat((0, _focus.itgIdTag)(d));
|
|
464
|
-
}).attr('d', function (d) {
|
|
465
|
-
return integBar(d);
|
|
466
|
-
}).on('mouseover', function (d) {
|
|
467
|
-
d3.select("#igbp".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'blue');
|
|
468
|
-
d3.select("#igbc".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'blue');
|
|
469
|
-
d3.select("#igtp".concat((0, _focus.itgIdTag)(d))).style('fill', 'blue');
|
|
470
|
-
}).on('mouseout', function (d) {
|
|
471
|
-
d3.select("#igbp".concat((0, _focus.itgIdTag)(d))).attr('stroke', '#228B22');
|
|
472
|
-
d3.select("#igbc".concat((0, _focus.itgIdTag)(d))).attr('stroke', '#228B22');
|
|
473
|
-
d3.select("#igtp".concat((0, _focus.itgIdTag)(d))).style('fill', '#228B22');
|
|
474
|
-
}).on('click', function (d) {
|
|
475
|
-
return _this3.onClickTarget(d);
|
|
476
|
-
});
|
|
477
|
-
var integCurve = function integCurve(border) {
|
|
478
|
-
var xL = border.xL,
|
|
479
|
-
xU = border.xU;
|
|
480
|
-
var nXL = xL - shift,
|
|
481
|
-
nXU = xU - shift;
|
|
482
|
-
var ps = _this3.data.filter(function (d) {
|
|
483
|
-
return d.x > nXL && d.x < nXU;
|
|
484
|
-
});
|
|
485
|
-
var kMax = _this3.data[_this3.data.length - 1].k;
|
|
486
|
-
if (!ps[0]) return null;
|
|
487
|
-
var kRef = ps[0].k;
|
|
488
|
-
if (!_this3.reverseXAxis(_this3.layout)) {
|
|
489
|
-
return d3.line().x(function (d) {
|
|
490
|
-
return xt(d.x);
|
|
491
|
-
}).y(function (d) {
|
|
492
|
-
return 100 - (kRef - d.k) * 400 / kMax;
|
|
493
|
-
})(ps);
|
|
494
|
-
}
|
|
495
|
-
return d3.line().x(function (d) {
|
|
496
|
-
return xt(d.x);
|
|
497
|
-
}).y(function (d) {
|
|
498
|
-
return 300 - (d.k - kRef) * 400 / kMax;
|
|
499
|
-
})(ps);
|
|
500
|
-
};
|
|
501
|
-
igcp.enter().append('path').attr('class', 'igcp').attr('fill', 'none').attr('stroke', '#228B22').attr('stroke-width', 2).merge(igcp).attr('id', function (d) {
|
|
502
|
-
return "igbc".concat((0, _focus.itgIdTag)(d));
|
|
503
|
-
}).attr('d', function (d) {
|
|
504
|
-
return integCurve(d);
|
|
505
|
-
}).on('mouseover', function (d) {
|
|
506
|
-
d3.select("#igbp".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'blue');
|
|
507
|
-
d3.select("#igbc".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'blue');
|
|
508
|
-
d3.select("#igtp".concat((0, _focus.itgIdTag)(d))).style('fill', 'blue');
|
|
509
|
-
}).on('mouseout', function (d) {
|
|
510
|
-
d3.select("#igbp".concat((0, _focus.itgIdTag)(d))).attr('stroke', '#228B22');
|
|
511
|
-
d3.select("#igbc".concat((0, _focus.itgIdTag)(d))).attr('stroke', '#228B22');
|
|
512
|
-
d3.select("#igtp".concat((0, _focus.itgIdTag)(d))).style('fill', '#228B22');
|
|
513
|
-
}).on('click', function (d) {
|
|
514
|
-
return _this3.onClickTarget(d);
|
|
515
|
-
});
|
|
516
|
-
igtp.enter().append('text').attr('class', 'igtp').attr('font-family', 'Helvetica').style('font-size', '12px').attr('fill', '#228B22').style('text-anchor', 'middle').merge(igtp).attr('id', function (d) {
|
|
517
|
-
return "igtp".concat((0, _focus.itgIdTag)(d));
|
|
518
|
-
}).text(function (d) {
|
|
519
|
-
return (0, _integration.calcArea)(d, refArea, refFactor, ignoreRef);
|
|
520
|
-
}).attr('transform', function (d) {
|
|
521
|
-
return "translate(".concat(xt((d.xL + d.xU) / 2 - shift), ", ").concat(dh - 12, ")");
|
|
522
|
-
}).on('mouseover', function (d) {
|
|
523
|
-
d3.select("#igbp".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'blue');
|
|
524
|
-
d3.select("#igbc".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'blue');
|
|
525
|
-
d3.select("#igtp".concat((0, _focus.itgIdTag)(d))).style('fill', 'blue');
|
|
526
|
-
}).on('mouseout', function (d) {
|
|
527
|
-
d3.select("#igbp".concat((0, _focus.itgIdTag)(d))).attr('stroke', '#228B22');
|
|
528
|
-
d3.select("#igbc".concat((0, _focus.itgIdTag)(d))).attr('stroke', '#228B22');
|
|
529
|
-
d3.select("#igtp".concat((0, _focus.itgIdTag)(d))).style('fill', '#228B22');
|
|
530
|
-
}).on('click', function (d) {
|
|
531
|
-
return _this3.onClickTarget(d);
|
|
532
|
-
});
|
|
533
|
-
}
|
|
203
|
+
// rescale for zoom
|
|
204
|
+
const {
|
|
205
|
+
xt,
|
|
206
|
+
yt
|
|
207
|
+
} = (0, _compass.TfRescale)(this);
|
|
208
|
+
|
|
209
|
+
// Axis Call
|
|
210
|
+
this.axisCall.x.scale(xt);
|
|
211
|
+
this.axisCall.y.scale(yt);
|
|
212
|
+
this.currentExtent = {
|
|
213
|
+
xExtent,
|
|
214
|
+
yExtent
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
drawLine() {
|
|
218
|
+
const {
|
|
219
|
+
sameXY,
|
|
220
|
+
sameRef,
|
|
221
|
+
sameSfPk
|
|
222
|
+
} = this.shouldUpdate;
|
|
223
|
+
if (sameXY && sameRef && sameSfPk) return;
|
|
224
|
+
const {
|
|
225
|
+
xt,
|
|
226
|
+
yt
|
|
227
|
+
} = (0, _compass.TfRescale)(this);
|
|
228
|
+
this.updatePathCall(xt, yt);
|
|
229
|
+
this.path.attr('d', this.pathCall(this.data));
|
|
230
|
+
}
|
|
231
|
+
drawThres() {
|
|
232
|
+
if (this.tTrEndPts.length > 0) {
|
|
233
|
+
this.thresLineUp.attr('d', this.pathCall(this.tTrEndPts));
|
|
234
|
+
this.thresLineUp.attr('visibility', 'visible');
|
|
235
|
+
const [left, right] = this.tTrEndPts;
|
|
236
|
+
const dwMirrorEndPts = [Object.assign({}, left, {
|
|
237
|
+
y: -left.y
|
|
238
|
+
}), Object.assign({}, right, {
|
|
239
|
+
y: -right.y
|
|
240
|
+
})];
|
|
241
|
+
this.thresLineDw.attr('d', this.pathCall(dwMirrorEndPts));
|
|
242
|
+
this.thresLineDw.attr('visibility', 'visible');
|
|
243
|
+
} else {
|
|
244
|
+
this.thresLineUp.attr('visibility', 'hidden');
|
|
245
|
+
this.thresLineDw.attr('visibility', 'hidden');
|
|
534
246
|
}
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
247
|
+
}
|
|
248
|
+
drawGrid() {
|
|
249
|
+
const {
|
|
250
|
+
sameXY,
|
|
251
|
+
sameSfPk
|
|
252
|
+
} = this.shouldUpdate;
|
|
253
|
+
if (sameXY && sameSfPk) return;
|
|
254
|
+
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');
|
|
255
|
+
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');
|
|
256
|
+
}
|
|
257
|
+
onClickTarget(data) {
|
|
258
|
+
d3.event.stopPropagation();
|
|
259
|
+
d3.event.preventDefault();
|
|
260
|
+
const onPeak = true;
|
|
261
|
+
this.clickUiTargetAct(data, onPeak);
|
|
262
|
+
}
|
|
263
|
+
mergedPeaks(editPeakSt) {
|
|
264
|
+
if (!editPeakSt) return this.dataPks;
|
|
265
|
+
this.dataPks = (0, _converter.PksEdit)(this.dataPks, editPeakSt);
|
|
266
|
+
return this.dataPks;
|
|
267
|
+
}
|
|
268
|
+
drawAUC(stack) {
|
|
269
|
+
const {
|
|
270
|
+
xt,
|
|
271
|
+
yt
|
|
272
|
+
} = (0, _compass.TfRescale)(this);
|
|
273
|
+
const auc = this.tags.aucPath.selectAll('path').data(stack);
|
|
274
|
+
auc.exit().attr('class', 'exit').remove();
|
|
275
|
+
const integCurve = border => {
|
|
276
|
+
const {
|
|
277
|
+
xL,
|
|
278
|
+
xU
|
|
279
|
+
} = border;
|
|
280
|
+
const ps = this.data.filter(d => d.x > xL && d.x < xU);
|
|
281
|
+
if (!ps[0]) return null;
|
|
282
|
+
const point1 = ps[0];
|
|
283
|
+
const point2 = ps[ps.length - 1];
|
|
284
|
+
const slope = (0, _calc.calcSlope)(point1.x, point1.y, point2.x, point2.y);
|
|
285
|
+
let lastDY = point1.y;
|
|
286
|
+
return d3.area().x(d => xt(d.x)).y0((d, index) => {
|
|
287
|
+
if (index > 0) {
|
|
288
|
+
const lastD = ps[index - 1];
|
|
289
|
+
const y = slope * (d.x - lastD.x) + lastDY;
|
|
290
|
+
lastDY = y;
|
|
291
|
+
return yt(y);
|
|
292
|
+
}
|
|
293
|
+
return yt(0);
|
|
294
|
+
}).y1(d => yt(d.y))(ps);
|
|
295
|
+
};
|
|
296
|
+
auc.enter().append('path').attr('class', 'auc').attr('fill', 'red').attr('stroke', 'none').attr('fill-opacity', 0.2).attr('stroke-width', 2).merge(auc).attr('d', d => integCurve(d)).attr('id', d => `auc${(0, _focus.itgIdTag)(d)}`).on('mouseover', d => {
|
|
297
|
+
d3.select(`#auc${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'blue');
|
|
298
|
+
d3.select(`#auc${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'blue');
|
|
299
|
+
d3.select(`#auc${(0, _focus.itgIdTag)(d)}`).style('fill', 'blue');
|
|
300
|
+
}).on('mouseout', d => {
|
|
301
|
+
d3.select(`#auc${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'none');
|
|
302
|
+
d3.select(`#auc${(0, _focus.itgIdTag)(d)}`).style('fill', 'red');
|
|
303
|
+
d3.select(`#auc${(0, _focus.itgIdTag)(d)}`).style('fill-opacity', 0.2);
|
|
304
|
+
}).on('click', d => this.onClickTarget(d));
|
|
305
|
+
}
|
|
306
|
+
drawPeaks(editPeakSt) {
|
|
307
|
+
const {
|
|
308
|
+
sameXY,
|
|
309
|
+
sameEpSt,
|
|
310
|
+
sameDtPk,
|
|
311
|
+
sameSfPk
|
|
312
|
+
} = this.shouldUpdate;
|
|
313
|
+
if (!_format.default.isCyclicVoltaLayout(this.layout) && sameXY && sameEpSt && sameDtPk && sameSfPk) return;
|
|
314
|
+
|
|
315
|
+
// rescale for zoom
|
|
316
|
+
const {
|
|
317
|
+
xt,
|
|
318
|
+
yt
|
|
319
|
+
} = (0, _compass.TfRescale)(this);
|
|
320
|
+
const dPks = this.mergedPeaks(editPeakSt);
|
|
321
|
+
const mpp = this.tags.pPath.selectAll('path').data(dPks);
|
|
322
|
+
mpp.exit().attr('class', 'exit').remove();
|
|
323
|
+
const linePath = [{
|
|
324
|
+
x: -0.5,
|
|
325
|
+
y: 10
|
|
326
|
+
}, {
|
|
327
|
+
x: -0.5,
|
|
328
|
+
y: -20
|
|
329
|
+
}, {
|
|
330
|
+
x: 0.5,
|
|
331
|
+
y: -20
|
|
332
|
+
}, {
|
|
333
|
+
x: 0.5,
|
|
334
|
+
y: 10
|
|
335
|
+
}];
|
|
336
|
+
// const faktor = layoutSt === LIST_LAYOUT.IR ? -1 : 1;
|
|
337
|
+
const lineSymbol = d3.line().x(d => d.x).y(d => d.y)(linePath);
|
|
338
|
+
mpp.enter().append('path').attr('d', lineSymbol).attr('class', 'enter-peak').attr('fill', 'red').attr('stroke', 'pink').attr('stroke-width', 3).attr('stroke-opacity', 0.0).merge(mpp).attr('id', d => `mpp${Math.round(1000 * d.x)}`).attr('transform', d => `translate(${xt(d.x)}, ${yt(d.y)})`).on('mouseover', (d, i, n) => {
|
|
339
|
+
d3.select(`#mpp${Math.round(1000 * d.x)}`).attr('stroke-opacity', '1.0');
|
|
340
|
+
d3.select(`#bpt${Math.round(1000 * d.x)}`).style('fill', 'blue');
|
|
341
|
+
const tipParams = {
|
|
342
|
+
d,
|
|
343
|
+
layout: this.layout
|
|
585
344
|
};
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
}).attr('
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
d3.selectAll("#mpyb".concat((0, _focus.mpyIdTag)(d))).attr('stroke', 'blue');
|
|
594
|
-
d3.selectAll("#mpyt1".concat((0, _focus.mpyIdTag)(d))).style('fill', 'blue');
|
|
595
|
-
d3.selectAll("#mpyt2".concat((0, _focus.mpyIdTag)(d))).style('fill', 'blue');
|
|
596
|
-
d3.selectAll("#mpyp".concat((0, _focus.mpyIdTag)(d))).attr('stroke', 'blue');
|
|
597
|
-
}).on('mouseout', function (d) {
|
|
598
|
-
var dColor = mpyColor(d);
|
|
599
|
-
d3.selectAll("#mpyb".concat((0, _focus.mpyIdTag)(d))).attr('stroke', dColor);
|
|
600
|
-
d3.selectAll("#mpyt1".concat((0, _focus.mpyIdTag)(d))).style('fill', dColor);
|
|
601
|
-
d3.selectAll("#mpyt2".concat((0, _focus.mpyIdTag)(d))).style('fill', dColor);
|
|
602
|
-
d3.selectAll("#mpyp".concat((0, _focus.mpyIdTag)(d))).attr('stroke', dColor);
|
|
603
|
-
}).on('click', function (d) {
|
|
604
|
-
return _this4.onClickTarget(d);
|
|
605
|
-
});
|
|
606
|
-
mpyt1.enter().append('text').attr('class', 'mpyt1').attr('font-family', 'Helvetica').style('font-size', '12px').style('text-anchor', 'middle').merge(mpyt1).attr('fill', function (d) {
|
|
607
|
-
return mpyColor(d);
|
|
608
|
-
}).attr('id', function (d) {
|
|
609
|
-
return "mpyt1".concat((0, _focus.mpyIdTag)(d));
|
|
610
|
-
}).text(function (d) {
|
|
611
|
-
return "".concat((0, _multiplicity_calc.calcMpyCenter)(d.peaks, shift, d.mpyType).toFixed(3));
|
|
612
|
-
}).attr('transform', function (d) {
|
|
613
|
-
return "translate(".concat(xt((d.xExtent.xL + d.xExtent.xU) / 2 - shift), ", ").concat(height - dh + 12, ")");
|
|
614
|
-
}).on('mouseover', function (d) {
|
|
615
|
-
d3.selectAll("#mpyb".concat((0, _focus.mpyIdTag)(d))).attr('stroke', 'blue');
|
|
616
|
-
d3.selectAll("#mpyt1".concat((0, _focus.mpyIdTag)(d))).style('fill', 'blue');
|
|
617
|
-
d3.selectAll("#mpyt2".concat((0, _focus.mpyIdTag)(d))).style('fill', 'blue');
|
|
618
|
-
d3.selectAll("#mpyp".concat((0, _focus.mpyIdTag)(d))).attr('stroke', 'blue');
|
|
619
|
-
}).on('mouseout', function (d) {
|
|
620
|
-
var dColor = mpyColor(d);
|
|
621
|
-
d3.selectAll("#mpyb".concat((0, _focus.mpyIdTag)(d))).attr('stroke', dColor);
|
|
622
|
-
d3.selectAll("#mpyt1".concat((0, _focus.mpyIdTag)(d))).style('fill', dColor);
|
|
623
|
-
d3.selectAll("#mpyt2".concat((0, _focus.mpyIdTag)(d))).style('fill', dColor);
|
|
624
|
-
d3.selectAll("#mpyp".concat((0, _focus.mpyIdTag)(d))).attr('stroke', dColor);
|
|
625
|
-
}).on('click', function (d) {
|
|
626
|
-
return _this4.onClickTarget(d);
|
|
627
|
-
});
|
|
628
|
-
mpyt2.enter().append('text').attr('class', 'mpyt2').attr('font-family', 'Helvetica').style('font-size', '12px').style('text-anchor', 'middle').merge(mpyt2).attr('fill', function (d) {
|
|
629
|
-
return mpyColor(d);
|
|
630
|
-
}).attr('id', function (d) {
|
|
631
|
-
return "mpyt2".concat((0, _focus.mpyIdTag)(d));
|
|
632
|
-
}).text(function (d) {
|
|
633
|
-
return "(".concat(d.mpyType, ")");
|
|
634
|
-
}).attr('transform', function (d) {
|
|
635
|
-
return "translate(".concat(xt((d.xExtent.xL + d.xExtent.xU) / 2 - shift), ", ").concat(height - dh + 24, ")");
|
|
636
|
-
}).on('mouseover', function (d) {
|
|
637
|
-
d3.selectAll("#mpyb".concat((0, _focus.mpyIdTag)(d))).attr('stroke', 'blue');
|
|
638
|
-
d3.selectAll("#mpyt1".concat((0, _focus.mpyIdTag)(d))).style('fill', 'blue');
|
|
639
|
-
d3.selectAll("#mpyt2".concat((0, _focus.mpyIdTag)(d))).style('fill', 'blue');
|
|
640
|
-
d3.selectAll("#mpyp".concat((0, _focus.mpyIdTag)(d))).attr('stroke', 'blue');
|
|
641
|
-
}).on('mouseout', function (d) {
|
|
642
|
-
var dColor = mpyColor(d);
|
|
643
|
-
d3.selectAll("#mpyb".concat((0, _focus.mpyIdTag)(d))).attr('stroke', dColor);
|
|
644
|
-
d3.selectAll("#mpyt1".concat((0, _focus.mpyIdTag)(d))).style('fill', dColor);
|
|
645
|
-
d3.selectAll("#mpyt2".concat((0, _focus.mpyIdTag)(d))).style('fill', dColor);
|
|
646
|
-
d3.selectAll("#mpyp".concat((0, _focus.mpyIdTag)(d))).attr('stroke', dColor);
|
|
647
|
-
}).on('click', function (d) {
|
|
648
|
-
return _this4.onClickTarget(d);
|
|
649
|
-
});
|
|
650
|
-
var mpypH = height - dh;
|
|
651
|
-
var mpypPath = function mpypPath(pk) {
|
|
652
|
-
return [{
|
|
653
|
-
x: xt(pk.x - shift) - 0.5,
|
|
654
|
-
y: mpypH - 5
|
|
655
|
-
}, {
|
|
656
|
-
x: xt(pk.x - shift) - 0.5,
|
|
657
|
-
y: mpypH - 20
|
|
658
|
-
}, {
|
|
659
|
-
x: xt(pk.x - shift) + 0.5,
|
|
660
|
-
y: mpypH - 20
|
|
661
|
-
}, {
|
|
662
|
-
x: xt(pk.x - shift) + 0.5,
|
|
663
|
-
y: mpypH - 5
|
|
664
|
-
}];
|
|
345
|
+
this.tip.show(tipParams, n[i]);
|
|
346
|
+
}).on('mouseout', (d, i, n) => {
|
|
347
|
+
d3.select(`#mpp${Math.round(1000 * d.x)}`).attr('stroke-opacity', '0.0');
|
|
348
|
+
d3.select(`#bpt${Math.round(1000 * d.x)}`).style('fill', 'red');
|
|
349
|
+
const tipParams = {
|
|
350
|
+
d,
|
|
351
|
+
layout: this.layout
|
|
665
352
|
};
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
return mpyColor(d);
|
|
674
|
-
}).attr('d', function (d) {
|
|
675
|
-
return lineSymbol(mpypPath(d));
|
|
676
|
-
}).attr('id', function (d) {
|
|
677
|
-
return "mpyp".concat((0, _focus.mpyIdTag)(d));
|
|
678
|
-
}).on('mouseover', function (d) {
|
|
679
|
-
d3.selectAll("#mpyb".concat((0, _focus.mpyIdTag)(d))).attr('stroke', 'blue');
|
|
680
|
-
d3.selectAll("#mpyt1".concat((0, _focus.mpyIdTag)(d))).style('fill', 'blue');
|
|
681
|
-
d3.selectAll("#mpyt2".concat((0, _focus.mpyIdTag)(d))).style('fill', 'blue');
|
|
682
|
-
d3.selectAll("#mpyp".concat((0, _focus.mpyIdTag)(d))).attr('stroke', 'blue');
|
|
683
|
-
}).on('mouseout', function (d) {
|
|
684
|
-
var dColor = mpyColor(d);
|
|
685
|
-
d3.selectAll("#mpyb".concat((0, _focus.mpyIdTag)(d))).attr('stroke', dColor);
|
|
686
|
-
d3.selectAll("#mpyt1".concat((0, _focus.mpyIdTag)(d))).style('fill', dColor);
|
|
687
|
-
d3.selectAll("#mpyt2".concat((0, _focus.mpyIdTag)(d))).style('fill', dColor);
|
|
688
|
-
d3.selectAll("#mpyp".concat((0, _focus.mpyIdTag)(d))).attr('stroke', dColor);
|
|
689
|
-
}).on('click', function (d) {
|
|
690
|
-
return _this4.onClickTarget(d);
|
|
691
|
-
});
|
|
353
|
+
this.tip.hide(tipParams, n[i]);
|
|
354
|
+
}).on('click', d => this.onClickTarget(d));
|
|
355
|
+
const ignoreRef = _format.default.isHplcUvVisLayout(this.layout);
|
|
356
|
+
if (ignoreRef) {
|
|
357
|
+
const bpTxt = this.tags.bpTxt.selectAll('text').data(dPks);
|
|
358
|
+
bpTxt.exit().attr('class', 'exit').remove();
|
|
359
|
+
bpTxt.enter().append('text').attr('class', 'peak-text').attr('font-family', 'Helvetica').style('font-size', '12px').attr('fill', '#228B22').style('text-anchor', 'middle').merge(bpTxt).attr('id', d => `mpp${Math.round(1000 * d.x)}`).text(d => d.x.toFixed(2)).attr('transform', d => `translate(${xt(d.x)}, ${yt(d.y) - 25})`).on('click', d => this.onClickTarget(d));
|
|
692
360
|
}
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
var _this5 = this;
|
|
729
|
-
d3.selectAll('.line-clip-compare').remove();
|
|
730
|
-
if (!comparisons) return null;
|
|
731
|
-
comparisons.forEach(function (c, idx) {
|
|
732
|
-
if (!c.show) return;
|
|
733
|
-
var path = (0, _mount.MountComparePath)(_this5, _format.default.compareColors(idx), idx); // #D5D8DC
|
|
734
|
-
path.attr('d', _this5.pathCall(c.data));
|
|
735
|
-
});
|
|
736
|
-
return null;
|
|
361
|
+
}
|
|
362
|
+
drawInteg(integationSt) {
|
|
363
|
+
const {
|
|
364
|
+
sameXY,
|
|
365
|
+
sameLySt,
|
|
366
|
+
sameItSt,
|
|
367
|
+
sameData
|
|
368
|
+
} = this.shouldUpdate;
|
|
369
|
+
if (sameXY && sameLySt && sameItSt && sameData) return;
|
|
370
|
+
const {
|
|
371
|
+
selectedIdx,
|
|
372
|
+
integrations
|
|
373
|
+
} = integationSt;
|
|
374
|
+
const selectedIntegration = integrations[selectedIdx];
|
|
375
|
+
const {
|
|
376
|
+
stack,
|
|
377
|
+
refArea,
|
|
378
|
+
refFactor,
|
|
379
|
+
shift
|
|
380
|
+
} = selectedIntegration;
|
|
381
|
+
const isDisable = _cfg.default.btnCmdIntg(this.layout);
|
|
382
|
+
const ignoreRef = _format.default.isHplcUvVisLayout(this.layout);
|
|
383
|
+
const itgs = isDisable ? [] : stack;
|
|
384
|
+
const igbp = this.tags.igbPath.selectAll('path').data(itgs);
|
|
385
|
+
igbp.exit().attr('class', 'exit').remove();
|
|
386
|
+
const igcp = this.tags.igcPath.selectAll('path').data(itgs);
|
|
387
|
+
igcp.exit().attr('class', 'exit').remove();
|
|
388
|
+
const igtp = this.tags.igtPath.selectAll('text').data(itgs);
|
|
389
|
+
igtp.exit().attr('class', 'exit').remove();
|
|
390
|
+
if (itgs.length === 0 || isDisable) {
|
|
391
|
+
// remove drawn area under curve
|
|
392
|
+
const auc = this.tags.aucPath.selectAll('path').data(stack);
|
|
393
|
+
auc.exit().attr('class', 'exit').remove();
|
|
394
|
+
auc.merge(auc);
|
|
395
|
+
return;
|
|
737
396
|
}
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
397
|
+
if (ignoreRef) {
|
|
398
|
+
this.drawAUC(stack);
|
|
399
|
+
} else {
|
|
400
|
+
// rescale for zoom
|
|
401
|
+
const {
|
|
402
|
+
xt
|
|
403
|
+
} = (0, _compass.TfRescale)(this);
|
|
404
|
+
const dh = 50;
|
|
405
|
+
const integBar = data => d3.line()([[xt(data.xL - shift), dh], [xt(data.xL - shift), dh - 10], [xt(data.xL - shift), dh - 5], [xt(data.xU - shift), dh - 5], [xt(data.xU - shift), dh - 10], [xt(data.xU - shift), dh]]);
|
|
406
|
+
igbp.enter().append('path').attr('class', 'igbp').attr('fill', 'none').attr('stroke', '#228B22').attr('stroke-width', 2).merge(igbp).attr('id', d => `igbp${(0, _focus.itgIdTag)(d)}`).attr('d', d => integBar(d)).on('mouseover', d => {
|
|
407
|
+
d3.select(`#igbp${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'blue');
|
|
408
|
+
d3.select(`#igbc${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'blue');
|
|
409
|
+
d3.select(`#igtp${(0, _focus.itgIdTag)(d)}`).style('fill', 'blue');
|
|
410
|
+
}).on('mouseout', d => {
|
|
411
|
+
d3.select(`#igbp${(0, _focus.itgIdTag)(d)}`).attr('stroke', '#228B22');
|
|
412
|
+
d3.select(`#igbc${(0, _focus.itgIdTag)(d)}`).attr('stroke', '#228B22');
|
|
413
|
+
d3.select(`#igtp${(0, _focus.itgIdTag)(d)}`).style('fill', '#228B22');
|
|
414
|
+
}).on('click', d => this.onClickTarget(d));
|
|
415
|
+
const integCurve = border => {
|
|
416
|
+
const {
|
|
417
|
+
xL,
|
|
418
|
+
xU
|
|
419
|
+
} = border;
|
|
420
|
+
const [nXL, nXU] = [xL - shift, xU - shift];
|
|
421
|
+
const ps = this.data.filter(d => d.x > nXL && d.x < nXU);
|
|
422
|
+
const kMax = this.data[this.data.length - 1].k;
|
|
423
|
+
if (!ps[0]) return null;
|
|
424
|
+
const kRef = ps[0].k;
|
|
425
|
+
if (!this.reverseXAxis(this.layout)) {
|
|
426
|
+
return d3.line().x(d => xt(d.x)).y(d => 100 - (kRef - d.k) * 400 / kMax)(ps);
|
|
427
|
+
}
|
|
428
|
+
return d3.line().x(d => xt(d.x)).y(d => 300 - (d.k - kRef) * 400 / kMax)(ps);
|
|
429
|
+
};
|
|
430
|
+
igcp.enter().append('path').attr('class', 'igcp').attr('fill', 'none').attr('stroke', '#228B22').attr('stroke-width', 2).merge(igcp).attr('id', d => `igbc${(0, _focus.itgIdTag)(d)}`).attr('d', d => integCurve(d)).on('mouseover', d => {
|
|
431
|
+
d3.select(`#igbp${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'blue');
|
|
432
|
+
d3.select(`#igbc${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'blue');
|
|
433
|
+
d3.select(`#igtp${(0, _focus.itgIdTag)(d)}`).style('fill', 'blue');
|
|
434
|
+
}).on('mouseout', d => {
|
|
435
|
+
d3.select(`#igbp${(0, _focus.itgIdTag)(d)}`).attr('stroke', '#228B22');
|
|
436
|
+
d3.select(`#igbc${(0, _focus.itgIdTag)(d)}`).attr('stroke', '#228B22');
|
|
437
|
+
d3.select(`#igtp${(0, _focus.itgIdTag)(d)}`).style('fill', '#228B22');
|
|
438
|
+
}).on('click', d => this.onClickTarget(d));
|
|
439
|
+
igtp.enter().append('text').attr('class', 'igtp').attr('font-family', 'Helvetica').style('font-size', '12px').attr('fill', '#228B22').style('text-anchor', 'middle').merge(igtp).attr('id', d => `igtp${(0, _focus.itgIdTag)(d)}`).text(d => (0, _integration.calcArea)(d, refArea, refFactor, ignoreRef)).attr('transform', d => `translate(${xt((d.xL + d.xU) / 2 - shift)}, ${dh - 12})`).on('mouseover', d => {
|
|
440
|
+
d3.select(`#igbp${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'blue');
|
|
441
|
+
d3.select(`#igbc${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'blue');
|
|
442
|
+
d3.select(`#igtp${(0, _focus.itgIdTag)(d)}`).style('fill', 'blue');
|
|
443
|
+
}).on('mouseout', d => {
|
|
444
|
+
d3.select(`#igbp${(0, _focus.itgIdTag)(d)}`).attr('stroke', '#228B22');
|
|
445
|
+
d3.select(`#igbc${(0, _focus.itgIdTag)(d)}`).attr('stroke', '#228B22');
|
|
446
|
+
d3.select(`#igtp${(0, _focus.itgIdTag)(d)}`).style('fill', '#228B22');
|
|
447
|
+
}).on('click', d => this.onClickTarget(d));
|
|
742
448
|
}
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
449
|
+
}
|
|
450
|
+
drawMtply(mtplySt) {
|
|
451
|
+
const {
|
|
452
|
+
sameXY,
|
|
453
|
+
sameLySt,
|
|
454
|
+
sameMySt
|
|
455
|
+
} = this.shouldUpdate;
|
|
456
|
+
if (sameXY && sameLySt && sameMySt) return;
|
|
457
|
+
const {
|
|
458
|
+
selectedIdx,
|
|
459
|
+
multiplicities
|
|
460
|
+
} = mtplySt;
|
|
461
|
+
const selectedMulti = multiplicities[selectedIdx];
|
|
462
|
+
const {
|
|
463
|
+
stack,
|
|
464
|
+
smExtext,
|
|
465
|
+
shift
|
|
466
|
+
} = selectedMulti;
|
|
467
|
+
const mpys = stack;
|
|
468
|
+
const isDisable = _cfg.default.btnCmdMpy(this.layout);
|
|
469
|
+
if (mpys === 0 || isDisable) return;
|
|
470
|
+
// rescale for zoom
|
|
471
|
+
const {
|
|
472
|
+
xt
|
|
473
|
+
} = (0, _compass.TfRescale)(this);
|
|
474
|
+
const mpyb = this.tags.mpybPath.selectAll('path').data(mpys);
|
|
475
|
+
mpyb.exit().attr('class', 'exit').remove();
|
|
476
|
+
const mpyt1 = this.tags.mpyt1Path.selectAll('text').data(mpys);
|
|
477
|
+
mpyt1.exit().attr('class', 'exit').remove();
|
|
478
|
+
const mpyt2 = this.tags.mpyt2Path.selectAll('text').data(mpys);
|
|
479
|
+
mpyt2.exit().attr('class', 'exit').remove();
|
|
480
|
+
let mPeaks = mpys.map(m => {
|
|
481
|
+
const {
|
|
482
|
+
peaks,
|
|
483
|
+
xExtent
|
|
484
|
+
} = m;
|
|
485
|
+
return peaks.map(p => Object.assign({}, p, {
|
|
486
|
+
xExtent
|
|
487
|
+
}));
|
|
488
|
+
});
|
|
489
|
+
mPeaks = [].concat(...mPeaks);
|
|
490
|
+
const mpyp = this.tags.mpypPath.selectAll('path').data(mPeaks);
|
|
491
|
+
mpyp.exit().attr('class', 'exit').remove();
|
|
492
|
+
const height = this.h;
|
|
493
|
+
const dh = Math.abs(0.06 * height);
|
|
494
|
+
const mpyBar = data => d3.line()([[xt(data.xExtent.xL - shift), height - dh], [xt(data.xExtent.xL - shift), height - dh - 10], [xt(data.xExtent.xL - shift), height - dh - 5], [xt(data.xExtent.xU - shift), height - dh - 5], [xt(data.xExtent.xU - shift), height - dh - 10], [xt(data.xExtent.xU - shift), height - dh]]);
|
|
495
|
+
const mpyColor = d => {
|
|
496
|
+
const {
|
|
497
|
+
xL,
|
|
498
|
+
xU
|
|
499
|
+
} = d.xExtent;
|
|
500
|
+
return smExtext.xL === xL && smExtext.xU === xU ? 'purple' : '#DA70D6';
|
|
501
|
+
};
|
|
502
|
+
mpyb.enter().append('path').attr('class', 'mpyb').attr('fill', 'none').attr('stroke-width', 2).merge(mpyb).attr('stroke', d => mpyColor(d)).attr('id', d => `mpyb${(0, _focus.mpyIdTag)(d)}`).attr('d', d => mpyBar(d)).on('mouseover', d => {
|
|
503
|
+
d3.selectAll(`#mpyb${(0, _focus.mpyIdTag)(d)}`).attr('stroke', 'blue');
|
|
504
|
+
d3.selectAll(`#mpyt1${(0, _focus.mpyIdTag)(d)}`).style('fill', 'blue');
|
|
505
|
+
d3.selectAll(`#mpyt2${(0, _focus.mpyIdTag)(d)}`).style('fill', 'blue');
|
|
506
|
+
d3.selectAll(`#mpyp${(0, _focus.mpyIdTag)(d)}`).attr('stroke', 'blue');
|
|
507
|
+
}).on('mouseout', d => {
|
|
508
|
+
const dColor = mpyColor(d);
|
|
509
|
+
d3.selectAll(`#mpyb${(0, _focus.mpyIdTag)(d)}`).attr('stroke', dColor);
|
|
510
|
+
d3.selectAll(`#mpyt1${(0, _focus.mpyIdTag)(d)}`).style('fill', dColor);
|
|
511
|
+
d3.selectAll(`#mpyt2${(0, _focus.mpyIdTag)(d)}`).style('fill', dColor);
|
|
512
|
+
d3.selectAll(`#mpyp${(0, _focus.mpyIdTag)(d)}`).attr('stroke', dColor);
|
|
513
|
+
}).on('click', d => this.onClickTarget(d));
|
|
514
|
+
mpyt1.enter().append('text').attr('class', 'mpyt1').attr('font-family', 'Helvetica').style('font-size', '12px').style('text-anchor', 'middle').merge(mpyt1).attr('fill', d => mpyColor(d)).attr('id', d => `mpyt1${(0, _focus.mpyIdTag)(d)}`).text(d => `${(0, _multiplicity_calc.calcMpyCenter)(d.peaks, shift, d.mpyType).toFixed(3)}`).attr('transform', d => `translate(${xt((d.xExtent.xL + d.xExtent.xU) / 2 - shift)}, ${height - dh + 12})`).on('mouseover', d => {
|
|
515
|
+
d3.selectAll(`#mpyb${(0, _focus.mpyIdTag)(d)}`).attr('stroke', 'blue');
|
|
516
|
+
d3.selectAll(`#mpyt1${(0, _focus.mpyIdTag)(d)}`).style('fill', 'blue');
|
|
517
|
+
d3.selectAll(`#mpyt2${(0, _focus.mpyIdTag)(d)}`).style('fill', 'blue');
|
|
518
|
+
d3.selectAll(`#mpyp${(0, _focus.mpyIdTag)(d)}`).attr('stroke', 'blue');
|
|
519
|
+
}).on('mouseout', d => {
|
|
520
|
+
const dColor = mpyColor(d);
|
|
521
|
+
d3.selectAll(`#mpyb${(0, _focus.mpyIdTag)(d)}`).attr('stroke', dColor);
|
|
522
|
+
d3.selectAll(`#mpyt1${(0, _focus.mpyIdTag)(d)}`).style('fill', dColor);
|
|
523
|
+
d3.selectAll(`#mpyt2${(0, _focus.mpyIdTag)(d)}`).style('fill', dColor);
|
|
524
|
+
d3.selectAll(`#mpyp${(0, _focus.mpyIdTag)(d)}`).attr('stroke', dColor);
|
|
525
|
+
}).on('click', d => this.onClickTarget(d));
|
|
526
|
+
mpyt2.enter().append('text').attr('class', 'mpyt2').attr('font-family', 'Helvetica').style('font-size', '12px').style('text-anchor', 'middle').merge(mpyt2).attr('fill', d => mpyColor(d)).attr('id', d => `mpyt2${(0, _focus.mpyIdTag)(d)}`).text(d => `(${d.mpyType})`).attr('transform', d => `translate(${xt((d.xExtent.xL + d.xExtent.xU) / 2 - shift)}, ${height - dh + 24})`).on('mouseover', d => {
|
|
527
|
+
d3.selectAll(`#mpyb${(0, _focus.mpyIdTag)(d)}`).attr('stroke', 'blue');
|
|
528
|
+
d3.selectAll(`#mpyt1${(0, _focus.mpyIdTag)(d)}`).style('fill', 'blue');
|
|
529
|
+
d3.selectAll(`#mpyt2${(0, _focus.mpyIdTag)(d)}`).style('fill', 'blue');
|
|
530
|
+
d3.selectAll(`#mpyp${(0, _focus.mpyIdTag)(d)}`).attr('stroke', 'blue');
|
|
531
|
+
}).on('mouseout', d => {
|
|
532
|
+
const dColor = mpyColor(d);
|
|
533
|
+
d3.selectAll(`#mpyb${(0, _focus.mpyIdTag)(d)}`).attr('stroke', dColor);
|
|
534
|
+
d3.selectAll(`#mpyt1${(0, _focus.mpyIdTag)(d)}`).style('fill', dColor);
|
|
535
|
+
d3.selectAll(`#mpyt2${(0, _focus.mpyIdTag)(d)}`).style('fill', dColor);
|
|
536
|
+
d3.selectAll(`#mpyp${(0, _focus.mpyIdTag)(d)}`).attr('stroke', dColor);
|
|
537
|
+
}).on('click', d => this.onClickTarget(d));
|
|
538
|
+
const mpypH = height - dh;
|
|
539
|
+
const mpypPath = pk => [{
|
|
540
|
+
x: xt(pk.x - shift) - 0.5,
|
|
541
|
+
y: mpypH - 5
|
|
542
|
+
}, {
|
|
543
|
+
x: xt(pk.x - shift) - 0.5,
|
|
544
|
+
y: mpypH - 20
|
|
545
|
+
}, {
|
|
546
|
+
x: xt(pk.x - shift) + 0.5,
|
|
547
|
+
y: mpypH - 20
|
|
548
|
+
}, {
|
|
549
|
+
x: xt(pk.x - shift) + 0.5,
|
|
550
|
+
y: mpypH - 5
|
|
551
|
+
}];
|
|
552
|
+
// const faktor = layoutSt === LIST_LAYOUT.IR ? -1 : 1;
|
|
553
|
+
const lineSymbol = d3.line().x(d => d.x).y(d => d.y);
|
|
554
|
+
mpyp.enter().append('path').attr('class', 'mpyp').attr('fill', 'none').merge(mpyp).attr('stroke', d => mpyColor(d)).attr('d', d => lineSymbol(mpypPath(d))).attr('id', d => `mpyp${(0, _focus.mpyIdTag)(d)}`).on('mouseover', d => {
|
|
555
|
+
d3.selectAll(`#mpyb${(0, _focus.mpyIdTag)(d)}`).attr('stroke', 'blue');
|
|
556
|
+
d3.selectAll(`#mpyt1${(0, _focus.mpyIdTag)(d)}`).style('fill', 'blue');
|
|
557
|
+
d3.selectAll(`#mpyt2${(0, _focus.mpyIdTag)(d)}`).style('fill', 'blue');
|
|
558
|
+
d3.selectAll(`#mpyp${(0, _focus.mpyIdTag)(d)}`).attr('stroke', 'blue');
|
|
559
|
+
}).on('mouseout', d => {
|
|
560
|
+
const dColor = mpyColor(d);
|
|
561
|
+
d3.selectAll(`#mpyb${(0, _focus.mpyIdTag)(d)}`).attr('stroke', dColor);
|
|
562
|
+
d3.selectAll(`#mpyt1${(0, _focus.mpyIdTag)(d)}`).style('fill', dColor);
|
|
563
|
+
d3.selectAll(`#mpyt2${(0, _focus.mpyIdTag)(d)}`).style('fill', dColor);
|
|
564
|
+
d3.selectAll(`#mpyp${(0, _focus.mpyIdTag)(d)}`).attr('stroke', dColor);
|
|
565
|
+
}).on('click', d => this.onClickTarget(d));
|
|
566
|
+
}
|
|
567
|
+
drawRef() {
|
|
568
|
+
// rescale for zoom
|
|
569
|
+
const {
|
|
570
|
+
xt,
|
|
571
|
+
yt
|
|
572
|
+
} = (0, _compass.TfRescale)(this);
|
|
573
|
+
const ccp = this.ref.selectAll('path').data(this.tSfPeaks);
|
|
574
|
+
ccp.exit().attr('class', 'exit').remove();
|
|
575
|
+
const linePath = [{
|
|
576
|
+
x: -0.5,
|
|
577
|
+
y: 10
|
|
578
|
+
}, {
|
|
579
|
+
x: -4,
|
|
580
|
+
y: -20
|
|
581
|
+
}, {
|
|
582
|
+
x: 4,
|
|
583
|
+
y: -20
|
|
584
|
+
}, {
|
|
585
|
+
x: 0.5,
|
|
586
|
+
y: 10
|
|
587
|
+
}];
|
|
588
|
+
const faktor = _format.default.isIrLayout(this.layout) ? -1 : 1;
|
|
589
|
+
const lineSymbol = d3.line().x(d => d.x).y(d => faktor * d.y)(linePath);
|
|
590
|
+
ccp.enter().append('path').attr('d', lineSymbol).attr('class', 'enter-ref').attr('fill', 'green').attr('fill-opacity', 0.8).merge(ccp).attr('transform', d => `translate(${xt(d.x)}, ${yt(d.y)})`);
|
|
591
|
+
}
|
|
592
|
+
drawComparisons(comparisons) {
|
|
593
|
+
d3.selectAll('.line-clip-compare').remove();
|
|
594
|
+
if (!comparisons) return null;
|
|
595
|
+
comparisons.forEach((c, idx) => {
|
|
596
|
+
if (!c.show) return;
|
|
597
|
+
const path = (0, _mount.MountComparePath)(this, _format.default.compareColors(idx), idx); // #D5D8DC
|
|
598
|
+
path.attr('d', this.pathCall(c.data));
|
|
599
|
+
});
|
|
600
|
+
return null;
|
|
601
|
+
}
|
|
602
|
+
reverseXAxis(layoutSt) {
|
|
603
|
+
return [_list_layout.LIST_LAYOUT.UVVIS, _list_layout.LIST_LAYOUT.HPLC_UVVIS, _list_layout.LIST_LAYOUT.TGA, _list_layout.LIST_LAYOUT.XRD, _list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY, _list_layout.LIST_LAYOUT.CDS, _list_layout.LIST_LAYOUT.DLS_ACF, _list_layout.LIST_LAYOUT.SEC, _list_layout.LIST_LAYOUT.EMISSIONS, _list_layout.LIST_LAYOUT.DLS_INTENSITY].indexOf(layoutSt) < 0;
|
|
604
|
+
}
|
|
605
|
+
create(_ref) {
|
|
606
|
+
let {
|
|
607
|
+
filterSeed,
|
|
608
|
+
filterPeak,
|
|
609
|
+
tTrEndPts,
|
|
610
|
+
tSfPeaks,
|
|
611
|
+
freq,
|
|
612
|
+
comparisons,
|
|
613
|
+
editPeakSt,
|
|
614
|
+
layoutSt,
|
|
615
|
+
integationSt,
|
|
616
|
+
mtplySt,
|
|
617
|
+
sweepExtentSt,
|
|
618
|
+
isUiAddIntgSt,
|
|
619
|
+
isUiNoBrushSt,
|
|
620
|
+
wavelength
|
|
621
|
+
} = _ref;
|
|
622
|
+
this.svg = d3.select('.d3Svg');
|
|
623
|
+
(0, _mount.MountMainFrame)(this, 'focus');
|
|
624
|
+
(0, _mount.MountClip)(this);
|
|
625
|
+
this.root = d3.select(this.rootKlass).selectAll('.focus-main');
|
|
626
|
+
this.scales = (0, _init.InitScale)(this, this.reverseXAxis(layoutSt));
|
|
627
|
+
this.setTip();
|
|
628
|
+
this.setDataParams(filterSeed, filterPeak, tTrEndPts, tSfPeaks, freq, layoutSt, wavelength);
|
|
629
|
+
(0, _compass.MountCompass)(this);
|
|
630
|
+
this.axis = (0, _mount.MountAxis)(this);
|
|
631
|
+
this.path = (0, _mount.MountPath)(this, 'steelblue');
|
|
632
|
+
[this.thresLineUp, this.thresLineDw] = (0, _mount.MountThresLine)(this, 'green');
|
|
633
|
+
this.grid = (0, _mount.MountGrid)(this);
|
|
634
|
+
this.tags = (0, _mount.MountTags)(this);
|
|
635
|
+
this.ref = (0, _mount.MountRef)(this);
|
|
636
|
+
(0, _mount.MountAxisLabelX)(this);
|
|
637
|
+
(0, _mount.MountAxisLabelY)(this);
|
|
638
|
+
if (this.data && this.data.length > 0) {
|
|
639
|
+
this.setConfig(sweepExtentSt);
|
|
640
|
+
this.drawLine();
|
|
641
|
+
this.drawThres();
|
|
642
|
+
this.drawGrid();
|
|
643
|
+
this.drawRef();
|
|
644
|
+
this.drawPeaks(editPeakSt);
|
|
645
|
+
this.drawInteg(integationSt);
|
|
646
|
+
this.drawMtply(mtplySt);
|
|
647
|
+
this.drawComparisons(comparisons);
|
|
792
648
|
}
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
this.
|
|
649
|
+
(0, _brush.default)(this, isUiAddIntgSt, isUiNoBrushSt);
|
|
650
|
+
this.resetShouldUpdate(editPeakSt, integationSt, mtplySt);
|
|
651
|
+
}
|
|
652
|
+
update(_ref2) {
|
|
653
|
+
let {
|
|
654
|
+
filterSeed,
|
|
655
|
+
filterPeak,
|
|
656
|
+
tTrEndPts,
|
|
657
|
+
tSfPeaks,
|
|
658
|
+
freq,
|
|
659
|
+
comparisons,
|
|
660
|
+
editPeakSt,
|
|
661
|
+
layoutSt,
|
|
662
|
+
integationSt,
|
|
663
|
+
mtplySt,
|
|
664
|
+
sweepExtentSt,
|
|
665
|
+
isUiAddIntgSt,
|
|
666
|
+
isUiNoBrushSt,
|
|
667
|
+
wavelength
|
|
668
|
+
} = _ref2;
|
|
669
|
+
this.root = d3.select(this.rootKlass).selectAll('.focus-main');
|
|
670
|
+
this.scales = (0, _init.InitScale)(this, this.reverseXAxis(layoutSt));
|
|
671
|
+
this.setDataParams(filterSeed, filterPeak, tTrEndPts, tSfPeaks, freq, layoutSt, wavelength);
|
|
672
|
+
if (this.data && this.data.length > 0) {
|
|
673
|
+
this.setConfig(sweepExtentSt);
|
|
674
|
+
this.getShouldUpdate(editPeakSt, integationSt, mtplySt);
|
|
675
|
+
this.drawLine();
|
|
676
|
+
this.drawThres();
|
|
677
|
+
this.drawGrid();
|
|
678
|
+
this.drawRef();
|
|
679
|
+
this.drawPeaks(editPeakSt);
|
|
680
|
+
this.drawInteg(integationSt);
|
|
681
|
+
this.drawMtply(mtplySt);
|
|
682
|
+
this.drawComparisons(comparisons);
|
|
827
683
|
}
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
exports.default =
|
|
684
|
+
(0, _brush.default)(this, isUiAddIntgSt, isUiNoBrushSt);
|
|
685
|
+
this.resetShouldUpdate(editPeakSt, integationSt, mtplySt);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
var _default = exports.default = LineFocus;
|