@complat/react-spectra-editor 1.0.0-rc2 → 1.0.0-rc20.patch-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/dist/__tests__/fixtures/aif_jcamp_1.js +136 -0
- package/dist/__tests__/fixtures/aif_jcamp_2.js +122 -0
- package/dist/__tests__/fixtures/backup/nmr1h_a.js +3518 -0
- package/dist/__tests__/fixtures/backup/xrd_jcamp_1.js +10705 -0
- package/dist/__tests__/fixtures/cds_jcamp.js +861 -0
- package/dist/__tests__/fixtures/compare_ir_1_jcamp.js +585 -0
- package/dist/__tests__/fixtures/compare_ir_2_jcamp.js +515 -0
- package/dist/__tests__/fixtures/compare_uv_vis_jcamp.js +640 -0
- package/dist/__tests__/fixtures/cyclic_voltammetry_1.js +778 -0
- package/dist/__tests__/fixtures/cyclic_voltammetry_2.js +758 -0
- package/dist/__tests__/fixtures/cyclic_voltammetry_3.js +759 -0
- package/dist/__tests__/fixtures/dls_acf_jcamp.js +148 -0
- package/dist/__tests__/fixtures/dls_intensity_jcamp.js +151 -0
- package/dist/__tests__/fixtures/emissions_jcamp.js +883 -0
- package/dist/__tests__/fixtures/hplc_uvvis_jcamp.js +638 -0
- package/dist/__tests__/fixtures/hplc_uvvis_jcamp_2.js +221 -0
- package/dist/__tests__/fixtures/ir_jcamp.js +148 -0
- package/dist/__tests__/fixtures/ir_result.js +46 -0
- package/dist/__tests__/fixtures/ir_svg.js +8 -0
- package/dist/__tests__/fixtures/ms_jcamp.js +64 -0
- package/dist/__tests__/fixtures/nmr13c_dept_jcamp.js +3543 -0
- package/dist/__tests__/fixtures/nmr13c_jcamp.js +1229 -0
- package/dist/__tests__/fixtures/nmr15n_jcamp.js +7177 -0
- package/dist/__tests__/fixtures/nmr19f_jcamp.js +6560 -0
- package/dist/__tests__/fixtures/nmr1h_2_jcamp.js +2005 -0
- package/dist/__tests__/fixtures/nmr1h_jcamp.js +4516 -0
- package/dist/__tests__/fixtures/nmr29si_jcamp.js +3029 -0
- package/dist/__tests__/fixtures/nmr31p_jcamp.js +3418 -0
- package/dist/__tests__/fixtures/nmr_result.js +68 -0
- package/dist/__tests__/fixtures/nmr_svg.js +8 -0
- package/dist/__tests__/fixtures/phenylalanin.js +142 -0
- package/dist/__tests__/fixtures/qDescValue.js +65 -0
- package/dist/__tests__/fixtures/raman_jcamp.js +410 -0
- package/dist/__tests__/fixtures/sec_1_jcamp.js +425 -0
- package/dist/__tests__/fixtures/sec_2_jcamp.js +407 -0
- package/dist/__tests__/fixtures/sec_3_jcamp.js +408 -0
- package/dist/__tests__/fixtures/sec_4_jcamp.js +407 -0
- package/dist/__tests__/fixtures/tga_jcamp.js +4157 -0
- package/dist/__tests__/fixtures/uv_vis_jcamp.js +249 -0
- package/dist/__tests__/fixtures/xrd_jcamp_1.js +436 -0
- package/dist/__tests__/fixtures/xrd_jcamp_2.js +955 -0
- package/dist/__tests__/fixtures/xrd_jcamp_3.js +1871 -0
- package/dist/__tests__/units/components/panel/graph_selection.test.js +72 -0
- package/dist/__tests__/units/components/panel/peaks.test.js +87 -0
- package/dist/actions/curve.js +15 -14
- package/dist/actions/cyclic_voltammetry.js +40 -60
- package/dist/actions/edit_peak.js +8 -12
- package/dist/actions/forecast.js +16 -24
- package/dist/actions/integration.js +12 -18
- package/dist/actions/jcamp.js +16 -24
- package/dist/actions/layout.js +4 -6
- package/dist/actions/manager.js +20 -30
- package/dist/actions/meta.js +4 -6
- package/dist/actions/multiplicity.js +24 -36
- package/dist/actions/scan.js +12 -18
- package/dist/actions/shift.js +8 -12
- package/dist/actions/status.js +12 -18
- package/dist/actions/submit.js +16 -24
- package/dist/actions/threshold.js +20 -30
- package/dist/actions/ui.js +25 -31
- package/dist/actions/wavelength.js +4 -6
- package/dist/app.js +25 -23
- package/dist/components/cmd_bar/01_viewer.js +24 -34
- package/dist/components/cmd_bar/02_zoom.js +18 -28
- package/dist/components/cmd_bar/03_peak.js +50 -66
- package/dist/components/cmd_bar/04_integration.js +70 -84
- package/dist/components/cmd_bar/05_multiplicity.js +42 -56
- package/dist/components/cmd_bar/06_undo_redo.js +22 -36
- package/dist/components/cmd_bar/07_pecker.js +24 -34
- package/dist/components/cmd_bar/common.js +11 -7
- package/dist/components/cmd_bar/index.js +17 -23
- package/dist/components/cmd_bar/r01_layout.js +79 -56
- package/dist/components/cmd_bar/r02_scan.js +70 -87
- package/dist/components/cmd_bar/r03_threshold.js +54 -68
- package/dist/components/cmd_bar/r04_submit.js +71 -83
- package/dist/components/cmd_bar/r05_submit_btn.js +64 -72
- package/dist/components/cmd_bar/r06_predict_btn.js +142 -152
- package/dist/components/cmd_bar/r07_wavelength_btn.js +28 -36
- package/dist/components/cmd_bar/tri_btn.js +91 -113
- package/dist/components/common/chem.js +2 -3
- package/dist/components/common/comps.js +2 -2
- package/dist/components/common/draw.js +30 -11
- package/dist/components/d3_line/index.js +154 -176
- package/dist/components/d3_line/line_focus.js +595 -739
- package/dist/components/d3_multi/index.js +153 -174
- package/dist/components/d3_multi/multi_focus.js +725 -850
- package/dist/components/d3_rect/index.js +112 -134
- package/dist/components/d3_rect/rect_focus.js +163 -208
- package/dist/components/forecast/comps.js +60 -68
- package/dist/components/forecast/ir_comps.js +49 -56
- package/dist/components/forecast/ir_viewer.js +61 -68
- package/dist/components/forecast/nmr_comps.js +62 -72
- package/dist/components/forecast/nmr_viewer.js +59 -68
- package/dist/components/forecast/section_loading.js +39 -63
- package/dist/components/forecast_viewer.js +109 -119
- package/dist/components/multi_jcamps_viewer.js +97 -113
- package/dist/components/panel/compare.js +183 -192
- package/dist/components/panel/cyclic_voltamery_data.js +149 -165
- package/dist/components/panel/graph_selection.js +143 -132
- package/dist/components/panel/index.js +112 -144
- package/dist/components/panel/info.js +125 -132
- package/dist/components/panel/multiplicity.js +215 -223
- package/dist/components/panel/multiplicity_coupling.js +108 -136
- package/dist/components/panel/multiplicity_select.js +43 -51
- package/dist/components/panel/peaks.js +130 -132
- package/dist/constants/action_type.js +23 -39
- package/dist/constants/list_layout.js +7 -4
- package/dist/constants/list_shift.js +117 -103
- package/dist/constants/list_ui.js +3 -6
- package/dist/constants/list_wavelength.js +7 -8
- package/dist/fn.js +2 -3
- package/dist/helpers/brush.js +49 -65
- package/dist/helpers/calc.js +2 -4
- package/dist/helpers/carbonFeatures.js +22 -20
- package/dist/helpers/cfg.js +49 -67
- package/dist/helpers/chem.js +450 -393
- package/dist/helpers/compass.js +92 -83
- package/dist/helpers/converter.js +52 -65
- package/dist/helpers/extractParams.js +60 -52
- package/dist/helpers/extractPeaksEdit.js +29 -25
- package/dist/helpers/focus.js +2 -6
- package/dist/helpers/format.js +416 -361
- package/dist/helpers/init.js +41 -37
- package/dist/helpers/integration.js +18 -21
- package/dist/helpers/mount.js +57 -61
- package/dist/helpers/multiplicity.js +19 -24
- package/dist/helpers/multiplicity_calc.js +39 -50
- package/dist/helpers/multiplicity_complat.js +21 -47
- package/dist/helpers/multiplicity_manual.js +49 -55
- package/dist/helpers/multiplicity_verify_basic.js +108 -111
- package/dist/helpers/shift.js +15 -23
- package/dist/helpers/zoom.js +7 -11
- package/dist/index.js +680 -630
- package/dist/layer_content.js +40 -43
- package/dist/layer_init.js +162 -184
- package/dist/layer_prism.js +38 -41
- package/dist/reducers/index.js +2 -3
- package/dist/reducers/reducer_curve.js +35 -26
- package/dist/reducers/reducer_edit_peak.js +122 -98
- package/dist/reducers/reducer_forecast.js +57 -44
- package/dist/reducers/reducer_integration.js +135 -103
- package/dist/reducers/reducer_jcamp.js +49 -44
- package/dist/reducers/reducer_layout.js +5 -6
- package/dist/reducers/reducer_manager.js +5 -6
- package/dist/reducers/reducer_meta.js +5 -6
- package/dist/reducers/reducer_multiplicity.js +100 -77
- package/dist/reducers/reducer_scan.js +17 -20
- package/dist/reducers/reducer_shift.js +115 -70
- package/dist/reducers/reducer_simulation.js +7 -8
- package/dist/reducers/reducer_status.js +5 -6
- package/dist/reducers/reducer_submit.js +12 -15
- package/dist/reducers/reducer_threshold.js +5 -6
- package/dist/reducers/reducer_ui.js +5 -6
- package/dist/reducers/reducer_voltammetry.js +156 -96
- package/dist/reducers/reducer_wavelength.js +5 -6
- package/dist/reducers/undo_redo_config.js +3 -5
- package/dist/sagas/index.js +2 -15
- package/dist/sagas/saga_edit_peak.js +54 -68
- package/dist/sagas/saga_manager.js +86 -130
- package/dist/sagas/saga_meta.js +25 -31
- package/dist/sagas/saga_multi_entities.js +40 -103
- package/dist/sagas/saga_multiplicity.js +336 -406
- package/dist/sagas/saga_ui.js +296 -475
- package/dist/setupTests.js +8 -0
- package/dist/third_party/jAnalyzer.js +66 -67
- package/dist/third_party/peakInterval.js +34 -34
- package/package.json +14 -14
- package/dist/components/cmd_bar/03_peak_bk.js +0 -139
- package/dist/components/cmd_bar/04_integration_bk.js +0 -180
- package/dist/components/cmd_bar/05_multiplicity_bk.js +0 -131
- package/dist/components/cmd_bar/r01_layout_bk.js +0 -186
- package/dist/components/cmd_bar/r06_predict_btn_bk.js +0 -220
- package/dist/components/d3_line/line_focus_bk.js +0 -825
- package/dist/components/d3_multi/index_bk.js +0 -210
- package/dist/components/d3_multi/multi_focus_bk.js +0 -533
- package/dist/components/panel/compare_bk.js +0 -256
- package/dist/components/panel/cyclic_voltamery_data_bk.js +0 -292
- package/dist/components/panel/index_bk.js +0 -178
- package/dist/components/panel/info_bk.js +0 -235
- package/dist/components/panel/multiplicity_bk.js +0 -280
- package/dist/helpers/carbonFeatures_bk.js +0 -45
- package/dist/helpers/cfg_bk.js +0 -80
- package/dist/helpers/chem_bk.js +0 -787
- package/dist/helpers/compass_bk.js +0 -149
- package/dist/helpers/converter_bk.js +0 -96
- package/dist/helpers/extractPeaksEdit_bk.js +0 -53
- package/dist/helpers/format_bk.js +0 -497
- package/dist/index_bk.js +0 -640
- package/dist/layer_content_bk.js +0 -105
- package/dist/layer_init_bk.js +0 -235
- package/dist/layer_prism_bk.js +0 -133
- package/dist/reducers/reducer_edit_peak_bk.js +0 -108
- package/dist/reducers/reducer_integration_bk.js +0 -134
- package/dist/reducers/reducer_jcamp_bk.js +0 -71
- package/dist/reducers/reducer_multiplicity_bk.js +0 -126
- package/dist/reducers/reducer_shift_bk.js +0 -88
- package/dist/reducers/reducer_voltammetry_bk.js +0 -287
- package/dist/sagas/saga_edit_peak_bk.js +0 -73
- package/dist/sagas/saga_multi_entities_bk.js +0 -106
- package/dist/sagas/saga_multiplicity_bk.js +0 -351
- package/dist/sagas/saga_ui_bk.js +0 -453
|
@@ -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
|
-
|
|
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
|
-
|
|
25
|
-
(
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
(
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
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);
|