@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
@@ -5,77 +5,53 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
11
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
8
  var _react = _interopRequireDefault(require("react"));
14
9
  var _CircularProgress = _interopRequireDefault(require("@material-ui/core/CircularProgress"));
15
10
  var _ErrorOutline = _interopRequireDefault(require("@material-ui/icons/ErrorOutline"));
16
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
17
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
18
- var styleLoading = {
11
+ const styleLoading = {
19
12
  alignItems: 'center',
20
13
  display: 'flex',
21
14
  height: '100%',
22
15
  justifyContent: 'center'
23
16
  };
24
- var SectionLoading = /*#__PURE__*/function (_React$Component) {
25
- (0, _inherits2.default)(SectionLoading, _React$Component);
26
- var _super = _createSuper(SectionLoading);
27
- function SectionLoading(props) {
28
- var _this;
29
- (0, _classCallCheck2.default)(this, SectionLoading);
30
- _this = _super.call(this, props);
31
- _this.state = {
17
+ class SectionLoading extends _react.default.Component {
18
+ constructor(props) {
19
+ super(props);
20
+ this.state = {
32
21
  loading: true
33
22
  };
34
- return _this;
35
23
  }
36
- (0, _createClass2.default)(SectionLoading, [{
37
- key: "componentDidMount",
38
- value: function componentDidMount() {
39
- var _this2 = this;
40
- setTimeout(function () {
41
- return _this2.setState({
42
- loading: false
43
- });
44
- }, 5000);
45
- }
46
- }, {
47
- key: "renderLoading",
48
- value: function renderLoading() {
49
- return /*#__PURE__*/_react.default.createElement("div", {
50
- style: styleLoading
51
- }, /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
52
- style: {
53
- color: 'blue',
54
- fontSize: 50
55
- }
56
- }));
57
- }
58
- }, {
59
- key: "renderNotFound",
60
- value: function renderNotFound() {
61
- return /*#__PURE__*/_react.default.createElement("div", {
62
- style: styleLoading
63
- }, /*#__PURE__*/_react.default.createElement(_ErrorOutline.default, {
64
- style: {
65
- color: '#ffc107',
66
- fontSize: 50,
67
- margin: 20
68
- }
69
- }), /*#__PURE__*/_react.default.createElement("h3", null, "Structure Not Found"));
70
- }
71
- }, {
72
- key: "render",
73
- value: function render() {
74
- var loading = this.state.loading;
75
- return loading ? this.renderLoading() : this.renderNotFound();
76
- }
77
- }]);
78
- return SectionLoading;
79
- }(_react.default.Component);
80
- var _default = SectionLoading;
81
- exports.default = _default;
24
+ componentDidMount() {
25
+ setTimeout(() => this.setState({
26
+ loading: false
27
+ }), 5000);
28
+ }
29
+ renderLoading() {
30
+ return /*#__PURE__*/_react.default.createElement("div", {
31
+ style: styleLoading
32
+ }, /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
33
+ style: {
34
+ color: 'blue',
35
+ fontSize: 50
36
+ }
37
+ }));
38
+ }
39
+ renderNotFound() {
40
+ return /*#__PURE__*/_react.default.createElement("div", {
41
+ style: styleLoading
42
+ }, /*#__PURE__*/_react.default.createElement(_ErrorOutline.default, {
43
+ style: {
44
+ color: '#ffc107',
45
+ fontSize: 50,
46
+ margin: 20
47
+ }
48
+ }), /*#__PURE__*/_react.default.createElement("h3", null, "Structure Not Found"));
49
+ }
50
+ render() {
51
+ const {
52
+ loading
53
+ } = this.state;
54
+ return loading ? this.renderLoading() : this.renderNotFound();
55
+ }
56
+ }
57
+ var _default = exports.default = SectionLoading;
@@ -5,12 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
14
8
  var _react = _interopRequireDefault(require("react"));
15
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
16
10
  var _reactRedux = require("react-redux");
@@ -22,119 +16,115 @@ var _ir_viewer = _interopRequireDefault(require("./forecast/ir_viewer"));
22
16
  var _forecast = require("../actions/forecast");
23
17
  var _ui = require("../actions/ui");
24
18
  var _list_ui = require("../constants/list_ui");
25
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
26
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable react/no-unused-prop-types */
27
- var styles = function styles() {
28
- return {
29
- root: {
30
- flexGrow: 1
31
- },
32
- appBar: {
33
- backgroundColor: '#fff',
34
- boxShadow: 'none'
35
- },
36
- tabLabel: {
37
- fontSize: '14px'
38
- }
39
- };
40
- };
41
- var ForecastViewer = /*#__PURE__*/function (_React$Component) {
42
- (0, _inherits2.default)(ForecastViewer, _React$Component);
43
- var _super = _createSuper(ForecastViewer);
44
- function ForecastViewer(props) {
45
- var _this;
46
- (0, _classCallCheck2.default)(this, ForecastViewer);
47
- _this = _super.call(this, props);
48
- _this.initForecastReducer = _this.initForecastReducer.bind((0, _assertThisInitialized2.default)(_this));
49
- return _this;
19
+ /* eslint-disable react/no-unused-prop-types */
20
+
21
+ const styles = () => ({
22
+ root: {
23
+ flexGrow: 1
24
+ },
25
+ appBar: {
26
+ backgroundColor: '#fff',
27
+ boxShadow: 'none'
28
+ },
29
+ tabLabel: {
30
+ fontSize: '14px'
31
+ }
32
+ });
33
+ class ForecastViewer extends _react.default.Component {
34
+ constructor(props) {
35
+ super(props);
36
+ this.initForecastReducer = this.initForecastReducer.bind(this);
37
+ }
38
+ componentDidMount() {
39
+ this.initForecastReducer();
50
40
  }
51
- (0, _createClass2.default)(ForecastViewer, [{
52
- key: "componentDidMount",
53
- value: function componentDidMount() {
41
+ componentDidUpdate(prevProps) {
42
+ const {
43
+ forecast
44
+ } = this.props;
45
+ const prevForecast = forecast;
46
+ const nextForecast = prevProps.forecast;
47
+ if (prevForecast !== nextForecast) {
54
48
  this.initForecastReducer();
55
49
  }
56
- }, {
57
- key: "componentDidUpdate",
58
- value: function componentDidUpdate(prevProps) {
59
- var forecast = this.props.forecast;
60
- var prevForecast = forecast;
61
- var nextForecast = prevProps.forecast;
62
- if (prevForecast !== nextForecast) {
63
- this.initForecastReducer();
64
- }
65
- }
66
- }, {
67
- key: "initForecastReducer",
68
- value: function initForecastReducer() {
69
- var _this$props = this.props,
70
- forecast = _this$props.forecast,
71
- initForecastStatusAct = _this$props.initForecastStatusAct,
72
- setUiViewerTypeAct = _this$props.setUiViewerTypeAct;
73
- initForecastStatusAct(forecast);
74
- if (forecast && forecast.predictions) {
75
- var _forecast$predictions = forecast.predictions,
76
- running = _forecast$predictions.running,
77
- refreshed = _forecast$predictions.refreshed;
78
- if (running || refreshed) setUiViewerTypeAct(_list_ui.LIST_UI_VIEWER_TYPE.ANALYSIS);
79
- }
80
- }
81
- }, {
82
- key: "render",
83
- value: function render() {
84
- var _this$props2 = this.props,
85
- classes = _this$props2.classes,
86
- topic = _this$props2.topic,
87
- feature = _this$props2.feature,
88
- cLabel = _this$props2.cLabel,
89
- xLabel = _this$props2.xLabel,
90
- yLabel = _this$props2.yLabel,
91
- forecast = _this$props2.forecast,
92
- isNmr = _this$props2.isNmr,
93
- isIr = _this$props2.isIr,
94
- uiSt = _this$props2.uiSt,
95
- comparisonsSt = _this$props2.comparisonsSt,
96
- isXRD = _this$props2.isXRD,
97
- wavelength = _this$props2.wavelength;
98
- var viewer = uiSt.viewer;
99
- var inputCb = forecast.inputCb,
100
- molecule = forecast.molecule;
101
- return /*#__PURE__*/_react.default.createElement("div", {
102
- className: classes.root
103
- }, /*#__PURE__*/_react.default.createElement(_index.default, {
104
- topic: topic,
105
- feature: feature,
106
- cLabel: cLabel,
107
- xLabel: isXRD && wavelength ? "".concat(xLabel, ", WL=").concat(wavelength.value, " ").concat(wavelength.unit) : xLabel,
108
- yLabel: yLabel,
109
- comparisons: comparisonsSt,
110
- isHidden: viewer !== _list_ui.LIST_UI_VIEWER_TYPE.SPECTRUM
111
- }), viewer === _list_ui.LIST_UI_VIEWER_TYPE.ANALYSIS && isNmr && /*#__PURE__*/_react.default.createElement(_nmr_viewer.default, {
112
- molecule: molecule,
113
- inputCb: inputCb
114
- }), viewer === _list_ui.LIST_UI_VIEWER_TYPE.ANALYSIS && isIr && /*#__PURE__*/_react.default.createElement(_ir_viewer.default, {
115
- molecule: molecule,
116
- inputCb: inputCb
117
- }));
118
- }
119
- }]);
120
- return ForecastViewer;
121
- }(_react.default.Component);
122
- var mapStateToProps = function mapStateToProps(state, _) {
123
- return (
124
- // eslint-disable-line
125
- {
126
- uiSt: state.ui,
127
- comparisonsSt: state.jcamp.others,
128
- wavelength: state.wavelength
50
+ }
51
+ initForecastReducer() {
52
+ const {
53
+ forecast,
54
+ initForecastStatusAct,
55
+ setUiViewerTypeAct
56
+ } = this.props;
57
+ initForecastStatusAct(forecast);
58
+ if (forecast && forecast.predictions) {
59
+ const {
60
+ running,
61
+ refreshed
62
+ } = forecast.predictions;
63
+ if (running || refreshed) setUiViewerTypeAct(_list_ui.LIST_UI_VIEWER_TYPE.ANALYSIS);
129
64
  }
130
- );
131
- };
132
- var mapDispatchToProps = function mapDispatchToProps(dispatch) {
133
- return (0, _redux.bindActionCreators)({
134
- initForecastStatusAct: _forecast.initForecastStatus,
135
- setUiViewerTypeAct: _ui.setUiViewerType
136
- }, dispatch);
137
- };
65
+ }
66
+ render() {
67
+ const {
68
+ classes,
69
+ topic,
70
+ feature,
71
+ cLabel,
72
+ xLabel,
73
+ yLabel,
74
+ forecast,
75
+ isNmr,
76
+ isIr,
77
+ uiSt,
78
+ isXRD,
79
+ wavelength,
80
+ curveSt,
81
+ jcampSt
82
+ } = this.props;
83
+ const {
84
+ viewer
85
+ } = uiSt;
86
+ const {
87
+ inputCb,
88
+ molecule
89
+ } = forecast;
90
+ const {
91
+ curveIdx
92
+ } = curveSt;
93
+ const {
94
+ jcamps
95
+ } = jcampSt;
96
+ const comparisons = jcamps[curveIdx].others;
97
+ return /*#__PURE__*/_react.default.createElement("div", {
98
+ className: classes.root
99
+ }, /*#__PURE__*/_react.default.createElement(_index.default, {
100
+ topic: topic,
101
+ feature: feature,
102
+ cLabel: cLabel,
103
+ xLabel: isXRD && wavelength ? `${xLabel}, WL=${wavelength.value} ${wavelength.unit}` : xLabel,
104
+ yLabel: yLabel,
105
+ comparisons: comparisons,
106
+ isHidden: viewer !== _list_ui.LIST_UI_VIEWER_TYPE.SPECTRUM
107
+ }), viewer === _list_ui.LIST_UI_VIEWER_TYPE.ANALYSIS && isNmr && /*#__PURE__*/_react.default.createElement(_nmr_viewer.default, {
108
+ molecule: molecule,
109
+ inputCb: inputCb
110
+ }), viewer === _list_ui.LIST_UI_VIEWER_TYPE.ANALYSIS && isIr && /*#__PURE__*/_react.default.createElement(_ir_viewer.default, {
111
+ molecule: molecule,
112
+ inputCb: inputCb
113
+ }));
114
+ }
115
+ }
116
+ const mapStateToProps = (state, _) => (
117
+ // eslint-disable-line
118
+ {
119
+ uiSt: state.ui,
120
+ jcampSt: state.jcamp,
121
+ wavelength: state.wavelength,
122
+ curveSt: state.curve
123
+ });
124
+ const mapDispatchToProps = dispatch => (0, _redux.bindActionCreators)({
125
+ initForecastStatusAct: _forecast.initForecastStatus,
126
+ setUiViewerTypeAct: _ui.setUiViewerType
127
+ }, dispatch);
138
128
  ForecastViewer.propTypes = {
139
129
  classes: _propTypes.default.object.isRequired,
140
130
  topic: _propTypes.default.object.isRequired,
@@ -148,10 +138,10 @@ ForecastViewer.propTypes = {
148
138
  isUvvis: _propTypes.default.bool.isRequired,
149
139
  isXRD: _propTypes.default.bool.isRequired,
150
140
  uiSt: _propTypes.default.object.isRequired,
151
- comparisonsSt: _propTypes.default.array.isRequired,
141
+ jcampSt: _propTypes.default.object.isRequired,
152
142
  initForecastStatusAct: _propTypes.default.func.isRequired,
153
143
  setUiViewerTypeAct: _propTypes.default.func.isRequired,
154
- wavelength: _propTypes.default.object.isRequired
144
+ wavelength: _propTypes.default.object.isRequired,
145
+ curveSt: _propTypes.default.object.isRequired
155
146
  };
156
- var _default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), (0, _styles.withStyles)(styles))(ForecastViewer);
157
- exports.default = _default;
147
+ var _default = exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), (0, _styles.withStyles)(styles))(ForecastViewer);
@@ -5,11 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
11
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
8
  var _react = _interopRequireDefault(require("react"));
14
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
15
10
  var _reactRedux = require("react-redux");
@@ -21,29 +16,29 @@ var _index2 = _interopRequireDefault(require("./cmd_bar/index"));
21
16
  var _index3 = _interopRequireDefault(require("./d3_multi/index"));
22
17
  var _curve = require("../actions/curve");
23
18
  var _cyclic_voltammetry = require("../actions/cyclic_voltammetry");
24
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
25
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable react/default-props-match-prop-types,
26
- react/require-default-props, react/no-unused-prop-types, react/jsx-boolean-value,
27
- prefer-object-spread */
28
- var styles = function styles() {
29
- return {
30
- root: {
31
- flexGrow: 1
32
- },
33
- appBar: {
34
- backgroundColor: '#fff',
35
- boxShadow: 'none'
36
- },
37
- tabLabel: {
38
- fontSize: '14px'
39
- }
40
- };
41
- };
42
- var seperatingSubLayout = function seperatingSubLayout(entities, featureCondition) {
43
- var storedDict = {};
44
- entities.forEach(function (entity) {
45
- var feature = entity.feature;
46
- var keyValue = feature[featureCondition];
19
+ /* eslint-disable react/default-props-match-prop-types,
20
+ react/require-default-props, react/no-unused-prop-types, react/jsx-boolean-value,
21
+ prefer-object-spread */
22
+
23
+ const styles = () => ({
24
+ root: {
25
+ flexGrow: 1
26
+ },
27
+ appBar: {
28
+ backgroundColor: '#fff',
29
+ boxShadow: 'none'
30
+ },
31
+ tabLabel: {
32
+ fontSize: '14px'
33
+ }
34
+ });
35
+ const seperatingSubLayout = (entities, featureCondition) => {
36
+ const storedDict = {};
37
+ entities.forEach(entity => {
38
+ const {
39
+ feature
40
+ } = entity;
41
+ const keyValue = feature[featureCondition];
47
42
  if (keyValue in storedDict) {
48
43
  storedDict[keyValue].push(entity);
49
44
  } else {
@@ -52,96 +47,86 @@ var seperatingSubLayout = function seperatingSubLayout(entities, featureConditio
52
47
  });
53
48
  return Object.assign({}, storedDict);
54
49
  };
55
- var MultiJcampsViewer = /*#__PURE__*/function (_React$Component) {
56
- (0, _inherits2.default)(MultiJcampsViewer, _React$Component);
57
- var _super = _createSuper(MultiJcampsViewer);
58
- function MultiJcampsViewer() {
59
- (0, _classCallCheck2.default)(this, MultiJcampsViewer);
60
- return _super.apply(this, arguments);
50
+ class MultiJcampsViewer extends _react.default.Component {
51
+ // eslint-disable-line
52
+ render() {
53
+ const {
54
+ classes,
55
+ curveSt,
56
+ operations,
57
+ entityFileNames,
58
+ entities,
59
+ userManualLink,
60
+ molSvg
61
+ } = this.props;
62
+ if (!entities || entities.length === 0) return /*#__PURE__*/_react.default.createElement("div", null);
63
+ const seperatedSubLayouts = seperatingSubLayout(entities, 'xUnit');
64
+ const {
65
+ curveIdx
66
+ } = curveSt;
67
+ const entity = entities[curveIdx];
68
+ const {
69
+ feature,
70
+ topic
71
+ } = entity;
72
+ return /*#__PURE__*/_react.default.createElement("div", {
73
+ className: classes.root
74
+ }, /*#__PURE__*/_react.default.createElement(_index2.default, {
75
+ feature: feature,
76
+ operations: operations,
77
+ editorOnly: true,
78
+ hideThreshold: true
79
+ }), /*#__PURE__*/_react.default.createElement("div", {
80
+ className: "react-spectrum-editor"
81
+ }, /*#__PURE__*/_react.default.createElement(_Grid.default, {
82
+ container: true
83
+ }, /*#__PURE__*/_react.default.createElement(_Grid.default, {
84
+ item: true,
85
+ xs: 9
86
+ }, /*#__PURE__*/_react.default.createElement(_index3.default, {
87
+ entities: entities,
88
+ topic: topic,
89
+ xLabel: feature.xUnit,
90
+ yLabel: feature.yUnit,
91
+ feature: feature
92
+ })), /*#__PURE__*/_react.default.createElement(_Grid.default, {
93
+ item: true,
94
+ xs: 3,
95
+ align: "center"
96
+ }, /*#__PURE__*/_react.default.createElement(_index.default, {
97
+ jcampIdx: curveIdx,
98
+ entityFileNames: entityFileNames,
99
+ userManualLink: userManualLink,
100
+ feature: feature,
101
+ molSvg: molSvg,
102
+ subLayoutsInfo: seperatedSubLayouts,
103
+ descriptions: "",
104
+ canChangeDescription: () => {},
105
+ onDescriptionChanged: () => {}
106
+ })))));
61
107
  }
62
- (0, _createClass2.default)(MultiJcampsViewer, [{
63
- key: "render",
64
- value:
65
- // eslint-disable-line
66
- function render() {
67
- var _this$props = this.props,
68
- classes = _this$props.classes,
69
- curvSt = _this$props.curvSt,
70
- operations = _this$props.operations,
71
- entityFileNames = _this$props.entityFileNames,
72
- entities = _this$props.entities,
73
- userManualLink = _this$props.userManualLink;
74
- if (!entities || entities.length === 0) return /*#__PURE__*/_react.default.createElement("div", null);
75
- var seperatedSubLayouts = seperatingSubLayout(entities, 'xUnit');
76
- var entity = entities[curvSt.curveIdx];
77
- var feature = entity.feature,
78
- topic = entity.topic,
79
- molSvg = entity.molSvg;
80
- return /*#__PURE__*/_react.default.createElement("div", {
81
- className: classes.root
82
- }, /*#__PURE__*/_react.default.createElement(_index2.default, {
83
- feature: feature,
84
- operations: operations,
85
- editorOnly: true,
86
- hideThreshold: true
87
- }), /*#__PURE__*/_react.default.createElement("div", {
88
- className: "react-spectrum-editor"
89
- }, /*#__PURE__*/_react.default.createElement(_Grid.default, {
90
- container: true
91
- }, /*#__PURE__*/_react.default.createElement(_Grid.default, {
92
- item: true,
93
- xs: 9
94
- }, /*#__PURE__*/_react.default.createElement(_index3.default, {
95
- entities: entities,
96
- topic: topic,
97
- xLabel: feature.xUnit,
98
- yLabel: feature.yUnit,
99
- feature: feature
100
- })), /*#__PURE__*/_react.default.createElement(_Grid.default, {
101
- item: true,
102
- xs: 3,
103
- align: "center"
104
- }, /*#__PURE__*/_react.default.createElement(_index.default, {
105
- jcampIdx: curvSt.curveIdx,
106
- entityFileNames: entityFileNames,
107
- userManualLink: userManualLink,
108
- feature: feature,
109
- molSvg: molSvg,
110
- subLayoutsInfo: seperatedSubLayouts,
111
- descriptions: "",
112
- canChangeDescription: function canChangeDescription() {},
113
- onDescriptionChanged: function onDescriptionChanged() {}
114
- })))));
115
- }
116
- }]);
117
- return MultiJcampsViewer;
118
- }(_react.default.Component);
119
- var mapStateToProps = function mapStateToProps(state, _) {
120
- return (
121
- // eslint-disable-line
122
- {
123
- curvSt: state.curve,
124
- cyclicVoltaSt: state.cyclicvolta,
125
- entities: state.curve.listCurves
126
- }
127
- );
128
- };
129
- var mapDispatchToProps = function mapDispatchToProps(dispatch) {
130
- return (0, _redux.bindActionCreators)({
131
- setAllCurvesAct: _curve.setAllCurves,
132
- addNewCylicVoltaPairPeakAct: _cyclic_voltammetry.addNewCylicVoltaPairPeak,
133
- addCylicVoltaMaxPeakAct: _cyclic_voltammetry.addCylicVoltaMaxPeak,
134
- addCylicVoltaMinPeakAct: _cyclic_voltammetry.addCylicVoltaMinPeak,
135
- addCylicVoltaPeckerAct: _cyclic_voltammetry.addCylicVoltaPecker
136
- }, dispatch);
137
- };
108
+ }
109
+ const mapStateToProps = (state, _) => (
110
+ // eslint-disable-line
111
+ {
112
+ curveSt: state.curve,
113
+ cyclicVoltaSt: state.cyclicvolta,
114
+ entities: state.curve.listCurves
115
+ });
116
+ const mapDispatchToProps = dispatch => (0, _redux.bindActionCreators)({
117
+ setAllCurvesAct: _curve.setAllCurves,
118
+ addNewCylicVoltaPairPeakAct: _cyclic_voltammetry.addNewCylicVoltaPairPeak,
119
+ addCylicVoltaMaxPeakAct: _cyclic_voltammetry.addCylicVoltaMaxPeak,
120
+ addCylicVoltaMinPeakAct: _cyclic_voltammetry.addCylicVoltaMinPeak,
121
+ addCylicVoltaPeckerAct: _cyclic_voltammetry.addCylicVoltaPecker
122
+ }, dispatch);
138
123
  MultiJcampsViewer.propTypes = {
139
124
  classes: _propTypes.default.object.isRequired,
140
125
  multiEntities: _propTypes.default.array.isRequired,
141
126
  entityFileNames: _propTypes.default.array.isRequired,
142
127
  molSvg: _propTypes.default.string.isRequired,
143
128
  setAllCurvesAct: _propTypes.default.func.isRequired,
144
- curvSt: _propTypes.default.object.isRequired,
129
+ curveSt: _propTypes.default.object.isRequired,
145
130
  cyclicVoltaSt: _propTypes.default.object.isRequired,
146
131
  addNewCylicVoltaPairPeakAct: _propTypes.default.func.isRequired,
147
132
  addCylicVoltaMaxPeakAct: _propTypes.default.func.isRequired,
@@ -159,5 +144,4 @@ MultiJcampsViewer.defaultProps = {
159
144
  yLabel: '',
160
145
  entities: []
161
146
  };
162
- var _default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), (0, _styles.withStyles)(styles))(MultiJcampsViewer);
163
- exports.default = _default;
147
+ var _default = exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), (0, _styles.withStyles)(styles))(MultiJcampsViewer);