@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.
Files changed (202) hide show
  1. package/README.md +16 -0
  2. package/dist/__tests__/fixtures/aif_jcamp_1.js +136 -0
  3. package/dist/__tests__/fixtures/aif_jcamp_2.js +122 -0
  4. package/dist/__tests__/fixtures/backup/nmr1h_a.js +3518 -0
  5. package/dist/__tests__/fixtures/backup/xrd_jcamp_1.js +10705 -0
  6. package/dist/__tests__/fixtures/cds_jcamp.js +861 -0
  7. package/dist/__tests__/fixtures/compare_ir_1_jcamp.js +585 -0
  8. package/dist/__tests__/fixtures/compare_ir_2_jcamp.js +515 -0
  9. package/dist/__tests__/fixtures/compare_uv_vis_jcamp.js +640 -0
  10. package/dist/__tests__/fixtures/cyclic_voltammetry_1.js +778 -0
  11. package/dist/__tests__/fixtures/cyclic_voltammetry_2.js +758 -0
  12. package/dist/__tests__/fixtures/cyclic_voltammetry_3.js +759 -0
  13. package/dist/__tests__/fixtures/dls_acf_jcamp.js +148 -0
  14. package/dist/__tests__/fixtures/dls_intensity_jcamp.js +151 -0
  15. package/dist/__tests__/fixtures/emissions_jcamp.js +883 -0
  16. package/dist/__tests__/fixtures/hplc_uvvis_jcamp.js +638 -0
  17. package/dist/__tests__/fixtures/hplc_uvvis_jcamp_2.js +221 -0
  18. package/dist/__tests__/fixtures/ir_jcamp.js +148 -0
  19. package/dist/__tests__/fixtures/ir_result.js +46 -0
  20. package/dist/__tests__/fixtures/ir_svg.js +8 -0
  21. package/dist/__tests__/fixtures/ms_jcamp.js +64 -0
  22. package/dist/__tests__/fixtures/nmr13c_dept_jcamp.js +3543 -0
  23. package/dist/__tests__/fixtures/nmr13c_jcamp.js +1229 -0
  24. package/dist/__tests__/fixtures/nmr15n_jcamp.js +7177 -0
  25. package/dist/__tests__/fixtures/nmr19f_jcamp.js +6560 -0
  26. package/dist/__tests__/fixtures/nmr1h_2_jcamp.js +2005 -0
  27. package/dist/__tests__/fixtures/nmr1h_jcamp.js +4516 -0
  28. package/dist/__tests__/fixtures/nmr29si_jcamp.js +3029 -0
  29. package/dist/__tests__/fixtures/nmr31p_jcamp.js +3418 -0
  30. package/dist/__tests__/fixtures/nmr_result.js +68 -0
  31. package/dist/__tests__/fixtures/nmr_svg.js +8 -0
  32. package/dist/__tests__/fixtures/phenylalanin.js +142 -0
  33. package/dist/__tests__/fixtures/qDescValue.js +65 -0
  34. package/dist/__tests__/fixtures/raman_jcamp.js +410 -0
  35. package/dist/__tests__/fixtures/sec_1_jcamp.js +425 -0
  36. package/dist/__tests__/fixtures/sec_2_jcamp.js +407 -0
  37. package/dist/__tests__/fixtures/sec_3_jcamp.js +408 -0
  38. package/dist/__tests__/fixtures/sec_4_jcamp.js +407 -0
  39. package/dist/__tests__/fixtures/tga_jcamp.js +4157 -0
  40. package/dist/__tests__/fixtures/uv_vis_jcamp.js +249 -0
  41. package/dist/__tests__/fixtures/xrd_jcamp_1.js +436 -0
  42. package/dist/__tests__/fixtures/xrd_jcamp_2.js +955 -0
  43. package/dist/__tests__/fixtures/xrd_jcamp_3.js +1871 -0
  44. package/dist/__tests__/units/components/panel/graph_selection.test.js +72 -0
  45. package/dist/__tests__/units/components/panel/peaks.test.js +87 -0
  46. package/dist/actions/curve.js +15 -14
  47. package/dist/actions/cyclic_voltammetry.js +40 -60
  48. package/dist/actions/edit_peak.js +8 -12
  49. package/dist/actions/forecast.js +16 -24
  50. package/dist/actions/integration.js +12 -18
  51. package/dist/actions/jcamp.js +16 -24
  52. package/dist/actions/layout.js +4 -6
  53. package/dist/actions/manager.js +20 -30
  54. package/dist/actions/meta.js +4 -6
  55. package/dist/actions/multiplicity.js +24 -36
  56. package/dist/actions/scan.js +12 -18
  57. package/dist/actions/shift.js +8 -12
  58. package/dist/actions/status.js +12 -18
  59. package/dist/actions/submit.js +16 -24
  60. package/dist/actions/threshold.js +20 -30
  61. package/dist/actions/ui.js +25 -31
  62. package/dist/actions/wavelength.js +4 -6
  63. package/dist/app.js +25 -23
  64. package/dist/components/cmd_bar/01_viewer.js +24 -34
  65. package/dist/components/cmd_bar/02_zoom.js +18 -28
  66. package/dist/components/cmd_bar/03_peak.js +50 -66
  67. package/dist/components/cmd_bar/04_integration.js +70 -84
  68. package/dist/components/cmd_bar/05_multiplicity.js +42 -56
  69. package/dist/components/cmd_bar/06_undo_redo.js +22 -36
  70. package/dist/components/cmd_bar/07_pecker.js +24 -34
  71. package/dist/components/cmd_bar/common.js +11 -7
  72. package/dist/components/cmd_bar/index.js +17 -23
  73. package/dist/components/cmd_bar/r01_layout.js +79 -56
  74. package/dist/components/cmd_bar/r02_scan.js +70 -87
  75. package/dist/components/cmd_bar/r03_threshold.js +54 -68
  76. package/dist/components/cmd_bar/r04_submit.js +71 -83
  77. package/dist/components/cmd_bar/r05_submit_btn.js +64 -72
  78. package/dist/components/cmd_bar/r06_predict_btn.js +142 -152
  79. package/dist/components/cmd_bar/r07_wavelength_btn.js +28 -36
  80. package/dist/components/cmd_bar/tri_btn.js +91 -113
  81. package/dist/components/common/chem.js +2 -3
  82. package/dist/components/common/comps.js +2 -2
  83. package/dist/components/common/draw.js +30 -11
  84. package/dist/components/d3_line/index.js +154 -176
  85. package/dist/components/d3_line/line_focus.js +595 -739
  86. package/dist/components/d3_multi/index.js +153 -174
  87. package/dist/components/d3_multi/multi_focus.js +725 -850
  88. package/dist/components/d3_rect/index.js +112 -134
  89. package/dist/components/d3_rect/rect_focus.js +163 -208
  90. package/dist/components/forecast/comps.js +60 -68
  91. package/dist/components/forecast/ir_comps.js +49 -56
  92. package/dist/components/forecast/ir_viewer.js +61 -68
  93. package/dist/components/forecast/nmr_comps.js +62 -72
  94. package/dist/components/forecast/nmr_viewer.js +59 -68
  95. package/dist/components/forecast/section_loading.js +39 -63
  96. package/dist/components/forecast_viewer.js +109 -119
  97. package/dist/components/multi_jcamps_viewer.js +97 -113
  98. package/dist/components/panel/compare.js +183 -192
  99. package/dist/components/panel/cyclic_voltamery_data.js +149 -165
  100. package/dist/components/panel/graph_selection.js +143 -132
  101. package/dist/components/panel/index.js +112 -144
  102. package/dist/components/panel/info.js +125 -132
  103. package/dist/components/panel/multiplicity.js +215 -223
  104. package/dist/components/panel/multiplicity_coupling.js +108 -136
  105. package/dist/components/panel/multiplicity_select.js +43 -51
  106. package/dist/components/panel/peaks.js +130 -132
  107. package/dist/constants/action_type.js +23 -39
  108. package/dist/constants/list_layout.js +7 -4
  109. package/dist/constants/list_shift.js +117 -103
  110. package/dist/constants/list_ui.js +3 -6
  111. package/dist/constants/list_wavelength.js +7 -8
  112. package/dist/fn.js +2 -3
  113. package/dist/helpers/brush.js +49 -65
  114. package/dist/helpers/calc.js +2 -4
  115. package/dist/helpers/carbonFeatures.js +22 -20
  116. package/dist/helpers/cfg.js +49 -67
  117. package/dist/helpers/chem.js +450 -393
  118. package/dist/helpers/compass.js +92 -83
  119. package/dist/helpers/converter.js +52 -65
  120. package/dist/helpers/extractParams.js +60 -52
  121. package/dist/helpers/extractPeaksEdit.js +29 -25
  122. package/dist/helpers/focus.js +2 -6
  123. package/dist/helpers/format.js +416 -361
  124. package/dist/helpers/init.js +41 -37
  125. package/dist/helpers/integration.js +18 -21
  126. package/dist/helpers/mount.js +57 -61
  127. package/dist/helpers/multiplicity.js +19 -24
  128. package/dist/helpers/multiplicity_calc.js +39 -50
  129. package/dist/helpers/multiplicity_complat.js +21 -47
  130. package/dist/helpers/multiplicity_manual.js +49 -55
  131. package/dist/helpers/multiplicity_verify_basic.js +108 -111
  132. package/dist/helpers/shift.js +15 -23
  133. package/dist/helpers/zoom.js +7 -11
  134. package/dist/index.js +680 -630
  135. package/dist/layer_content.js +40 -43
  136. package/dist/layer_init.js +162 -184
  137. package/dist/layer_prism.js +38 -41
  138. package/dist/reducers/index.js +2 -3
  139. package/dist/reducers/reducer_curve.js +35 -26
  140. package/dist/reducers/reducer_edit_peak.js +122 -98
  141. package/dist/reducers/reducer_forecast.js +57 -44
  142. package/dist/reducers/reducer_integration.js +135 -103
  143. package/dist/reducers/reducer_jcamp.js +49 -44
  144. package/dist/reducers/reducer_layout.js +5 -6
  145. package/dist/reducers/reducer_manager.js +5 -6
  146. package/dist/reducers/reducer_meta.js +5 -6
  147. package/dist/reducers/reducer_multiplicity.js +100 -77
  148. package/dist/reducers/reducer_scan.js +17 -20
  149. package/dist/reducers/reducer_shift.js +115 -70
  150. package/dist/reducers/reducer_simulation.js +7 -8
  151. package/dist/reducers/reducer_status.js +5 -6
  152. package/dist/reducers/reducer_submit.js +12 -15
  153. package/dist/reducers/reducer_threshold.js +5 -6
  154. package/dist/reducers/reducer_ui.js +5 -6
  155. package/dist/reducers/reducer_voltammetry.js +156 -96
  156. package/dist/reducers/reducer_wavelength.js +5 -6
  157. package/dist/reducers/undo_redo_config.js +3 -5
  158. package/dist/sagas/index.js +2 -15
  159. package/dist/sagas/saga_edit_peak.js +54 -68
  160. package/dist/sagas/saga_manager.js +86 -130
  161. package/dist/sagas/saga_meta.js +25 -31
  162. package/dist/sagas/saga_multi_entities.js +40 -103
  163. package/dist/sagas/saga_multiplicity.js +336 -406
  164. package/dist/sagas/saga_ui.js +296 -475
  165. package/dist/setupTests.js +8 -0
  166. package/dist/third_party/jAnalyzer.js +66 -67
  167. package/dist/third_party/peakInterval.js +34 -34
  168. package/package.json +14 -14
  169. package/dist/components/cmd_bar/03_peak_bk.js +0 -139
  170. package/dist/components/cmd_bar/04_integration_bk.js +0 -180
  171. package/dist/components/cmd_bar/05_multiplicity_bk.js +0 -131
  172. package/dist/components/cmd_bar/r01_layout_bk.js +0 -186
  173. package/dist/components/cmd_bar/r06_predict_btn_bk.js +0 -220
  174. package/dist/components/d3_line/line_focus_bk.js +0 -825
  175. package/dist/components/d3_multi/index_bk.js +0 -210
  176. package/dist/components/d3_multi/multi_focus_bk.js +0 -533
  177. package/dist/components/panel/compare_bk.js +0 -256
  178. package/dist/components/panel/cyclic_voltamery_data_bk.js +0 -292
  179. package/dist/components/panel/index_bk.js +0 -178
  180. package/dist/components/panel/info_bk.js +0 -235
  181. package/dist/components/panel/multiplicity_bk.js +0 -280
  182. package/dist/helpers/carbonFeatures_bk.js +0 -45
  183. package/dist/helpers/cfg_bk.js +0 -80
  184. package/dist/helpers/chem_bk.js +0 -787
  185. package/dist/helpers/compass_bk.js +0 -149
  186. package/dist/helpers/converter_bk.js +0 -96
  187. package/dist/helpers/extractPeaksEdit_bk.js +0 -53
  188. package/dist/helpers/format_bk.js +0 -497
  189. package/dist/index_bk.js +0 -640
  190. package/dist/layer_content_bk.js +0 -105
  191. package/dist/layer_init_bk.js +0 -235
  192. package/dist/layer_prism_bk.js +0 -133
  193. package/dist/reducers/reducer_edit_peak_bk.js +0 -108
  194. package/dist/reducers/reducer_integration_bk.js +0 -134
  195. package/dist/reducers/reducer_jcamp_bk.js +0 -71
  196. package/dist/reducers/reducer_multiplicity_bk.js +0 -126
  197. package/dist/reducers/reducer_shift_bk.js +0 -88
  198. package/dist/reducers/reducer_voltammetry_bk.js +0 -287
  199. package/dist/sagas/saga_edit_peak_bk.js +0 -73
  200. package/dist/sagas/saga_multi_entities_bk.js +0 -106
  201. package/dist/sagas/saga_multiplicity_bk.js +0 -351
  202. package/dist/sagas/saga_ui_bk.js +0 -453
@@ -1,14 +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 _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
8
  var d3 = _interopRequireWildcard(require("d3"));
13
9
  var _init = require("../../helpers/init");
14
10
  var _mount = require("../../helpers/mount");
@@ -23,21 +19,24 @@ var _focus = require("../../helpers/focus");
23
19
  var _integration = require("../../helpers/integration");
24
20
  var _multiplicity_calc = require("../../helpers/multiplicity_calc");
25
21
  var _calc = require("../../helpers/calc");
26
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
+ 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); }
23
+ 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
24
  /* eslint-disable no-unused-vars, prefer-object-spread, no-mixed-operators,
29
25
  no-unneeded-ternary, arrow-body-style */
30
- var MultiFocus = /*#__PURE__*/function () {
31
- function MultiFocus(props) {
32
- (0, _classCallCheck2.default)(this, MultiFocus);
33
- var W = props.W,
34
- H = props.H,
35
- clickUiTargetAct = props.clickUiTargetAct,
36
- selectUiSweepAct = props.selectUiSweepAct,
37
- scrollUiWheelAct = props.scrollUiWheelAct,
38
- entities = props.entities;
26
+
27
+ class MultiFocus {
28
+ constructor(props) {
29
+ const {
30
+ W,
31
+ H,
32
+ clickUiTargetAct,
33
+ selectUiSweepAct,
34
+ scrollUiWheelAct,
35
+ entities
36
+ } = props;
39
37
  this.entities = entities;
40
38
  this.jcampIdx = 0;
39
+ this.isShowAllCurves = false;
41
40
  this.rootKlass = '.d3Line';
42
41
  this.margin = {
43
42
  t: 5,
@@ -97,867 +96,743 @@ var MultiFocus = /*#__PURE__*/function () {
97
96
  this.isFirefox = typeof InstallTrigger !== 'undefined';
98
97
  this.cyclicvoltaSt = null;
99
98
  }
100
- (0, _createClass2.default)(MultiFocus, [{
101
- key: "getShouldUpdate",
102
- value: function getShouldUpdate(nextEpSt) {
103
- var _this$shouldUpdate = this.shouldUpdate,
104
- prevXt = _this$shouldUpdate.prevXt,
105
- prevYt = _this$shouldUpdate.prevYt,
106
- prevEpSt = _this$shouldUpdate.prevEpSt,
107
- prevLySt = _this$shouldUpdate.prevLySt,
108
- prevTePt = _this$shouldUpdate.prevTePt,
109
- prevDtPk = _this$shouldUpdate.prevDtPk,
110
- prevSfPk = _this$shouldUpdate.prevSfPk,
111
- prevData = _this$shouldUpdate.prevData;
112
- var _TfRescale = (0, _compass.TfRescale)(this),
113
- xt = _TfRescale.xt,
114
- yt = _TfRescale.yt;
115
- var sameXY = xt(1.1) === prevXt && prevYt === yt(1.1);
116
- var sameEpSt = prevEpSt === nextEpSt;
117
- var sameLySt = prevLySt === this.layout;
118
- var sameTePt = prevTePt === this.tTrEndPts.length;
119
- var sameDtPk = prevDtPk === this.dataPks.length;
120
- var sameSfPk = prevSfPk === this.tSfPeaks.length;
121
- var sameData = prevData === this.data.length;
122
- this.shouldUpdate = Object.assign({}, this.shouldUpdate, {
123
- sameXY: sameXY,
124
- sameEpSt: sameEpSt,
125
- sameLySt: sameLySt,
126
- // eslint-disable-line
127
- sameTePt: sameTePt,
128
- sameDtPk: sameDtPk,
129
- sameSfPk: sameSfPk,
130
- sameData: sameData // eslint-disable-line
131
- });
132
- }
133
- }, {
134
- key: "resetShouldUpdate",
135
- value: function resetShouldUpdate(prevEpSt) {
136
- var _TfRescale2 = (0, _compass.TfRescale)(this),
137
- xt = _TfRescale2.xt,
138
- yt = _TfRescale2.yt;
139
- var prevXt = xt(1.1);
140
- var prevYt = yt(1.1);
141
- var prevTePt = this.tTrEndPts.length;
142
- var prevDtPk = this.dataPks.length;
143
- var prevSfPk = this.tSfPeaks.length;
144
- var prevData = this.data.length;
145
- var prevLySt = this.layout;
146
- this.shouldUpdate = Object.assign({}, this.shouldUpdate, {
147
- prevXt: prevXt,
148
- prevYt: prevYt,
149
- prevEpSt: prevEpSt,
150
- prevLySt: prevLySt,
151
- // eslint-disable-line
152
- prevTePt: prevTePt,
153
- prevDtPk: prevDtPk,
154
- prevSfPk: prevSfPk,
155
- prevData: prevData // eslint-disable-line
156
- });
157
- }
158
- }, {
159
- key: "setTip",
160
- value: function setTip() {
161
- this.tip = (0, _init.InitTip)();
162
- this.root.call(this.tip);
163
- }
164
- }, {
165
- key: "setDataParams",
166
- value: function setDataParams(peaks, tTrEndPts, tSfPeaks, layout, cyclicvoltaSt) {
167
- var _this = this;
168
- var jcampIdx = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
169
- this.jcampIdx = jcampIdx;
170
- this.data = [];
171
- this.otherLineData = [];
172
- var filterSubLayoutValue = null;
173
- this.entities.forEach(function (entry, idx) {
174
- var topic = entry.topic,
175
- feature = entry.feature,
176
- color = entry.color;
177
- var currData = (0, _chem.convertTopic)(topic, layout, feature, 0);
178
- if (idx === _this.jcampIdx) {
179
- _this.data = (0, _toConsumableArray2.default)(currData);
180
- _this.pathColor = color;
181
- filterSubLayoutValue = feature.xUnit;
182
- } else {
183
- _this.otherLineData.push({
184
- data: currData,
185
- color: color,
186
- filterSublayout: feature.xUnit
187
- });
188
- }
189
- });
190
- if (_format.default.isSECLayout(layout)) {
191
- this.otherLineData = this.otherLineData.filter(function (data) {
192
- return data.filterSublayout === filterSubLayoutValue;
193
- });
194
- }
195
- this.dataPks = (0, _toConsumableArray2.default)(peaks);
196
- this.tTrEndPts = tTrEndPts;
197
- this.tSfPeaks = tSfPeaks;
198
- this.layout = layout;
199
- this.cyclicvoltaSt = cyclicvoltaSt;
200
- }
201
- }, {
202
- key: "updatePathCall",
203
- value: function updatePathCall(xt, yt) {
204
- this.pathCall = d3.line().x(function (d) {
205
- return xt(d.x);
206
- }).y(function (d) {
207
- return yt(d.y);
208
- });
209
- }
210
- }, {
211
- key: "setConfig",
212
- value: function setConfig(sweepExtentSt) {
213
- // Domain Calculate
214
- var _ref = sweepExtentSt || {
215
- xExtent: false,
216
- yExtent: false
217
- },
218
- xExtent = _ref.xExtent,
219
- yExtent = _ref.yExtent;
220
- if (!xExtent || !yExtent) {
221
- var allData = (0, _toConsumableArray2.default)(this.data);
222
- if (this.otherLineData) {
223
- this.otherLineData.forEach(function (lineData) {
224
- allData = [].concat((0, _toConsumableArray2.default)(allData), (0, _toConsumableArray2.default)(lineData.data));
225
- });
226
- }
227
- var xes = d3.extent(allData, function (d) {
228
- return d.x;
229
- }).sort(function (a, b) {
230
- return a - b;
231
- });
232
- xExtent = {
233
- xL: xes[0],
234
- xU: xes[1]
235
- };
236
- var btm = d3.min(allData, function (d) {
237
- return d.y;
238
- });
239
- var top = d3.max(allData, function (d) {
240
- return d.y;
241
- });
242
- var height = top - btm;
243
- yExtent = {
244
- yL: btm - this.factor * height,
245
- yU: top + this.factor * height
246
- };
247
- }
248
- this.scales.x.domain([xExtent.xL, xExtent.xU]);
249
- this.scales.y.domain([yExtent.yL, yExtent.yU]);
99
+ getShouldUpdate(nextEpSt) {
100
+ const {
101
+ prevXt,
102
+ prevYt,
103
+ prevEpSt,
104
+ prevLySt,
105
+ prevTePt,
106
+ prevDtPk,
107
+ prevSfPk,
108
+ prevData
109
+ } = this.shouldUpdate;
110
+ const {
111
+ xt,
112
+ yt
113
+ } = (0, _compass.TfRescale)(this);
114
+ const sameXY = xt(1.1) === prevXt && prevYt === yt(1.1);
115
+ const sameEpSt = prevEpSt === nextEpSt;
116
+ const sameLySt = prevLySt === this.layout;
117
+ const sameTePt = prevTePt === this.tTrEndPts.length;
118
+ const sameDtPk = prevDtPk === this.dataPks.length;
119
+ const sameSfPk = JSON.stringify(prevSfPk) === JSON.stringify(this.tSfPeaks);
120
+ const sameData = prevData === this.data.length;
121
+ this.shouldUpdate = Object.assign({}, this.shouldUpdate, {
122
+ sameXY,
123
+ sameEpSt,
124
+ sameLySt,
125
+ // eslint-disable-line
126
+ sameTePt,
127
+ sameDtPk,
128
+ sameSfPk,
129
+ sameData // eslint-disable-line
130
+ });
131
+ }
250
132
 
251
- // rescale for zoom
252
- var _TfRescale3 = (0, _compass.TfRescale)(this),
253
- xt = _TfRescale3.xt,
254
- yt = _TfRescale3.yt;
133
+ resetShouldUpdate(prevEpSt) {
134
+ const {
135
+ xt,
136
+ yt
137
+ } = (0, _compass.TfRescale)(this);
138
+ const prevXt = xt(1.1);
139
+ const prevYt = yt(1.1);
140
+ const prevTePt = this.tTrEndPts.length;
141
+ const prevDtPk = this.dataPks.length;
142
+ const prevSfPk = this.tSfPeaks;
143
+ const prevData = this.data.length;
144
+ const prevLySt = this.layout;
145
+ this.shouldUpdate = Object.assign({}, this.shouldUpdate, {
146
+ prevXt,
147
+ prevYt,
148
+ prevEpSt,
149
+ prevLySt,
150
+ // eslint-disable-line
151
+ prevTePt,
152
+ prevDtPk,
153
+ prevSfPk,
154
+ prevData // eslint-disable-line
155
+ });
156
+ }
255
157
 
256
- // Axis Call
257
- this.axisCall.x.scale(xt);
258
- this.axisCall.y.scale(yt);
259
- this.currentExtent = {
260
- xExtent: xExtent,
261
- yExtent: yExtent
262
- };
263
- }
264
- }, {
265
- key: "drawLine",
266
- value: function drawLine() {
267
- var _TfRescale4 = (0, _compass.TfRescale)(this),
268
- xt = _TfRescale4.xt,
269
- yt = _TfRescale4.yt;
270
- this.updatePathCall(xt, yt);
271
- this.path.attr('d', this.pathCall(this.data));
272
- this.path.style('stroke', this.pathColor);
273
- }
274
- }, {
275
- key: "drawOtherLines",
276
- value: function drawOtherLines(layout) {
277
- var _this2 = this;
278
- d3.selectAll('.line-clip-compare').remove();
279
- if (!this.otherLineData) return null;
280
- this.otherLineData.forEach(function (entry, idx) {
281
- var data = entry.data,
282
- color = entry.color;
283
- var pathColor = color ? color : _format.default.mutiEntitiesColors(idx);
284
- var path = (0, _mount.MountComparePath)(_this2, pathColor, idx, 0.4);
285
- path.attr('d', _this2.pathCall(data));
286
- });
287
- return null;
288
- }
289
- }, {
290
- key: "drawGrid",
291
- value: function drawGrid() {
292
- var sameXY = this.shouldUpdate.sameXY;
293
- if (sameXY) return;
294
- 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');
295
- 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');
296
- }
297
- }, {
298
- key: "onClickTarget",
299
- value: function onClickTarget(data) {
300
- d3.event.stopPropagation();
301
- d3.event.preventDefault();
302
- var onPeak = true;
303
- if (this.layout === _list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY) {
304
- var spectraList = this.cyclicvoltaSt.spectraList;
305
- var spectra = spectraList[this.jcampIdx];
306
- var voltammetryPeakIdx = spectra.selectedIdx;
307
- this.clickUiTargetAct(data, onPeak, voltammetryPeakIdx, this.jcampIdx);
158
+ setTip() {
159
+ this.tip = (0, _init.InitTip)();
160
+ this.root.call(this.tip);
161
+ }
162
+ setDataParams(peaks, tTrEndPts, tSfPeaks, layout, cyclicvoltaSt) {
163
+ let jcampIdx = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
164
+ this.data = [];
165
+ this.otherLineData = [];
166
+ let filterSubLayoutValue = null;
167
+ this.entities.forEach((entry, idx) => {
168
+ const {
169
+ topic,
170
+ feature,
171
+ color
172
+ } = entry;
173
+ const currData = (0, _chem.convertTopic)(topic, layout, feature, 0);
174
+ if (idx === jcampIdx) {
175
+ this.data = [...currData];
176
+ this.pathColor = color;
177
+ filterSubLayoutValue = feature.xUnit;
308
178
  } else {
309
- this.clickUiTargetAct(data, onPeak, false, this.jcampIdx);
179
+ this.otherLineData.push({
180
+ data: currData,
181
+ color,
182
+ filterSublayout: feature.xUnit
183
+ });
310
184
  }
185
+ });
186
+ if (_format.default.isSECLayout(layout)) {
187
+ this.otherLineData = this.otherLineData.filter(data => {
188
+ return data.filterSublayout === filterSubLayoutValue;
189
+ });
311
190
  }
312
- }, {
313
- key: "onClickPecker",
314
- value: function onClickPecker(data) {
315
- d3.event.stopPropagation();
316
- d3.event.preventDefault();
317
- var onPecker = true;
318
- var spectraList = this.cyclicvoltaSt.spectraList;
319
- var spectra = spectraList[this.jcampIdx];
320
- var voltammetryPeakIdx = spectra.selectedIdx;
321
- this.clickUiTargetAct(data, false, voltammetryPeakIdx, this.jcampIdx, onPecker);
191
+ if (this.jcampIdx === jcampIdx) {
192
+ this.dataPks = [...peaks];
193
+ } else {
194
+ this.dataPks = peaks;
322
195
  }
323
- }, {
324
- key: "mergedPeaks",
325
- value: function mergedPeaks(editPeakSt) {
326
- if (!editPeakSt) return this.dataPks;
327
- var spectraList = this.cyclicvoltaSt.spectraList;
328
- var spectra = spectraList[this.jcampIdx];
329
- if (spectra) {
330
- this.dataPks = [];
331
- this.dataPks = (0, _converter.PksEdit)(this.dataPks, editPeakSt, spectra.list);
332
- } else {
333
- var newEditPeaks = Object.assign({}, editPeakSt, {
334
- selectedIdx: this.jcampIdx
196
+ this.tTrEndPts = tTrEndPts;
197
+ this.tSfPeaks = tSfPeaks;
198
+ this.layout = layout;
199
+ this.cyclicvoltaSt = cyclicvoltaSt;
200
+ this.jcampIdx = jcampIdx;
201
+ }
202
+ updatePathCall(xt, yt) {
203
+ this.pathCall = d3.line().x(d => xt(d.x)).y(d => yt(d.y));
204
+ }
205
+ setConfig(sweepExtentSt) {
206
+ // Domain Calculate
207
+ let {
208
+ xExtent,
209
+ yExtent
210
+ } = sweepExtentSt || {
211
+ xExtent: false,
212
+ yExtent: false
213
+ };
214
+ if (!xExtent || !yExtent) {
215
+ let allData = [...this.data];
216
+ if (this.otherLineData) {
217
+ this.otherLineData.forEach(lineData => {
218
+ allData = [...allData, ...lineData.data];
335
219
  });
336
- this.dataPks = (0, _converter.PksEdit)(this.dataPks, newEditPeaks, []);
337
220
  }
338
- return this.dataPks;
221
+ const xes = d3.extent(allData, d => d.x).sort((a, b) => a - b);
222
+ xExtent = {
223
+ xL: xes[0],
224
+ xU: xes[1]
225
+ };
226
+ const btm = d3.min(allData, d => d.y);
227
+ const top = d3.max(allData, d => d.y);
228
+ const height = top - btm;
229
+ yExtent = {
230
+ yL: btm - this.factor * height,
231
+ yU: top + this.factor * height
232
+ };
339
233
  }
340
- }, {
341
- key: "setDataPecker",
342
- value: function setDataPecker() {
343
- var spectraList = this.cyclicvoltaSt.spectraList;
344
- var spectra = spectraList[this.jcampIdx];
345
- if (spectra) {
346
- this.dataPeckers = (0, _converter.PeckersEdit)(spectra.list);
234
+ this.scales.x.domain([xExtent.xL, xExtent.xU]);
235
+ this.scales.y.domain([yExtent.yL, yExtent.yU]);
236
+
237
+ // rescale for zoom
238
+ const {
239
+ xt,
240
+ yt
241
+ } = (0, _compass.TfRescale)(this);
242
+
243
+ // Axis Call
244
+ this.axisCall.x.scale(xt);
245
+ this.axisCall.y.scale(yt);
246
+ this.currentExtent = {
247
+ xExtent,
248
+ yExtent
249
+ };
250
+ }
251
+ drawLine() {
252
+ const {
253
+ xt,
254
+ yt
255
+ } = (0, _compass.TfRescale)(this);
256
+ this.updatePathCall(xt, yt);
257
+ this.path.attr('d', this.pathCall(this.data));
258
+ this.path.style('stroke', this.pathColor);
259
+ if (this.layout === _list_layout.LIST_LAYOUT.AIF) {
260
+ this.path.attr('marker-mid', 'url(#arrow-left)');
261
+ }
262
+ }
263
+ drawOtherLines(layout) {
264
+ d3.selectAll('.line-clip-compare').remove();
265
+ if (!this.otherLineData) return null;
266
+ this.otherLineData.forEach((entry, idx) => {
267
+ const {
268
+ data,
269
+ color
270
+ } = entry;
271
+ const pathColor = color ? color : _format.default.mutiEntitiesColors(idx);
272
+ const path = (0, _mount.MountComparePath)(this, pathColor, idx, 0.4);
273
+ path.attr('d', this.pathCall(data));
274
+ if (this.layout === _list_layout.LIST_LAYOUT.AIF && this.isShowAllCurves === true) {
275
+ path.attr('marker-mid', 'url(#arrow-left)');
347
276
  }
348
- return this.dataPeckers;
277
+ });
278
+ return null;
279
+ }
280
+ drawGrid() {
281
+ const {
282
+ sameXY
283
+ } = this.shouldUpdate;
284
+ if (sameXY) return;
285
+ 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');
286
+ 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');
287
+ }
288
+ onClickTarget(data) {
289
+ d3.event.stopPropagation();
290
+ d3.event.preventDefault();
291
+ const onPeak = true;
292
+ if (this.layout === _list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY) {
293
+ const {
294
+ spectraList
295
+ } = this.cyclicvoltaSt;
296
+ const spectra = spectraList[this.jcampIdx];
297
+ const voltammetryPeakIdx = spectra.selectedIdx;
298
+ this.clickUiTargetAct(data, onPeak, voltammetryPeakIdx, this.jcampIdx);
299
+ } else {
300
+ this.clickUiTargetAct(data, onPeak, false, this.jcampIdx);
349
301
  }
350
- }, {
351
- key: "drawAUC",
352
- value: function drawAUC(stack) {
353
- var _this3 = this;
354
- var _TfRescale5 = (0, _compass.TfRescale)(this),
355
- xt = _TfRescale5.xt,
356
- yt = _TfRescale5.yt;
357
- var auc = this.tags.aucPath.selectAll('path').data(stack);
358
- auc.exit().attr('class', 'exit').remove();
359
- var integCurve = function integCurve(border) {
360
- var xL = border.xL,
361
- xU = border.xU;
362
- var ps = _this3.data.filter(function (d) {
363
- return d.x > xL && d.x < xU;
364
- });
365
- if (!ps[0]) return null;
366
- var point1 = ps[0];
367
- var point2 = ps[ps.length - 1];
368
- var slope = (0, _calc.calcSlope)(point1.x, point1.y, point2.x, point2.y);
369
- var lastDY = point1.y;
370
- return d3.area().x(function (d) {
371
- return xt(d.x);
372
- }).y0(function (d, index) {
373
- if (index > 0) {
374
- var lastD = ps[index - 1];
375
- var y = slope * (d.x - lastD.x) + lastDY;
376
- lastDY = y;
377
- return yt(y);
378
- }
379
- return yt(0);
380
- }).y1(function (d) {
381
- return yt(d.y);
382
- })(ps);
383
- };
384
- 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) {
385
- return integCurve(d);
386
- }).attr('id', function (d) {
387
- return "auc".concat((0, _focus.itgIdTag)(d));
388
- }).on('mouseover', function (d) {
389
- d3.select("#auc".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'blue');
390
- d3.select("#auc".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'blue');
391
- d3.select("#auc".concat((0, _focus.itgIdTag)(d))).style('fill', 'blue');
392
- }).on('mouseout', function (d) {
393
- d3.select("#auc".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'none');
394
- d3.select("#auc".concat((0, _focus.itgIdTag)(d))).style('fill', 'red');
395
- d3.select("#auc".concat((0, _focus.itgIdTag)(d))).style('fill-opacity', 0.2);
396
- }).on('click', function (d) {
397
- return _this3.onClickTarget(d);
302
+ }
303
+ onClickPecker(data) {
304
+ d3.event.stopPropagation();
305
+ d3.event.preventDefault();
306
+ const onPecker = true;
307
+ const {
308
+ spectraList
309
+ } = this.cyclicvoltaSt;
310
+ const spectra = spectraList[this.jcampIdx];
311
+ const voltammetryPeakIdx = spectra.selectedIdx;
312
+ this.clickUiTargetAct(data, false, voltammetryPeakIdx, this.jcampIdx, onPecker);
313
+ }
314
+ mergedPeaks(editPeakSt) {
315
+ if (!editPeakSt) return this.dataPks;
316
+ const {
317
+ spectraList
318
+ } = this.cyclicvoltaSt;
319
+ const spectra = spectraList[this.jcampIdx];
320
+ if (spectra) {
321
+ this.dataPks = [];
322
+ this.dataPks = (0, _converter.PksEdit)(this.dataPks, editPeakSt, spectra.list);
323
+ } else {
324
+ const newEditPeaks = Object.assign({}, editPeakSt, {
325
+ selectedIdx: this.jcampIdx
398
326
  });
327
+ this.dataPks = (0, _converter.PksEdit)(this.dataPks, newEditPeaks, []);
399
328
  }
400
- }, {
401
- key: "drawPeaks",
402
- value: function drawPeaks(editPeakSt) {
403
- var _this4 = this;
404
- var _this$shouldUpdate2 = this.shouldUpdate,
405
- sameXY = _this$shouldUpdate2.sameXY,
406
- sameEpSt = _this$shouldUpdate2.sameEpSt,
407
- sameDtPk = _this$shouldUpdate2.sameDtPk,
408
- sameSfPk = _this$shouldUpdate2.sameSfPk;
409
- if (!_format.default.isCyclicVoltaLayout(this.layout) && sameXY && sameEpSt && sameDtPk && sameSfPk) return;
410
-
411
- // rescale for zoom
412
- var _TfRescale6 = (0, _compass.TfRescale)(this),
413
- xt = _TfRescale6.xt,
414
- yt = _TfRescale6.yt;
415
- var dPks = this.mergedPeaks(editPeakSt);
416
- var mpp = this.tags.pPath.selectAll('path').data(dPks);
417
- mpp.exit().attr('class', 'exit').remove();
418
- var linePath = [{
419
- x: -0.5,
420
- y: 10
421
- }, {
422
- x: -0.5,
423
- y: -20
424
- }, {
425
- x: 0.5,
426
- y: -20
427
- }, {
428
- x: 0.5,
429
- y: 10
430
- }];
431
- var lineSymbol = d3.line().x(function (d) {
432
- return d.x;
433
- }).y(function (d) {
434
- return d.y;
435
- })(linePath);
436
- 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', function (d) {
437
- return "mpp".concat(Math.round(1000 * d.x));
438
- }).attr('transform', function (d) {
439
- return "translate(".concat(xt(d.x), ", ").concat(yt(d.y), ")");
440
- }).on('mouseover', function (d, i, n) {
441
- d3.select("#mpp".concat(Math.round(1000 * d.x))).attr('stroke-opacity', '1.0');
442
- d3.select("#bpt".concat(Math.round(1000 * d.x))).style('fill', 'blue');
443
- var tipParams = {
444
- d: d,
445
- layout: _this4.layout
446
- };
447
- _this4.tip.show(tipParams, n[i]);
448
- }).on('mouseout', function (d, i, n) {
449
- d3.select("#mpp".concat(Math.round(1000 * d.x))).attr('stroke-opacity', '0.0');
450
- d3.select("#bpt".concat(Math.round(1000 * d.x))).style('fill', 'red');
451
- var tipParams = {
452
- d: d,
453
- layout: _this4.layout
454
- };
455
- _this4.tip.hide(tipParams, n[i]);
456
- }).on('click', function (d) {
457
- return _this4.onClickTarget(d);
458
- });
459
- var ignoreRef = _format.default.isHplcUvVisLayout(this.layout);
460
- if (ignoreRef) {
461
- var bpTxt = this.tags.bpTxt.selectAll('text').data(dPks);
462
- bpTxt.exit().attr('class', 'exit').remove();
463
- 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) {
464
- return "mpp".concat(Math.round(1000 * d.x));
465
- }).text(function (d) {
466
- return d.x.toFixed(2);
467
- }).attr('transform', function (d) {
468
- return "translate(".concat(xt(d.x), ", ").concat(yt(d.y) - 25, ")");
469
- }).on('click', function (d) {
470
- return _this4.onClickTarget(d);
471
- });
472
- }
329
+ return this.dataPks;
330
+ }
331
+ setDataPecker() {
332
+ const {
333
+ spectraList
334
+ } = this.cyclicvoltaSt;
335
+ const spectra = spectraList[this.jcampIdx];
336
+ if (spectra) {
337
+ this.dataPeckers = (0, _converter.PeckersEdit)(spectra.list);
473
338
  }
474
- }, {
475
- key: "drawPeckers",
476
- value: function drawPeckers() {
477
- var _this5 = this;
478
- var _this$shouldUpdate3 = this.shouldUpdate,
479
- sameXY = _this$shouldUpdate3.sameXY,
480
- sameEpSt = _this$shouldUpdate3.sameEpSt,
481
- sameDtPk = _this$shouldUpdate3.sameDtPk,
482
- sameSfPk = _this$shouldUpdate3.sameSfPk;
483
- if (!_format.default.isCyclicVoltaLayout(this.layout) && sameXY && sameEpSt && sameDtPk && sameSfPk) return;
339
+ return this.dataPeckers;
340
+ }
341
+ drawAUC(stack) {
342
+ const {
343
+ xt,
344
+ yt
345
+ } = (0, _compass.TfRescale)(this);
346
+ const auc = this.tags.aucPath.selectAll('path').data(stack);
347
+ auc.exit().attr('class', 'exit').remove();
348
+ const integCurve = border => {
349
+ const {
350
+ xL,
351
+ xU
352
+ } = border;
353
+ const ps = this.data.filter(d => d.x > xL && d.x < xU);
354
+ if (!ps[0]) return null;
355
+ const point1 = ps[0];
356
+ const point2 = ps[ps.length - 1];
357
+ const slope = (0, _calc.calcSlope)(point1.x, point1.y, point2.x, point2.y);
358
+ let lastDY = point1.y;
359
+ return d3.area().x(d => xt(d.x)).y0((d, index) => {
360
+ if (index > 0) {
361
+ const lastD = ps[index - 1];
362
+ const y = slope * (d.x - lastD.x) + lastDY;
363
+ lastDY = y;
364
+ return yt(y);
365
+ }
366
+ return yt(0);
367
+ }).y1(d => yt(d.y))(ps);
368
+ };
369
+ 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 => {
370
+ d3.select(`#auc${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'blue');
371
+ d3.select(`#auc${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'blue');
372
+ d3.select(`#auc${(0, _focus.itgIdTag)(d)}`).style('fill', 'blue');
373
+ }).on('mouseout', d => {
374
+ d3.select(`#auc${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'none');
375
+ d3.select(`#auc${(0, _focus.itgIdTag)(d)}`).style('fill', 'red');
376
+ d3.select(`#auc${(0, _focus.itgIdTag)(d)}`).style('fill-opacity', 0.2);
377
+ }).on('click', d => this.onClickTarget(d));
378
+ }
379
+ drawPeaks(editPeakSt) {
380
+ const {
381
+ sameXY,
382
+ sameEpSt,
383
+ sameDtPk,
384
+ sameSfPk
385
+ } = this.shouldUpdate;
386
+ if (!_format.default.isCyclicVoltaLayout(this.layout) && sameXY && sameEpSt && sameDtPk && sameSfPk) return;
484
387
 
485
- // rescale for zoom
486
- var _TfRescale7 = (0, _compass.TfRescale)(this),
487
- xt = _TfRescale7.xt,
488
- yt = _TfRescale7.yt;
489
- var dPks = this.setDataPecker();
490
- var mpp = this.tags.peckerPath.selectAll('path').data(dPks);
491
- mpp.exit().attr('class', 'exit').remove();
492
- var linePath = [{
493
- x: -0.5,
494
- y: 10
495
- }, {
496
- x: -0.5,
497
- y: -20
498
- }, {
499
- x: 0.5,
500
- y: -20
501
- }, {
502
- x: 0.5,
503
- y: 10
504
- }];
505
- var lineSymbol = d3.line().x(function (d) {
506
- return d.x;
507
- }).y(function (d) {
508
- return d.y;
509
- })(linePath);
510
- mpp.enter().append('path').attr('d', lineSymbol).attr('class', 'enter-peak').attr('fill', '#228B22').attr('stroke', 'pink').attr('stroke-width', 3).attr('stroke-opacity', 0.0).merge(mpp).attr('id', function (d) {
511
- return "mpp".concat(Math.round(1000 * d.x));
512
- }).attr('transform', function (d) {
513
- return "translate(".concat(xt(d.x), ", ").concat(yt(d.y), ")");
514
- }).on('mouseover', function (d, i, n) {
515
- d3.select("#mpp".concat(Math.round(1000 * d.x))).attr('stroke-opacity', '1.0');
516
- d3.select("#bpt".concat(Math.round(1000 * d.x))).style('fill', 'blue');
517
- var tipParams = {
518
- d: d,
519
- layout: _this5.layout
520
- };
521
- _this5.tip.show(tipParams, n[i]);
522
- }).on('mouseout', function (d, i, n) {
523
- d3.select("#mpp".concat(Math.round(1000 * d.x))).attr('stroke-opacity', '0.0');
524
- d3.select("#bpt".concat(Math.round(1000 * d.x))).style('fill', '#228B22');
525
- var tipParams = {
526
- d: d,
527
- layout: _this5.layout
528
- };
529
- _this5.tip.hide(tipParams, n[i]);
530
- }).on('click', function (d) {
531
- return _this5.onClickPecker(d);
532
- });
388
+ // rescale for zoom
389
+ const {
390
+ xt,
391
+ yt
392
+ } = (0, _compass.TfRescale)(this);
393
+ const dPks = this.mergedPeaks(editPeakSt);
394
+ const mpp = this.tags.pPath.selectAll('path').data(dPks);
395
+ mpp.exit().attr('class', 'exit').remove();
396
+ const linePath = [{
397
+ x: -0.5,
398
+ y: 10
399
+ }, {
400
+ x: -0.5,
401
+ y: -20
402
+ }, {
403
+ x: 0.5,
404
+ y: -20
405
+ }, {
406
+ x: 0.5,
407
+ y: 10
408
+ }];
409
+ const lineSymbol = d3.line().x(d => d.x).y(d => d.y)(linePath);
410
+ 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) => {
411
+ d3.select(`#mpp${Math.round(1000 * d.x)}`).attr('stroke-opacity', '1.0');
412
+ d3.select(`#bpt${Math.round(1000 * d.x)}`).style('fill', 'blue');
413
+ const tipParams = {
414
+ d,
415
+ layout: this.layout
416
+ };
417
+ this.tip.show(tipParams, n[i]);
418
+ }).on('mouseout', (d, i, n) => {
419
+ d3.select(`#mpp${Math.round(1000 * d.x)}`).attr('stroke-opacity', '0.0');
420
+ d3.select(`#bpt${Math.round(1000 * d.x)}`).style('fill', 'red');
421
+ const tipParams = {
422
+ d,
423
+ layout: this.layout
424
+ };
425
+ this.tip.hide(tipParams, n[i]);
426
+ }).on('click', d => this.onClickTarget(d));
427
+ const ignoreRef = _format.default.isHplcUvVisLayout(this.layout);
428
+ if (ignoreRef) {
429
+ const bpTxt = this.tags.bpTxt.selectAll('text').data(dPks);
430
+ bpTxt.exit().attr('class', 'exit').remove();
431
+ 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));
533
432
  }
534
- }, {
535
- key: "drawInteg",
536
- value: function drawInteg(integationSt) {
537
- var _this6 = this;
538
- var _this$shouldUpdate4 = this.shouldUpdate,
539
- sameXY = _this$shouldUpdate4.sameXY,
540
- sameLySt = _this$shouldUpdate4.sameLySt,
541
- sameItSt = _this$shouldUpdate4.sameItSt,
542
- sameData = _this$shouldUpdate4.sameData;
543
- if (sameXY && sameLySt && sameItSt && sameData) return;
544
- var integrations = integationSt.integrations;
545
- var selectedIntegration = integrations[this.jcampIdx];
546
- if (selectedIntegration === false || selectedIntegration === undefined) {
547
- var _itgs = [];
548
- var _igbp = this.tags.igbPath.selectAll('path').data(_itgs);
549
- _igbp.exit().attr('class', 'exit').remove();
550
- var _igcp = this.tags.igcPath.selectAll('path').data(_itgs);
551
- _igcp.exit().attr('class', 'exit').remove();
552
- var _igtp = this.tags.igtPath.selectAll('text').data(_itgs);
553
- _igtp.exit().attr('class', 'exit').remove();
554
- return;
555
- }
556
- var stack = selectedIntegration.stack,
557
- refArea = selectedIntegration.refArea,
558
- refFactor = selectedIntegration.refFactor,
559
- shift = selectedIntegration.shift;
560
- var isDisable = _cfg.default.btnCmdIntg(this.layout);
561
- var ignoreRef = _format.default.isHplcUvVisLayout(this.layout);
562
- var itgs = isDisable ? [] : stack;
563
- var igbp = this.tags.igbPath.selectAll('path').data(itgs);
433
+ }
434
+ drawPeckers() {
435
+ const {
436
+ sameXY,
437
+ sameEpSt,
438
+ sameDtPk,
439
+ sameSfPk
440
+ } = this.shouldUpdate;
441
+ if (!_format.default.isCyclicVoltaLayout(this.layout) && sameXY && sameEpSt && sameDtPk && sameSfPk) return;
442
+
443
+ // rescale for zoom
444
+ const {
445
+ xt,
446
+ yt
447
+ } = (0, _compass.TfRescale)(this);
448
+ const dPks = this.setDataPecker();
449
+ const mpp = this.tags.peckerPath.selectAll('path').data(dPks);
450
+ mpp.exit().attr('class', 'exit').remove();
451
+ const linePath = [{
452
+ x: -0.5,
453
+ y: 10
454
+ }, {
455
+ x: -0.5,
456
+ y: -20
457
+ }, {
458
+ x: 0.5,
459
+ y: -20
460
+ }, {
461
+ x: 0.5,
462
+ y: 10
463
+ }];
464
+ const lineSymbol = d3.line().x(d => d.x).y(d => d.y)(linePath);
465
+ mpp.enter().append('path').attr('d', lineSymbol).attr('class', 'enter-peak').attr('fill', '#228B22').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) => {
466
+ d3.select(`#mpp${Math.round(1000 * d.x)}`).attr('stroke-opacity', '1.0');
467
+ d3.select(`#bpt${Math.round(1000 * d.x)}`).style('fill', 'blue');
468
+ const tipParams = {
469
+ d,
470
+ layout: this.layout
471
+ };
472
+ this.tip.show(tipParams, n[i]);
473
+ }).on('mouseout', (d, i, n) => {
474
+ d3.select(`#mpp${Math.round(1000 * d.x)}`).attr('stroke-opacity', '0.0');
475
+ d3.select(`#bpt${Math.round(1000 * d.x)}`).style('fill', '#228B22');
476
+ const tipParams = {
477
+ d,
478
+ layout: this.layout
479
+ };
480
+ this.tip.hide(tipParams, n[i]);
481
+ }).on('click', d => this.onClickPecker(d));
482
+ }
483
+ drawInteg(integationSt) {
484
+ const {
485
+ sameXY,
486
+ sameLySt,
487
+ sameItSt,
488
+ sameData
489
+ } = this.shouldUpdate;
490
+ if (sameXY && sameLySt && sameItSt && sameData) return;
491
+ const {
492
+ integrations
493
+ } = integationSt;
494
+ const selectedIntegration = integrations[this.jcampIdx];
495
+ if (selectedIntegration === false || selectedIntegration === undefined) {
496
+ const itgs = [];
497
+ const igbp = this.tags.igbPath.selectAll('path').data(itgs);
564
498
  igbp.exit().attr('class', 'exit').remove();
565
- var igcp = this.tags.igcPath.selectAll('path').data(itgs);
499
+ const igcp = this.tags.igcPath.selectAll('path').data(itgs);
566
500
  igcp.exit().attr('class', 'exit').remove();
567
- var igtp = this.tags.igtPath.selectAll('text').data(itgs);
501
+ const igtp = this.tags.igtPath.selectAll('text').data(itgs);
568
502
  igtp.exit().attr('class', 'exit').remove();
569
- if (itgs.length === 0 || isDisable) {
570
- // remove drawn area under curve
571
- var auc = this.tags.aucPath.selectAll('path').data(stack);
572
- auc.exit().attr('class', 'exit').remove();
573
- auc.merge(auc);
574
- return;
575
- }
576
- if (ignoreRef) {
577
- this.drawAUC(stack);
578
- } else {
579
- // rescale for zoom
580
- var _TfRescale8 = (0, _compass.TfRescale)(this),
581
- xt = _TfRescale8.xt;
582
- var dh = 50;
583
- var integBar = function integBar(data) {
584
- 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]]);
585
- };
586
- igbp.enter().append('path').attr('class', 'igbp').attr('fill', 'none').attr('stroke', '#228B22').attr('stroke-width', 2).merge(igbp).attr('id', function (d) {
587
- return "igbp".concat((0, _focus.itgIdTag)(d));
588
- }).attr('d', function (d) {
589
- return integBar(d);
590
- }).on('mouseover', function (d) {
591
- d3.select("#igbp".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'blue');
592
- d3.select("#igbc".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'blue');
593
- d3.select("#igtp".concat((0, _focus.itgIdTag)(d))).style('fill', 'blue');
594
- }).on('mouseout', function (d) {
595
- d3.select("#igbp".concat((0, _focus.itgIdTag)(d))).attr('stroke', '#228B22');
596
- d3.select("#igbc".concat((0, _focus.itgIdTag)(d))).attr('stroke', '#228B22');
597
- d3.select("#igtp".concat((0, _focus.itgIdTag)(d))).style('fill', '#228B22');
598
- }).on('click', function (d) {
599
- return _this6.onClickTarget(d);
600
- });
601
- var integCurve = function integCurve(border) {
602
- var xL = border.xL,
603
- xU = border.xU;
604
- var nXL = xL - shift,
605
- nXU = xU - shift;
606
- var ps = _this6.data.filter(function (d) {
607
- return d.x > nXL && d.x < nXU;
608
- });
609
- var kMax = _this6.data[_this6.data.length - 1].k;
610
- if (!ps[0]) return null;
611
- var kRef = ps[0].k;
612
- if (!_this6.reverseXAxis(_this6.layout)) {
613
- return d3.line().x(function (d) {
614
- return xt(d.x);
615
- }).y(function (d) {
616
- return 100 - (kRef - d.k) * 400 / kMax;
617
- })(ps);
618
- }
619
- return d3.line().x(function (d) {
620
- return xt(d.x);
621
- }).y(function (d) {
622
- return 300 - (d.k - kRef) * 400 / kMax;
623
- })(ps);
624
- };
625
- igcp.enter().append('path').attr('class', 'igcp').attr('fill', 'none').attr('stroke', '#228B22').attr('stroke-width', 2).merge(igcp).attr('id', function (d) {
626
- return "igbc".concat((0, _focus.itgIdTag)(d));
627
- }).attr('d', function (d) {
628
- return integCurve(d);
629
- }).on('mouseover', function (d) {
630
- d3.select("#igbp".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'blue');
631
- d3.select("#igbc".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'blue');
632
- d3.select("#igtp".concat((0, _focus.itgIdTag)(d))).style('fill', 'blue');
633
- }).on('mouseout', function (d) {
634
- d3.select("#igbp".concat((0, _focus.itgIdTag)(d))).attr('stroke', '#228B22');
635
- d3.select("#igbc".concat((0, _focus.itgIdTag)(d))).attr('stroke', '#228B22');
636
- d3.select("#igtp".concat((0, _focus.itgIdTag)(d))).style('fill', '#228B22');
637
- }).on('click', function (d) {
638
- return _this6.onClickTarget(d);
639
- });
640
- 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) {
641
- return "igtp".concat((0, _focus.itgIdTag)(d));
642
- }).text(function (d) {
643
- return (0, _integration.calcArea)(d, refArea, refFactor, ignoreRef);
644
- }).attr('transform', function (d) {
645
- return "translate(".concat(xt((d.xL + d.xU) / 2 - shift), ", ").concat(dh - 12, ")");
646
- }).on('mouseover', function (d) {
647
- d3.select("#igbp".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'blue');
648
- d3.select("#igbc".concat((0, _focus.itgIdTag)(d))).attr('stroke', 'blue');
649
- d3.select("#igtp".concat((0, _focus.itgIdTag)(d))).style('fill', 'blue');
650
- }).on('mouseout', function (d) {
651
- d3.select("#igbp".concat((0, _focus.itgIdTag)(d))).attr('stroke', '#228B22');
652
- d3.select("#igbc".concat((0, _focus.itgIdTag)(d))).attr('stroke', '#228B22');
653
- d3.select("#igtp".concat((0, _focus.itgIdTag)(d))).style('fill', '#228B22');
654
- }).on('click', function (d) {
655
- return _this6.onClickTarget(d);
656
- });
657
- }
503
+ return;
658
504
  }
659
- }, {
660
- key: "drawMtply",
661
- value: function drawMtply(mtplySt) {
662
- var _ref3,
663
- _this7 = this;
664
- var _this$shouldUpdate5 = this.shouldUpdate,
665
- sameXY = _this$shouldUpdate5.sameXY,
666
- sameLySt = _this$shouldUpdate5.sameLySt,
667
- sameMySt = _this$shouldUpdate5.sameMySt;
668
- if (sameXY && sameLySt && sameMySt) return;
669
- var multiplicities = mtplySt.multiplicities;
670
- var selectedMulti = multiplicities[this.jcampIdx];
671
- if (selectedMulti === false || selectedMulti === undefined) {
672
- var _ref2;
673
- var _mpys = [];
674
- var _mpyb = this.tags.mpybPath.selectAll('path').data(_mpys);
675
- _mpyb.exit().attr('class', 'exit').remove();
676
- var _mpyt = this.tags.mpyt1Path.selectAll('text').data(_mpys);
677
- _mpyt.exit().attr('class', 'exit').remove();
678
- var _mpyt2 = this.tags.mpyt2Path.selectAll('text').data(_mpys);
679
- _mpyt2.exit().attr('class', 'exit').remove();
680
- var _mPeaks = _mpys.map(function (m) {
681
- var peaks = m.peaks,
682
- xExtent = m.xExtent;
683
- return peaks.map(function (p) {
684
- return Object.assign({}, p, {
685
- xExtent: xExtent
686
- });
687
- });
688
- });
689
- _mPeaks = (_ref2 = []).concat.apply(_ref2, (0, _toConsumableArray2.default)(_mPeaks));
690
- var _mpyp = this.tags.mpypPath.selectAll('path').data(_mPeaks);
691
- _mpyp.exit().attr('class', 'exit').remove();
692
- return;
693
- }
694
- var stack = selectedMulti.stack,
695
- smExtext = selectedMulti.smExtext,
696
- shift = selectedMulti.shift;
697
- var mpys = stack;
698
- var isDisable = _cfg.default.btnCmdMpy(this.layout);
699
- if (mpys === 0 || isDisable) return;
505
+ const {
506
+ stack,
507
+ refArea,
508
+ refFactor,
509
+ shift
510
+ } = selectedIntegration;
511
+ const isDisable = _cfg.default.btnCmdIntg(this.layout);
512
+ const ignoreRef = _format.default.isHplcUvVisLayout(this.layout);
513
+ const itgs = isDisable ? [] : stack;
514
+ const igbp = this.tags.igbPath.selectAll('path').data(itgs);
515
+ igbp.exit().attr('class', 'exit').remove();
516
+ const igcp = this.tags.igcPath.selectAll('path').data(itgs);
517
+ igcp.exit().attr('class', 'exit').remove();
518
+ const igtp = this.tags.igtPath.selectAll('text').data(itgs);
519
+ igtp.exit().attr('class', 'exit').remove();
520
+ if (itgs.length === 0 || isDisable) {
521
+ // remove drawn area under curve
522
+ const auc = this.tags.aucPath.selectAll('path').data(stack);
523
+ auc.exit().attr('class', 'exit').remove();
524
+ auc.merge(auc);
525
+ return;
526
+ }
527
+ if (ignoreRef) {
528
+ this.drawAUC(stack);
529
+ } else {
700
530
  // rescale for zoom
701
- var _TfRescale9 = (0, _compass.TfRescale)(this),
702
- xt = _TfRescale9.xt;
703
- var mpyb = this.tags.mpybPath.selectAll('path').data(mpys);
531
+ const {
532
+ xt
533
+ } = (0, _compass.TfRescale)(this);
534
+ const dh = 50;
535
+ 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]]);
536
+ 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 => {
537
+ d3.select(`#igbp${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'blue');
538
+ d3.select(`#igbc${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'blue');
539
+ d3.select(`#igtp${(0, _focus.itgIdTag)(d)}`).style('fill', 'blue');
540
+ }).on('mouseout', d => {
541
+ d3.select(`#igbp${(0, _focus.itgIdTag)(d)}`).attr('stroke', '#228B22');
542
+ d3.select(`#igbc${(0, _focus.itgIdTag)(d)}`).attr('stroke', '#228B22');
543
+ d3.select(`#igtp${(0, _focus.itgIdTag)(d)}`).style('fill', '#228B22');
544
+ }).on('click', d => this.onClickTarget(d));
545
+ const integCurve = border => {
546
+ const {
547
+ xL,
548
+ xU
549
+ } = border;
550
+ const [nXL, nXU] = [xL - shift, xU - shift];
551
+ const ps = this.data.filter(d => d.x > nXL && d.x < nXU);
552
+ const kMax = this.data[this.data.length - 1].k;
553
+ if (!ps[0]) return null;
554
+ const kRef = ps[0].k;
555
+ if (!this.reverseXAxis(this.layout)) {
556
+ return d3.line().x(d => xt(d.x)).y(d => 100 - (kRef - d.k) * 400 / kMax)(ps);
557
+ }
558
+ return d3.line().x(d => xt(d.x)).y(d => 300 - (d.k - kRef) * 400 / kMax)(ps);
559
+ };
560
+ 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 => {
561
+ d3.select(`#igbp${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'blue');
562
+ d3.select(`#igbc${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'blue');
563
+ d3.select(`#igtp${(0, _focus.itgIdTag)(d)}`).style('fill', 'blue');
564
+ }).on('mouseout', d => {
565
+ d3.select(`#igbp${(0, _focus.itgIdTag)(d)}`).attr('stroke', '#228B22');
566
+ d3.select(`#igbc${(0, _focus.itgIdTag)(d)}`).attr('stroke', '#228B22');
567
+ d3.select(`#igtp${(0, _focus.itgIdTag)(d)}`).style('fill', '#228B22');
568
+ }).on('click', d => this.onClickTarget(d));
569
+ 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 => {
570
+ d3.select(`#igbp${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'blue');
571
+ d3.select(`#igbc${(0, _focus.itgIdTag)(d)}`).attr('stroke', 'blue');
572
+ d3.select(`#igtp${(0, _focus.itgIdTag)(d)}`).style('fill', 'blue');
573
+ }).on('mouseout', d => {
574
+ d3.select(`#igbp${(0, _focus.itgIdTag)(d)}`).attr('stroke', '#228B22');
575
+ d3.select(`#igbc${(0, _focus.itgIdTag)(d)}`).attr('stroke', '#228B22');
576
+ d3.select(`#igtp${(0, _focus.itgIdTag)(d)}`).style('fill', '#228B22');
577
+ }).on('click', d => this.onClickTarget(d));
578
+ }
579
+ }
580
+ drawMtply(mtplySt) {
581
+ const {
582
+ sameXY,
583
+ sameLySt,
584
+ sameMySt
585
+ } = this.shouldUpdate;
586
+ if (sameXY && sameLySt && sameMySt) return;
587
+ const {
588
+ multiplicities
589
+ } = mtplySt;
590
+ const selectedMulti = multiplicities[this.jcampIdx];
591
+ if (selectedMulti === false || selectedMulti === undefined) {
592
+ const mpys = [];
593
+ const mpyb = this.tags.mpybPath.selectAll('path').data(mpys);
704
594
  mpyb.exit().attr('class', 'exit').remove();
705
- var mpyt1 = this.tags.mpyt1Path.selectAll('text').data(mpys);
595
+ const mpyt1 = this.tags.mpyt1Path.selectAll('text').data(mpys);
706
596
  mpyt1.exit().attr('class', 'exit').remove();
707
- var mpyt2 = this.tags.mpyt2Path.selectAll('text').data(mpys);
597
+ const mpyt2 = this.tags.mpyt2Path.selectAll('text').data(mpys);
708
598
  mpyt2.exit().attr('class', 'exit').remove();
709
- var mPeaks = mpys.map(function (m) {
710
- var peaks = m.peaks,
711
- xExtent = m.xExtent;
712
- return peaks.map(function (p) {
713
- return Object.assign({}, p, {
714
- xExtent: xExtent
715
- });
716
- });
599
+ let mPeaks = mpys.map(m => {
600
+ const {
601
+ peaks,
602
+ xExtent
603
+ } = m;
604
+ return peaks.map(p => Object.assign({}, p, {
605
+ xExtent
606
+ }));
717
607
  });
718
- mPeaks = (_ref3 = []).concat.apply(_ref3, (0, _toConsumableArray2.default)(mPeaks));
719
- var mpyp = this.tags.mpypPath.selectAll('path').data(mPeaks);
608
+ mPeaks = [].concat(...mPeaks);
609
+ const mpyp = this.tags.mpypPath.selectAll('path').data(mPeaks);
720
610
  mpyp.exit().attr('class', 'exit').remove();
721
- var height = this.h;
722
- var dh = Math.abs(0.06 * height);
723
- var mpyBar = function mpyBar(data) {
724
- return 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]]);
725
- };
726
- var mpyColor = function mpyColor(d) {
727
- var _d$xExtent = d.xExtent,
728
- xL = _d$xExtent.xL,
729
- xU = _d$xExtent.xU;
730
- return smExtext.xL === xL && smExtext.xU === xU ? 'purple' : '#DA70D6';
731
- };
732
- mpyb.enter().append('path').attr('class', 'mpyb').attr('fill', 'none').attr('stroke-width', 2).merge(mpyb).attr('stroke', function (d) {
733
- return mpyColor(d);
734
- }).attr('id', function (d) {
735
- return "mpyb".concat((0, _focus.mpyIdTag)(d));
736
- }).attr('d', function (d) {
737
- return mpyBar(d);
738
- }).on('mouseover', function (d) {
739
- d3.selectAll("#mpyb".concat((0, _focus.mpyIdTag)(d))).attr('stroke', 'blue');
740
- d3.selectAll("#mpyt1".concat((0, _focus.mpyIdTag)(d))).style('fill', 'blue');
741
- d3.selectAll("#mpyt2".concat((0, _focus.mpyIdTag)(d))).style('fill', 'blue');
742
- d3.selectAll("#mpyp".concat((0, _focus.mpyIdTag)(d))).attr('stroke', 'blue');
743
- }).on('mouseout', function (d) {
744
- var dColor = mpyColor(d);
745
- d3.selectAll("#mpyb".concat((0, _focus.mpyIdTag)(d))).attr('stroke', dColor);
746
- d3.selectAll("#mpyt1".concat((0, _focus.mpyIdTag)(d))).style('fill', dColor);
747
- d3.selectAll("#mpyt2".concat((0, _focus.mpyIdTag)(d))).style('fill', dColor);
748
- d3.selectAll("#mpyp".concat((0, _focus.mpyIdTag)(d))).attr('stroke', dColor);
749
- }).on('click', function (d) {
750
- return _this7.onClickTarget(d);
751
- });
752
- 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) {
753
- return mpyColor(d);
754
- }).attr('id', function (d) {
755
- return "mpyt1".concat((0, _focus.mpyIdTag)(d));
756
- }).text(function (d) {
757
- return "".concat((0, _multiplicity_calc.calcMpyCenter)(d.peaks, shift, d.mpyType).toFixed(3));
758
- }).attr('transform', function (d) {
759
- return "translate(".concat(xt((d.xExtent.xL + d.xExtent.xU) / 2 - shift), ", ").concat(height - dh + 12, ")");
760
- }).on('mouseover', function (d) {
761
- d3.selectAll("#mpyb".concat((0, _focus.mpyIdTag)(d))).attr('stroke', 'blue');
762
- d3.selectAll("#mpyt1".concat((0, _focus.mpyIdTag)(d))).style('fill', 'blue');
763
- d3.selectAll("#mpyt2".concat((0, _focus.mpyIdTag)(d))).style('fill', 'blue');
764
- d3.selectAll("#mpyp".concat((0, _focus.mpyIdTag)(d))).attr('stroke', 'blue');
765
- }).on('mouseout', function (d) {
766
- var dColor = mpyColor(d);
767
- d3.selectAll("#mpyb".concat((0, _focus.mpyIdTag)(d))).attr('stroke', dColor);
768
- d3.selectAll("#mpyt1".concat((0, _focus.mpyIdTag)(d))).style('fill', dColor);
769
- d3.selectAll("#mpyt2".concat((0, _focus.mpyIdTag)(d))).style('fill', dColor);
770
- d3.selectAll("#mpyp".concat((0, _focus.mpyIdTag)(d))).attr('stroke', dColor);
771
- }).on('click', function (d) {
772
- return _this7.onClickTarget(d);
773
- });
774
- 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) {
775
- return mpyColor(d);
776
- }).attr('id', function (d) {
777
- return "mpyt2".concat((0, _focus.mpyIdTag)(d));
778
- }).text(function (d) {
779
- return "(".concat(d.mpyType, ")");
780
- }).attr('transform', function (d) {
781
- return "translate(".concat(xt((d.xExtent.xL + d.xExtent.xU) / 2 - shift), ", ").concat(height - dh + 24, ")");
782
- }).on('mouseover', function (d) {
783
- d3.selectAll("#mpyb".concat((0, _focus.mpyIdTag)(d))).attr('stroke', 'blue');
784
- d3.selectAll("#mpyt1".concat((0, _focus.mpyIdTag)(d))).style('fill', 'blue');
785
- d3.selectAll("#mpyt2".concat((0, _focus.mpyIdTag)(d))).style('fill', 'blue');
786
- d3.selectAll("#mpyp".concat((0, _focus.mpyIdTag)(d))).attr('stroke', 'blue');
787
- }).on('mouseout', function (d) {
788
- var dColor = mpyColor(d);
789
- d3.selectAll("#mpyb".concat((0, _focus.mpyIdTag)(d))).attr('stroke', dColor);
790
- d3.selectAll("#mpyt1".concat((0, _focus.mpyIdTag)(d))).style('fill', dColor);
791
- d3.selectAll("#mpyt2".concat((0, _focus.mpyIdTag)(d))).style('fill', dColor);
792
- d3.selectAll("#mpyp".concat((0, _focus.mpyIdTag)(d))).attr('stroke', dColor);
793
- }).on('click', function (d) {
794
- return _this7.onClickTarget(d);
795
- });
796
- var mpypH = height - dh;
797
- var mpypPath = function mpypPath(pk) {
798
- return [{
799
- x: xt(pk.x - shift) - 0.5,
800
- y: mpypH - 5
801
- }, {
802
- x: xt(pk.x - shift) - 0.5,
803
- y: mpypH - 20
804
- }, {
805
- x: xt(pk.x - shift) + 0.5,
806
- y: mpypH - 20
807
- }, {
808
- x: xt(pk.x - shift) + 0.5,
809
- y: mpypH - 5
810
- }];
811
- };
812
- // const faktor = layoutSt === LIST_LAYOUT.IR ? -1 : 1;
813
- var lineSymbol = d3.line().x(function (d) {
814
- return d.x;
815
- }).y(function (d) {
816
- return d.y;
817
- });
818
- mpyp.enter().append('path').attr('class', 'mpyp').attr('fill', 'none').merge(mpyp).attr('stroke', function (d) {
819
- return mpyColor(d);
820
- }).attr('d', function (d) {
821
- return lineSymbol(mpypPath(d));
822
- }).attr('id', function (d) {
823
- return "mpyp".concat((0, _focus.mpyIdTag)(d));
824
- }).on('mouseover', function (d) {
825
- d3.selectAll("#mpyb".concat((0, _focus.mpyIdTag)(d))).attr('stroke', 'blue');
826
- d3.selectAll("#mpyt1".concat((0, _focus.mpyIdTag)(d))).style('fill', 'blue');
827
- d3.selectAll("#mpyt2".concat((0, _focus.mpyIdTag)(d))).style('fill', 'blue');
828
- d3.selectAll("#mpyp".concat((0, _focus.mpyIdTag)(d))).attr('stroke', 'blue');
829
- }).on('mouseout', function (d) {
830
- var dColor = mpyColor(d);
831
- d3.selectAll("#mpyb".concat((0, _focus.mpyIdTag)(d))).attr('stroke', dColor);
832
- d3.selectAll("#mpyt1".concat((0, _focus.mpyIdTag)(d))).style('fill', dColor);
833
- d3.selectAll("#mpyt2".concat((0, _focus.mpyIdTag)(d))).style('fill', dColor);
834
- d3.selectAll("#mpyp".concat((0, _focus.mpyIdTag)(d))).attr('stroke', dColor);
835
- }).on('click', function (d) {
836
- return _this7.onClickTarget(d);
837
- });
611
+ return;
838
612
  }
839
- }, {
840
- key: "drawRef",
841
- value: function drawRef() {
842
- // rescale for zoom
843
- var _TfRescale10 = (0, _compass.TfRescale)(this),
844
- xt = _TfRescale10.xt,
845
- yt = _TfRescale10.yt;
846
- var ccp = this.ref.selectAll('path').data(this.tSfPeaks);
847
- ccp.exit().attr('class', 'exit').remove();
848
- var linePath = [{
849
- x: -0.5,
850
- y: 10
851
- }, {
852
- x: -4,
853
- y: -20
854
- }, {
855
- x: 4,
856
- y: -20
857
- }, {
858
- x: 0.5,
859
- y: 10
860
- }];
861
- var faktor = _format.default.isIrLayout(this.layout) ? -1 : 1;
862
- var lineSymbol = d3.line().x(function (d) {
863
- return d.x;
864
- }).y(function (d) {
865
- return faktor * d.y;
866
- })(linePath);
867
- ccp.enter().append('path').attr('d', lineSymbol).attr('class', 'enter-ref').attr('fill', 'green').attr('fill-opacity', 0.8).merge(ccp).attr('transform', function (d) {
868
- return "translate(".concat(xt(d.x), ", ").concat(yt(d.y), ")");
869
- });
870
- }
871
- }, {
872
- key: "reverseXAxis",
873
- value: function reverseXAxis(layoutSt) {
874
- 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.SEC].indexOf(layoutSt) < 0;
875
- }
876
- }, {
877
- key: "create",
878
- value: function create(_ref4) {
879
- var curveSt = _ref4.curveSt,
880
- filterSeed = _ref4.filterSeed,
881
- filterPeak = _ref4.filterPeak,
882
- tTrEndPts = _ref4.tTrEndPts,
883
- tSfPeaks = _ref4.tSfPeaks,
884
- editPeakSt = _ref4.editPeakSt,
885
- layoutSt = _ref4.layoutSt,
886
- sweepExtentSt = _ref4.sweepExtentSt,
887
- isUiNoBrushSt = _ref4.isUiNoBrushSt,
888
- cyclicvoltaSt = _ref4.cyclicvoltaSt,
889
- integationSt = _ref4.integationSt,
890
- mtplySt = _ref4.mtplySt;
891
- this.svg = d3.select(this.rootKlass).select('.d3Svg');
892
- (0, _mount.MountMainFrame)(this, 'focus');
893
- (0, _mount.MountClip)(this);
894
- var curveIdx = curveSt.curveIdx;
895
- var jcampIdx = curveIdx;
896
- this.root = d3.select(this.rootKlass).selectAll('.focus-main');
897
- this.scales = (0, _init.InitScale)(this, this.reverseXAxis(layoutSt));
898
- this.setTip();
899
- this.setDataParams(filterPeak, tTrEndPts, tSfPeaks, layoutSt, cyclicvoltaSt, jcampIdx);
900
- (0, _compass.MountCompass)(this);
901
- this.axis = (0, _mount.MountAxis)(this);
902
- this.path = (0, _mount.MountPath)(this, this.pathColor);
903
- this.grid = (0, _mount.MountGrid)(this);
904
- this.tags = (0, _mount.MountTags)(this);
905
- this.ref = (0, _mount.MountRef)(this);
906
- (0, _mount.MountAxisLabelX)(this);
907
- (0, _mount.MountAxisLabelY)(this);
908
- if (this.data && this.data.length > 0) {
909
- this.setConfig(sweepExtentSt);
910
- this.drawLine();
911
- this.drawGrid();
912
- this.drawOtherLines(layoutSt);
913
- this.drawPeaks(editPeakSt);
914
- this.drawRef();
915
- this.drawPeckers();
916
- this.drawInteg(integationSt);
917
- this.drawMtply(mtplySt);
918
- }
919
- (0, _brush.default)(this, false, isUiNoBrushSt);
920
- this.resetShouldUpdate(editPeakSt);
613
+ const {
614
+ stack,
615
+ smExtext,
616
+ shift
617
+ } = selectedMulti;
618
+ const mpys = stack;
619
+ const isDisable = _cfg.default.btnCmdMpy(this.layout);
620
+ if (mpys === 0 || isDisable) return;
621
+ // rescale for zoom
622
+ const {
623
+ xt
624
+ } = (0, _compass.TfRescale)(this);
625
+ const mpyb = this.tags.mpybPath.selectAll('path').data(mpys);
626
+ mpyb.exit().attr('class', 'exit').remove();
627
+ const mpyt1 = this.tags.mpyt1Path.selectAll('text').data(mpys);
628
+ mpyt1.exit().attr('class', 'exit').remove();
629
+ const mpyt2 = this.tags.mpyt2Path.selectAll('text').data(mpys);
630
+ mpyt2.exit().attr('class', 'exit').remove();
631
+ let mPeaks = mpys.map(m => {
632
+ const {
633
+ peaks,
634
+ xExtent
635
+ } = m;
636
+ return peaks.map(p => Object.assign({}, p, {
637
+ xExtent
638
+ }));
639
+ });
640
+ mPeaks = [].concat(...mPeaks);
641
+ const mpyp = this.tags.mpypPath.selectAll('path').data(mPeaks);
642
+ mpyp.exit().attr('class', 'exit').remove();
643
+ const height = this.h;
644
+ const dh = Math.abs(0.06 * height);
645
+ 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]]);
646
+ const mpyColor = d => {
647
+ const {
648
+ xL,
649
+ xU
650
+ } = d.xExtent;
651
+ return smExtext.xL === xL && smExtext.xU === xU ? 'purple' : '#DA70D6';
652
+ };
653
+ 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 => {
654
+ d3.selectAll(`#mpyb${(0, _focus.mpyIdTag)(d)}`).attr('stroke', 'blue');
655
+ d3.selectAll(`#mpyt1${(0, _focus.mpyIdTag)(d)}`).style('fill', 'blue');
656
+ d3.selectAll(`#mpyt2${(0, _focus.mpyIdTag)(d)}`).style('fill', 'blue');
657
+ d3.selectAll(`#mpyp${(0, _focus.mpyIdTag)(d)}`).attr('stroke', 'blue');
658
+ }).on('mouseout', d => {
659
+ const dColor = mpyColor(d);
660
+ d3.selectAll(`#mpyb${(0, _focus.mpyIdTag)(d)}`).attr('stroke', dColor);
661
+ d3.selectAll(`#mpyt1${(0, _focus.mpyIdTag)(d)}`).style('fill', dColor);
662
+ d3.selectAll(`#mpyt2${(0, _focus.mpyIdTag)(d)}`).style('fill', dColor);
663
+ d3.selectAll(`#mpyp${(0, _focus.mpyIdTag)(d)}`).attr('stroke', dColor);
664
+ }).on('click', d => this.onClickTarget(d));
665
+ 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 => {
666
+ d3.selectAll(`#mpyb${(0, _focus.mpyIdTag)(d)}`).attr('stroke', 'blue');
667
+ d3.selectAll(`#mpyt1${(0, _focus.mpyIdTag)(d)}`).style('fill', 'blue');
668
+ d3.selectAll(`#mpyt2${(0, _focus.mpyIdTag)(d)}`).style('fill', 'blue');
669
+ d3.selectAll(`#mpyp${(0, _focus.mpyIdTag)(d)}`).attr('stroke', 'blue');
670
+ }).on('mouseout', d => {
671
+ const dColor = mpyColor(d);
672
+ d3.selectAll(`#mpyb${(0, _focus.mpyIdTag)(d)}`).attr('stroke', dColor);
673
+ d3.selectAll(`#mpyt1${(0, _focus.mpyIdTag)(d)}`).style('fill', dColor);
674
+ d3.selectAll(`#mpyt2${(0, _focus.mpyIdTag)(d)}`).style('fill', dColor);
675
+ d3.selectAll(`#mpyp${(0, _focus.mpyIdTag)(d)}`).attr('stroke', dColor);
676
+ }).on('click', d => this.onClickTarget(d));
677
+ 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 => {
678
+ d3.selectAll(`#mpyb${(0, _focus.mpyIdTag)(d)}`).attr('stroke', 'blue');
679
+ d3.selectAll(`#mpyt1${(0, _focus.mpyIdTag)(d)}`).style('fill', 'blue');
680
+ d3.selectAll(`#mpyt2${(0, _focus.mpyIdTag)(d)}`).style('fill', 'blue');
681
+ d3.selectAll(`#mpyp${(0, _focus.mpyIdTag)(d)}`).attr('stroke', 'blue');
682
+ }).on('mouseout', d => {
683
+ const dColor = mpyColor(d);
684
+ d3.selectAll(`#mpyb${(0, _focus.mpyIdTag)(d)}`).attr('stroke', dColor);
685
+ d3.selectAll(`#mpyt1${(0, _focus.mpyIdTag)(d)}`).style('fill', dColor);
686
+ d3.selectAll(`#mpyt2${(0, _focus.mpyIdTag)(d)}`).style('fill', dColor);
687
+ d3.selectAll(`#mpyp${(0, _focus.mpyIdTag)(d)}`).attr('stroke', dColor);
688
+ }).on('click', d => this.onClickTarget(d));
689
+ const mpypH = height - dh;
690
+ const mpypPath = pk => [{
691
+ x: xt(pk.x - shift) - 0.5,
692
+ y: mpypH - 5
693
+ }, {
694
+ x: xt(pk.x - shift) - 0.5,
695
+ y: mpypH - 20
696
+ }, {
697
+ x: xt(pk.x - shift) + 0.5,
698
+ y: mpypH - 20
699
+ }, {
700
+ x: xt(pk.x - shift) + 0.5,
701
+ y: mpypH - 5
702
+ }];
703
+ // const faktor = layoutSt === LIST_LAYOUT.IR ? -1 : 1;
704
+ const lineSymbol = d3.line().x(d => d.x).y(d => d.y);
705
+ 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 => {
706
+ d3.selectAll(`#mpyb${(0, _focus.mpyIdTag)(d)}`).attr('stroke', 'blue');
707
+ d3.selectAll(`#mpyt1${(0, _focus.mpyIdTag)(d)}`).style('fill', 'blue');
708
+ d3.selectAll(`#mpyt2${(0, _focus.mpyIdTag)(d)}`).style('fill', 'blue');
709
+ d3.selectAll(`#mpyp${(0, _focus.mpyIdTag)(d)}`).attr('stroke', 'blue');
710
+ }).on('mouseout', d => {
711
+ const dColor = mpyColor(d);
712
+ d3.selectAll(`#mpyb${(0, _focus.mpyIdTag)(d)}`).attr('stroke', dColor);
713
+ d3.selectAll(`#mpyt1${(0, _focus.mpyIdTag)(d)}`).style('fill', dColor);
714
+ d3.selectAll(`#mpyt2${(0, _focus.mpyIdTag)(d)}`).style('fill', dColor);
715
+ d3.selectAll(`#mpyp${(0, _focus.mpyIdTag)(d)}`).attr('stroke', dColor);
716
+ }).on('click', d => this.onClickTarget(d));
717
+ }
718
+ drawRef() {
719
+ // rescale for zoom
720
+ const {
721
+ xt,
722
+ yt
723
+ } = (0, _compass.TfRescale)(this);
724
+ const ccp = this.ref.selectAll('path').data(this.tSfPeaks);
725
+ ccp.exit().attr('class', 'exit').remove();
726
+ const linePath = [{
727
+ x: -0.5,
728
+ y: 10
729
+ }, {
730
+ x: -4,
731
+ y: -20
732
+ }, {
733
+ x: 4,
734
+ y: -20
735
+ }, {
736
+ x: 0.5,
737
+ y: 10
738
+ }];
739
+ const faktor = _format.default.isIrLayout(this.layout) ? -1 : 1;
740
+ const lineSymbol = d3.line().x(d => d.x).y(d => faktor * d.y)(linePath);
741
+ 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)})`);
742
+ }
743
+ reverseXAxis(layoutSt) {
744
+ 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.SEC, _list_layout.LIST_LAYOUT.AIF].indexOf(layoutSt) < 0;
745
+ }
746
+ create(_ref) {
747
+ let {
748
+ curveSt,
749
+ filterSeed,
750
+ filterPeak,
751
+ tTrEndPts,
752
+ tSfPeaks,
753
+ editPeakSt,
754
+ layoutSt,
755
+ sweepExtentSt,
756
+ isUiNoBrushSt,
757
+ cyclicvoltaSt,
758
+ integationSt,
759
+ mtplySt
760
+ } = _ref;
761
+ this.svg = d3.select(this.rootKlass).select('.d3Svg');
762
+ (0, _mount.MountMainFrame)(this, 'focus');
763
+ (0, _mount.MountClip)(this);
764
+ const {
765
+ curveIdx,
766
+ isShowAllCurve
767
+ } = curveSt;
768
+ const jcampIdx = curveIdx;
769
+ this.isShowAllCurves = isShowAllCurve;
770
+ this.root = d3.select(this.rootKlass).selectAll('.focus-main');
771
+ this.scales = (0, _init.InitScale)(this, this.reverseXAxis(layoutSt));
772
+ this.setTip();
773
+ this.setDataParams(filterPeak, tTrEndPts, tSfPeaks, layoutSt, cyclicvoltaSt, jcampIdx);
774
+ (0, _compass.MountCompass)(this);
775
+ this.axis = (0, _mount.MountAxis)(this);
776
+ this.path = (0, _mount.MountPath)(this, this.pathColor);
777
+ this.grid = (0, _mount.MountGrid)(this);
778
+ this.tags = (0, _mount.MountTags)(this);
779
+ this.ref = (0, _mount.MountRef)(this);
780
+ (0, _mount.MountAxisLabelX)(this);
781
+ (0, _mount.MountAxisLabelY)(this);
782
+ if (this.data && this.data.length > 0) {
783
+ this.setConfig(sweepExtentSt);
784
+ this.drawLine();
785
+ this.drawGrid();
786
+ this.drawOtherLines(layoutSt);
787
+ this.drawPeaks(editPeakSt);
788
+ this.drawRef();
789
+ this.drawPeckers();
790
+ this.drawInteg(integationSt);
791
+ this.drawMtply(mtplySt);
921
792
  }
922
- }, {
923
- key: "update",
924
- value: function update(_ref5) {
925
- var entities = _ref5.entities,
926
- curveSt = _ref5.curveSt,
927
- filterSeed = _ref5.filterSeed,
928
- filterPeak = _ref5.filterPeak,
929
- tTrEndPts = _ref5.tTrEndPts,
930
- tSfPeaks = _ref5.tSfPeaks,
931
- editPeakSt = _ref5.editPeakSt,
932
- layoutSt = _ref5.layoutSt,
933
- sweepExtentSt = _ref5.sweepExtentSt,
934
- isUiNoBrushSt = _ref5.isUiNoBrushSt,
935
- cyclicvoltaSt = _ref5.cyclicvoltaSt,
936
- integationSt = _ref5.integationSt,
937
- mtplySt = _ref5.mtplySt;
938
- this.root = d3.select(this.rootKlass).selectAll('.focus-main');
939
- this.scales = (0, _init.InitScale)(this, this.reverseXAxis(layoutSt));
940
- var curveIdx = curveSt.curveIdx;
941
- var jcampIdx = curveIdx;
942
- this.entities = entities;
943
- this.setDataParams(filterPeak, tTrEndPts, tSfPeaks, layoutSt, cyclicvoltaSt, jcampIdx);
944
- if (this.data && this.data.length > 0) {
945
- this.setConfig(sweepExtentSt);
946
- this.getShouldUpdate(editPeakSt);
947
- this.drawLine();
948
- this.drawGrid();
949
- this.drawOtherLines(layoutSt);
950
- this.drawPeaks(editPeakSt);
951
- this.drawRef();
952
- this.drawPeckers();
953
- this.drawInteg(integationSt);
954
- this.drawMtply(mtplySt);
955
- }
956
- (0, _brush.default)(this, false, isUiNoBrushSt);
957
- this.resetShouldUpdate(editPeakSt);
793
+ (0, _brush.default)(this, false, isUiNoBrushSt);
794
+ this.resetShouldUpdate(editPeakSt);
795
+ }
796
+ update(_ref2) {
797
+ let {
798
+ entities,
799
+ curveSt,
800
+ filterSeed,
801
+ filterPeak,
802
+ tTrEndPts,
803
+ tSfPeaks,
804
+ editPeakSt,
805
+ layoutSt,
806
+ sweepExtentSt,
807
+ isUiNoBrushSt,
808
+ cyclicvoltaSt,
809
+ integationSt,
810
+ mtplySt
811
+ } = _ref2;
812
+ this.root = d3.select(this.rootKlass).selectAll('.focus-main');
813
+ this.scales = (0, _init.InitScale)(this, this.reverseXAxis(layoutSt));
814
+ const {
815
+ curveIdx,
816
+ isShowAllCurve
817
+ } = curveSt;
818
+ const jcampIdx = curveIdx;
819
+ this.isShowAllCurves = isShowAllCurve;
820
+ this.entities = entities;
821
+ this.setDataParams(filterPeak, tTrEndPts, tSfPeaks, layoutSt, cyclicvoltaSt, jcampIdx);
822
+ if (this.data && this.data.length > 0) {
823
+ this.setConfig(sweepExtentSt);
824
+ this.getShouldUpdate(editPeakSt);
825
+ this.drawLine();
826
+ this.drawGrid();
827
+ this.drawOtherLines(layoutSt);
828
+ this.drawPeaks(editPeakSt);
829
+ this.drawRef();
830
+ this.drawPeckers();
831
+ this.drawInteg(integationSt);
832
+ this.drawMtply(mtplySt);
958
833
  }
959
- }]);
960
- return MultiFocus;
961
- }();
962
- var _default = MultiFocus;
963
- exports.default = _default;
834
+ (0, _brush.default)(this, false, isUiNoBrushSt);
835
+ this.resetShouldUpdate(editPeakSt);
836
+ }
837
+ }
838
+ var _default = exports.default = MultiFocus;