@complat/react-spectra-editor 0.10.11 → 0.10.13-alpha.10
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 +2 -2
- package/dist/actions/manager.js +10 -2
- package/dist/actions/wavelength.js +17 -0
- package/dist/components/cmd_bar/04_integration.js +9 -2
- package/dist/components/cmd_bar/05_multiplicity.js +1 -1
- package/dist/components/cmd_bar/index.js +6 -1
- package/dist/components/cmd_bar/r01_layout.js +60 -0
- package/dist/components/cmd_bar/r05_submit_btn.js +16 -6
- package/dist/components/cmd_bar/r06_predict_btn.js +12 -7
- package/dist/components/cmd_bar/r07_wavelength_btn.js +135 -0
- package/dist/components/cmd_bar/tri_btn.js +2 -2
- package/dist/components/d3_line/index.js +15 -5
- package/dist/components/d3_line/line_focus.js +209 -101
- package/dist/components/forecast_viewer.js +10 -4
- package/dist/components/panel/index.js +3 -0
- package/dist/components/panel/info.js +47 -1
- package/dist/constants/action_type.js +8 -2
- package/dist/constants/list_layout.js +6 -1
- package/dist/constants/list_shift.js +14 -1
- package/dist/constants/list_wavelength.js +36 -0
- package/dist/fn.js +4 -1
- package/dist/helpers/calc.js +6 -1
- package/dist/helpers/carbonFeatures.js +47 -0
- package/dist/helpers/cfg.js +3 -3
- package/dist/helpers/chem.js +42 -7
- package/dist/helpers/compass.js +25 -5
- package/dist/helpers/extractParams.js +7 -3
- package/dist/helpers/extractPeaksEdit.js +30 -2
- package/dist/helpers/format.js +85 -5
- package/dist/helpers/integration.js +39 -2
- package/dist/helpers/mount.js +2 -1
- package/dist/index.js +138 -15
- package/dist/layer_content.js +9 -3
- package/dist/layer_init.js +11 -1
- package/dist/layer_prism.js +3 -1
- package/dist/reducers/index.js +6 -1
- package/dist/reducers/reducer_integration.js +2 -1
- package/dist/reducers/reducer_wavelength.js +25 -0
- package/dist/reducers/undo_redo_config.js +3 -3
- package/dist/sagas/saga_manager.js +30 -2
- package/dist/sagas/saga_ui.js +1 -1
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -7,12 +7,12 @@ An editor to View and Edit Chemical Spectra data (NMR, IR and MS).
|
|
|
7
7
|
#### Installing from npm
|
|
8
8
|
With yarn
|
|
9
9
|
```
|
|
10
|
-
$ yarn add react-spectra-editor
|
|
10
|
+
$ yarn add @complat/react-spectra-editor
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Or with npm
|
|
14
14
|
```
|
|
15
|
-
$ npm i react-spectra-editor
|
|
15
|
+
$ npm i @complat/react-spectra-editor
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
#### Installing from github source
|
package/dist/actions/manager.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.resetInitMs = exports.resetInitNmr = exports.resetInitCommon = exports.resetAll = undefined;
|
|
6
|
+
exports.resetInitCommonWithIntergation = exports.resetInitMs = exports.resetInitNmr = exports.resetInitCommon = exports.resetAll = undefined;
|
|
7
7
|
|
|
8
8
|
var _action_type = require('../constants/action_type');
|
|
9
9
|
|
|
@@ -35,7 +35,15 @@ var resetInitMs = function resetInitMs(payload) {
|
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
+
var resetInitCommonWithIntergation = function resetInitCommonWithIntergation(payload) {
|
|
39
|
+
return {
|
|
40
|
+
type: _action_type.MANAGER.RESET_INIT_COMMON_WITH_INTERGATION,
|
|
41
|
+
payload: payload
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
38
45
|
exports.resetAll = resetAll;
|
|
39
46
|
exports.resetInitCommon = resetInitCommon;
|
|
40
47
|
exports.resetInitNmr = resetInitNmr;
|
|
41
|
-
exports.resetInitMs = resetInitMs;
|
|
48
|
+
exports.resetInitMs = resetInitMs;
|
|
49
|
+
exports.resetInitCommonWithIntergation = resetInitCommonWithIntergation; // eslint-disable-line
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.updateWaveLength = undefined;
|
|
7
|
+
|
|
8
|
+
var _action_type = require("../constants/action_type");
|
|
9
|
+
|
|
10
|
+
var updateWaveLength = function updateWaveLength(payload) {
|
|
11
|
+
return {
|
|
12
|
+
type: _action_type.XRD.UPDATE_WAVE_LENGTH,
|
|
13
|
+
payload: payload
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.updateWaveLength = updateWaveLength; // eslint-disable-line
|
|
@@ -52,6 +52,10 @@ var _tri_btn2 = _interopRequireDefault(_tri_btn);
|
|
|
52
52
|
|
|
53
53
|
var _common = require('./common');
|
|
54
54
|
|
|
55
|
+
var _format = require('../../helpers/format');
|
|
56
|
+
|
|
57
|
+
var _format2 = _interopRequireDefault(_format);
|
|
58
|
+
|
|
55
59
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
56
60
|
|
|
57
61
|
var styles = function styles() {
|
|
@@ -107,6 +111,7 @@ var iconColor = function iconColor(criteria) {
|
|
|
107
111
|
var Integration = function Integration(_ref) {
|
|
108
112
|
var classes = _ref.classes,
|
|
109
113
|
refFactorSt = _ref.refFactorSt,
|
|
114
|
+
ignoreRef = _ref.ignoreRef,
|
|
110
115
|
isDisableSt = _ref.isDisableSt,
|
|
111
116
|
isFocusAddIntgSt = _ref.isFocusAddIntgSt,
|
|
112
117
|
isFocusRmIntgSt = _ref.isFocusRmIntgSt,
|
|
@@ -216,7 +221,7 @@ var Integration = function Integration(_ref) {
|
|
|
216
221
|
)
|
|
217
222
|
)
|
|
218
223
|
),
|
|
219
|
-
setFactor(classes, isDisableSt, refFactorSt, setIntegrationFkrAct),
|
|
224
|
+
!ignoreRef ? setFactor(classes, isDisableSt, refFactorSt, setIntegrationFkrAct) : null,
|
|
220
225
|
_react2.default.createElement(
|
|
221
226
|
_tri_btn2.default,
|
|
222
227
|
{
|
|
@@ -245,7 +250,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
245
250
|
isFocusAddIntgSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.INTEGRATION_ADD,
|
|
246
251
|
isFocusRmIntgSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.INTEGRATION_RM,
|
|
247
252
|
isFocusSetRefSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.INTEGRATION_SET_REF,
|
|
248
|
-
refFactorSt: state.integration.present.refFactor
|
|
253
|
+
refFactorSt: state.integration.present.refFactor,
|
|
254
|
+
ignoreRef: _format2.default.isHplcUvVisLayout(state.layout)
|
|
249
255
|
}
|
|
250
256
|
);
|
|
251
257
|
};
|
|
@@ -265,6 +271,7 @@ Integration.propTypes = {
|
|
|
265
271
|
isFocusRmIntgSt: _propTypes2.default.bool.isRequired,
|
|
266
272
|
isFocusSetRefSt: _propTypes2.default.bool.isRequired,
|
|
267
273
|
refFactorSt: _propTypes2.default.number.isRequired,
|
|
274
|
+
ignoreRef: _propTypes2.default.bool.isRequired,
|
|
268
275
|
setUiSweepTypeAct: _propTypes2.default.func.isRequired,
|
|
269
276
|
setIntegrationFkrAct: _propTypes2.default.func.isRequired,
|
|
270
277
|
clearIntegrationAllAct: _propTypes2.default.func.isRequired
|
|
@@ -56,6 +56,10 @@ var _r04_submit = require('./r04_submit');
|
|
|
56
56
|
|
|
57
57
|
var _r04_submit2 = _interopRequireDefault(_r04_submit);
|
|
58
58
|
|
|
59
|
+
var _r07_wavelength_btn = require('./r07_wavelength_btn');
|
|
60
|
+
|
|
61
|
+
var _r07_wavelength_btn2 = _interopRequireDefault(_r07_wavelength_btn);
|
|
62
|
+
|
|
59
63
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
60
64
|
|
|
61
65
|
var styles = function styles() {
|
|
@@ -87,7 +91,8 @@ var CmdBar = function CmdBar(_ref) {
|
|
|
87
91
|
disabled: false
|
|
88
92
|
}),
|
|
89
93
|
_react2.default.createElement(_r03_threshold2.default, { feature: feature, hasEdit: hasEdit }),
|
|
90
|
-
_react2.default.createElement(_r01_layout2.default, { feature: feature, hasEdit: hasEdit })
|
|
94
|
+
_react2.default.createElement(_r01_layout2.default, { feature: feature, hasEdit: hasEdit }),
|
|
95
|
+
_react2.default.createElement(_r07_wavelength_btn2.default, null)
|
|
91
96
|
);
|
|
92
97
|
};
|
|
93
98
|
|
|
@@ -181,6 +181,15 @@ var layoutSelect = function layoutSelect(classes, layoutSt, updateLayoutAct) {
|
|
|
181
181
|
'UV/VIS'
|
|
182
182
|
)
|
|
183
183
|
),
|
|
184
|
+
_react2.default.createElement(
|
|
185
|
+
_MenuItem2.default,
|
|
186
|
+
{ value: _list_layout.LIST_LAYOUT.HPLC_UVVIS },
|
|
187
|
+
_react2.default.createElement(
|
|
188
|
+
'span',
|
|
189
|
+
{ className: (0, _classnames2.default)(classes.txtOpt, 'option-sv-bar-layout') },
|
|
190
|
+
'HPLC UV/VIS'
|
|
191
|
+
)
|
|
192
|
+
),
|
|
184
193
|
_react2.default.createElement(
|
|
185
194
|
_MenuItem2.default,
|
|
186
195
|
{ value: _list_layout.LIST_LAYOUT.TGA },
|
|
@@ -190,6 +199,15 @@ var layoutSelect = function layoutSelect(classes, layoutSt, updateLayoutAct) {
|
|
|
190
199
|
'TGA (THERMOGRAVIMETRIC ANALYSIS)'
|
|
191
200
|
)
|
|
192
201
|
),
|
|
202
|
+
_react2.default.createElement(
|
|
203
|
+
_MenuItem2.default,
|
|
204
|
+
{ value: _list_layout.LIST_LAYOUT.XRD },
|
|
205
|
+
_react2.default.createElement(
|
|
206
|
+
'span',
|
|
207
|
+
{ className: (0, _classnames2.default)(classes.txtOpt, 'option-sv-bar-layout') },
|
|
208
|
+
'XRD (X-RAY DIFFRACTION)'
|
|
209
|
+
)
|
|
210
|
+
),
|
|
193
211
|
_react2.default.createElement(
|
|
194
212
|
_MenuItem2.default,
|
|
195
213
|
{ value: _list_layout.LIST_LAYOUT.H1 },
|
|
@@ -232,6 +250,48 @@ var layoutSelect = function layoutSelect(classes, layoutSt, updateLayoutAct) {
|
|
|
232
250
|
'F'
|
|
233
251
|
)
|
|
234
252
|
),
|
|
253
|
+
_react2.default.createElement(
|
|
254
|
+
_MenuItem2.default,
|
|
255
|
+
{ value: _list_layout.LIST_LAYOUT.P31 },
|
|
256
|
+
_react2.default.createElement(
|
|
257
|
+
'span',
|
|
258
|
+
{ className: (0, _classnames2.default)(classes.txtOpt, 'option-sv-bar-layout') },
|
|
259
|
+
_react2.default.createElement(
|
|
260
|
+
'sup',
|
|
261
|
+
null,
|
|
262
|
+
'31'
|
|
263
|
+
),
|
|
264
|
+
'P'
|
|
265
|
+
)
|
|
266
|
+
),
|
|
267
|
+
_react2.default.createElement(
|
|
268
|
+
_MenuItem2.default,
|
|
269
|
+
{ value: _list_layout.LIST_LAYOUT.N15 },
|
|
270
|
+
_react2.default.createElement(
|
|
271
|
+
'span',
|
|
272
|
+
{ className: (0, _classnames2.default)(classes.txtOpt, 'option-sv-bar-layout') },
|
|
273
|
+
_react2.default.createElement(
|
|
274
|
+
'sup',
|
|
275
|
+
null,
|
|
276
|
+
'15'
|
|
277
|
+
),
|
|
278
|
+
'N'
|
|
279
|
+
)
|
|
280
|
+
),
|
|
281
|
+
_react2.default.createElement(
|
|
282
|
+
_MenuItem2.default,
|
|
283
|
+
{ value: _list_layout.LIST_LAYOUT.Si29 },
|
|
284
|
+
_react2.default.createElement(
|
|
285
|
+
'span',
|
|
286
|
+
{ className: (0, _classnames2.default)(classes.txtOpt, 'option-sv-bar-layout') },
|
|
287
|
+
_react2.default.createElement(
|
|
288
|
+
'sup',
|
|
289
|
+
null,
|
|
290
|
+
'29'
|
|
291
|
+
),
|
|
292
|
+
'Si'
|
|
293
|
+
)
|
|
294
|
+
),
|
|
235
295
|
_react2.default.createElement(
|
|
236
296
|
_MenuItem2.default,
|
|
237
297
|
{ value: _list_layout.LIST_LAYOUT.MS },
|
|
@@ -42,7 +42,7 @@ var styles = function styles() {
|
|
|
42
42
|
return Object.assign({}, _common.commonStyle);
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
var onClickCb = function onClickCb(operation, peaksEdit, isAscend, isIntensity, scan, thres, layoutSt, shiftSt, analysis, decimalSt, integrationSt, multiplicitySt) {
|
|
45
|
+
var onClickCb = function onClickCb(operation, peaksEdit, isAscend, isIntensity, scan, thres, layoutSt, shiftSt, analysis, decimalSt, integrationSt, multiplicitySt, allIntegrationSt, aucValues, waveLengthSt) {
|
|
46
46
|
return function () {
|
|
47
47
|
operation({
|
|
48
48
|
peaks: peaksEdit,
|
|
@@ -55,7 +55,10 @@ var onClickCb = function onClickCb(operation, peaksEdit, isAscend, isIntensity,
|
|
|
55
55
|
analysis: analysis,
|
|
56
56
|
decimal: decimalSt,
|
|
57
57
|
integration: integrationSt,
|
|
58
|
-
multiplicity: multiplicitySt
|
|
58
|
+
multiplicity: multiplicitySt,
|
|
59
|
+
allIntegration: allIntegrationSt,
|
|
60
|
+
aucValues: aucValues,
|
|
61
|
+
waveLength: waveLengthSt
|
|
59
62
|
});
|
|
60
63
|
};
|
|
61
64
|
};
|
|
@@ -74,12 +77,15 @@ var BtnSubmit = function BtnSubmit(_ref) {
|
|
|
74
77
|
forecastSt = _ref.forecastSt,
|
|
75
78
|
decimalSt = _ref.decimalSt,
|
|
76
79
|
integrationSt = _ref.integrationSt,
|
|
77
|
-
multiplicitySt = _ref.multiplicitySt
|
|
80
|
+
multiplicitySt = _ref.multiplicitySt,
|
|
81
|
+
allIntegrationSt = _ref.allIntegrationSt,
|
|
82
|
+
waveLengthSt = _ref.waveLengthSt;
|
|
78
83
|
|
|
79
84
|
var peaksEdit = (0, _extractPeaksEdit.extractPeaksEdit)(feature, editPeakSt, thresSt, shiftSt, layoutSt);
|
|
80
85
|
// const disBtn = peaksEdit.length === 0 || statusSt.btnSubmit || disabled;
|
|
81
86
|
var scan = (0, _chem.Convert2Scan)(feature, scanSt);
|
|
82
87
|
var thres = (0, _chem.Convert2Thres)(feature, thresSt);
|
|
88
|
+
var aucValues = (0, _extractPeaksEdit.extractAreaUnderCurve)(allIntegrationSt, integrationSt, layoutSt);
|
|
83
89
|
|
|
84
90
|
if (!operation) return null;
|
|
85
91
|
|
|
@@ -95,7 +101,7 @@ var BtnSubmit = function BtnSubmit(_ref) {
|
|
|
95
101
|
{
|
|
96
102
|
className: (0, _classnames2.default)('btn-sv-bar-submit'),
|
|
97
103
|
color: 'primary',
|
|
98
|
-
onClick: onClickCb(operation.value, peaksEdit, isAscend, isIntensity, scan, thres, layoutSt, shiftSt, forecastSt.predictions, decimalSt, integrationSt, multiplicitySt)
|
|
104
|
+
onClick: onClickCb(operation.value, peaksEdit, isAscend, isIntensity, scan, thres, layoutSt, shiftSt, forecastSt.predictions, decimalSt, integrationSt, multiplicitySt, allIntegrationSt, aucValues, waveLengthSt)
|
|
99
105
|
},
|
|
100
106
|
_react2.default.createElement(_PlayCircleOutline2.default, { className: classes.icon })
|
|
101
107
|
)
|
|
@@ -113,7 +119,9 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
113
119
|
forecastSt: state.forecast,
|
|
114
120
|
decimalSt: state.submit.decimal,
|
|
115
121
|
integrationSt: state.integration.present,
|
|
116
|
-
multiplicitySt: state.multiplicity.present
|
|
122
|
+
multiplicitySt: state.multiplicity.present,
|
|
123
|
+
allIntegrationSt: state.integration.past.concat(state.integration.present),
|
|
124
|
+
waveLengthSt: state.wavelength
|
|
117
125
|
}
|
|
118
126
|
);
|
|
119
127
|
};
|
|
@@ -136,7 +144,9 @@ BtnSubmit.propTypes = {
|
|
|
136
144
|
forecastSt: _propTypes2.default.object.isRequired,
|
|
137
145
|
decimalSt: _propTypes2.default.number.isRequired,
|
|
138
146
|
integrationSt: _propTypes2.default.object.isRequired,
|
|
139
|
-
multiplicitySt: _propTypes2.default.object.isRequired
|
|
147
|
+
multiplicitySt: _propTypes2.default.object.isRequired,
|
|
148
|
+
allIntegrationSt: _propTypes2.default.object.isRequired,
|
|
149
|
+
waveLengthSt: _propTypes2.default.object.isRequired
|
|
140
150
|
};
|
|
141
151
|
|
|
142
152
|
exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), (0, _styles.withStyles)(styles))(BtnSubmit);
|
|
@@ -44,6 +44,8 @@ var _format = require('../../helpers/format');
|
|
|
44
44
|
|
|
45
45
|
var _format2 = _interopRequireDefault(_format);
|
|
46
46
|
|
|
47
|
+
var _carbonFeatures = require('../../helpers/carbonFeatures');
|
|
48
|
+
|
|
47
49
|
var _extractPeaksEdit = require('../../helpers/extractPeaksEdit');
|
|
48
50
|
|
|
49
51
|
var _ui = require('../../actions/ui');
|
|
@@ -54,6 +56,8 @@ var _chem = require('../../helpers/chem');
|
|
|
54
56
|
|
|
55
57
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
56
58
|
|
|
59
|
+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
60
|
+
|
|
57
61
|
var styles = function styles() {
|
|
58
62
|
return Object.assign({}, _common.commonStyle, {
|
|
59
63
|
tTxt: {
|
|
@@ -89,7 +93,7 @@ var MuPredictButton = (0, _styles.withStyles)({
|
|
|
89
93
|
})(_Button2.default);
|
|
90
94
|
|
|
91
95
|
var onClickFail = function onClickFail(layoutSt, simuCount, realCount) {
|
|
92
|
-
var feature = 'multiplet';
|
|
96
|
+
var feature = _format2.default.is13CLayout(layoutSt) ? 'peak' : 'multiplet';
|
|
93
97
|
|
|
94
98
|
return function () {
|
|
95
99
|
return alert('Selected ' + feature + ' count (' + realCount + ') must be larger than 0, and must be eqal or less than simulated count (' + simuCount + ').');
|
|
@@ -144,15 +148,15 @@ var onClicUnknown = function onClicUnknown(feature, forecast, peaksEdit, layoutS
|
|
|
144
148
|
};
|
|
145
149
|
};
|
|
146
150
|
|
|
147
|
-
var counterText = function counterText(classes, isIr, realCount, simuCount) {
|
|
151
|
+
var counterText = function counterText(classes, isIr, realCount, uniqCount, simuCount) {
|
|
148
152
|
return isIr ? null : _react2.default.createElement(
|
|
149
153
|
'span',
|
|
150
154
|
{ className: (0, _classnames2.default)(classes.tTxt, 'txt-sv-panel-txt') },
|
|
151
|
-
realCount + '/' + simuCount
|
|
155
|
+
realCount + '/' + uniqCount + '/' + simuCount
|
|
152
156
|
);
|
|
153
157
|
};
|
|
154
158
|
|
|
155
|
-
var renderBtnPredict = function renderBtnPredict(classes, isIr, realCount, simuCount, color, btnWidthCls, onClick) {
|
|
159
|
+
var renderBtnPredict = function renderBtnPredict(classes, isIr, realCount, uniqCount, simuCount, color, btnWidthCls, onClick) {
|
|
156
160
|
return _react2.default.createElement(
|
|
157
161
|
_Tooltip2.default,
|
|
158
162
|
{
|
|
@@ -179,7 +183,7 @@ var renderBtnPredict = function renderBtnPredict(classes, isIr, realCount, simuC
|
|
|
179
183
|
style: { color: color },
|
|
180
184
|
onClick: onClick
|
|
181
185
|
},
|
|
182
|
-
counterText(classes, isIr, realCount, simuCount),
|
|
186
|
+
counterText(classes, isIr, realCount, uniqCount, simuCount),
|
|
183
187
|
_react2.default.createElement(_GpsFixedOutlined2.default, { className: classes.icon })
|
|
184
188
|
)
|
|
185
189
|
);
|
|
@@ -246,7 +250,8 @@ var BtnPredict = function BtnPredict(_ref) {
|
|
|
246
250
|
var scan = (0, _chem.Convert2Scan)(feature, scanSt);
|
|
247
251
|
var thres = (0, _chem.Convert2Thres)(feature, thresSt);
|
|
248
252
|
var simuCount = simulationSt.nmrSimPeaks.length;
|
|
249
|
-
var
|
|
253
|
+
var uniqCount = [].concat(_toConsumableArray(new Set(simulationSt.nmrSimPeaks))).length;
|
|
254
|
+
var realCount = _format2.default.is13CLayout(layoutSt) ? (0, _carbonFeatures.carbonFeatures)(peaksEdit, multiplicitySt).length : multiplicitySt.stack.length;
|
|
250
255
|
|
|
251
256
|
if (is13Cor1H && simuCount === 0) {
|
|
252
257
|
var onClickUnknownCb = onClicUnknown(feature, forecast, peaksEdit, layoutSt, scan, shiftSt, thres, forecast.predictions, integrationSt, multiplicitySt);
|
|
@@ -260,7 +265,7 @@ var BtnPredict = function BtnPredict(_ref) {
|
|
|
260
265
|
|
|
261
266
|
var btnWidthCls = isIr ? classes.btnWidthIr : classes.btnWidthNmr;
|
|
262
267
|
|
|
263
|
-
return renderBtnPredict(classes, isIr, realCount, simuCount, color, btnWidthCls, onClick);
|
|
268
|
+
return renderBtnPredict(classes, isIr, realCount, uniqCount, simuCount, color, btnWidthCls, onClick);
|
|
264
269
|
};
|
|
265
270
|
|
|
266
271
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _react = require('react');
|
|
8
|
+
|
|
9
|
+
var _react2 = _interopRequireDefault(_react);
|
|
10
|
+
|
|
11
|
+
var _propTypes = require('prop-types');
|
|
12
|
+
|
|
13
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
14
|
+
|
|
15
|
+
var _reactRedux = require('react-redux');
|
|
16
|
+
|
|
17
|
+
var _classnames = require('classnames');
|
|
18
|
+
|
|
19
|
+
var _classnames2 = _interopRequireDefault(_classnames);
|
|
20
|
+
|
|
21
|
+
var _redux = require('redux');
|
|
22
|
+
|
|
23
|
+
var _core = require('@material-ui/core');
|
|
24
|
+
|
|
25
|
+
var _styles = require('@material-ui/core/styles');
|
|
26
|
+
|
|
27
|
+
var _wavelength = require('../../actions/wavelength');
|
|
28
|
+
|
|
29
|
+
var _format = require('../../helpers/format');
|
|
30
|
+
|
|
31
|
+
var _format2 = _interopRequireDefault(_format);
|
|
32
|
+
|
|
33
|
+
var _common = require('./common');
|
|
34
|
+
|
|
35
|
+
var _list_wavelength = require('../../constants/list_wavelength');
|
|
36
|
+
|
|
37
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
38
|
+
|
|
39
|
+
var styles = function styles() {
|
|
40
|
+
return Object.assign({
|
|
41
|
+
fieldShift: {
|
|
42
|
+
width: 160
|
|
43
|
+
},
|
|
44
|
+
fieldLayout: {
|
|
45
|
+
width: 100
|
|
46
|
+
}
|
|
47
|
+
}, _common.commonStyle);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
var wavelengthSelect = function wavelengthSelect(classes, waveLengthSt, layoutSt, updateWaveLengthAct) {
|
|
51
|
+
|
|
52
|
+
if (!_format2.default.isXRDLayout(layoutSt)) {
|
|
53
|
+
return _react2.default.createElement('i', null);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
var onChange = function onChange(e) {
|
|
57
|
+
return updateWaveLengthAct(e.target.value);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return _react2.default.createElement(
|
|
61
|
+
_core.FormControl,
|
|
62
|
+
{
|
|
63
|
+
className: (0, _classnames2.default)(classes.fieldLayout),
|
|
64
|
+
variant: 'outlined'
|
|
65
|
+
},
|
|
66
|
+
_react2.default.createElement(
|
|
67
|
+
_core.InputLabel,
|
|
68
|
+
{ className: (0, _classnames2.default)(classes.selectLabel, 'select-sv-bar-label') },
|
|
69
|
+
'Wavelength'
|
|
70
|
+
),
|
|
71
|
+
_react2.default.createElement(
|
|
72
|
+
_core.Select,
|
|
73
|
+
{
|
|
74
|
+
value: waveLengthSt,
|
|
75
|
+
onChange: onChange,
|
|
76
|
+
input: _react2.default.createElement(_core.OutlinedInput, {
|
|
77
|
+
className: (0, _classnames2.default)(classes.selectInput, 'input-sv-bar-layout'),
|
|
78
|
+
labelWidth: 60
|
|
79
|
+
})
|
|
80
|
+
},
|
|
81
|
+
_list_wavelength.LIST_WAVE_LENGTH.map(function (item) {
|
|
82
|
+
return _react2.default.createElement(
|
|
83
|
+
_core.MenuItem,
|
|
84
|
+
{ value: item },
|
|
85
|
+
_react2.default.createElement(
|
|
86
|
+
'span',
|
|
87
|
+
{ className: (0, _classnames2.default)(classes.txtOpt, 'option-sv-bar-layout') },
|
|
88
|
+
item.label,
|
|
89
|
+
' (',
|
|
90
|
+
item.value,
|
|
91
|
+
' ',
|
|
92
|
+
item.unit,
|
|
93
|
+
')'
|
|
94
|
+
)
|
|
95
|
+
);
|
|
96
|
+
})
|
|
97
|
+
)
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
var Wavelength = function Wavelength(_ref) {
|
|
102
|
+
var classes = _ref.classes,
|
|
103
|
+
waveLengthSt = _ref.waveLengthSt,
|
|
104
|
+
layoutSt = _ref.layoutSt,
|
|
105
|
+
updateWaveLengthAct = _ref.updateWaveLengthAct;
|
|
106
|
+
return _react2.default.createElement(
|
|
107
|
+
'span',
|
|
108
|
+
{ className: classes.groupRight },
|
|
109
|
+
wavelengthSelect(classes, waveLengthSt, layoutSt, updateWaveLengthAct)
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
var mapStateToProps = function mapStateToProps(state, props) {
|
|
114
|
+
return (// eslint-disable-line
|
|
115
|
+
{
|
|
116
|
+
waveLengthSt: state.wavelength,
|
|
117
|
+
layoutSt: state.layout
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
123
|
+
return (0, _redux.bindActionCreators)({
|
|
124
|
+
updateWaveLengthAct: _wavelength.updateWaveLength
|
|
125
|
+
}, dispatch);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
Wavelength.propTypes = {
|
|
129
|
+
classes: _propTypes2.default.object.isRequired,
|
|
130
|
+
layoutSt: _propTypes2.default.string.isRequired,
|
|
131
|
+
waveLengthSt: _propTypes2.default.object.isRequired,
|
|
132
|
+
updateWaveLengthAct: _propTypes2.default.func.isRequired
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)((0, _styles.withStyles)(styles)(Wavelength));
|
|
@@ -109,7 +109,7 @@ var TriBtn = function (_React$Component) {
|
|
|
109
109
|
_common.MuButton,
|
|
110
110
|
{
|
|
111
111
|
className: (0, _classnames2.default)('btn-sv-bar-one'),
|
|
112
|
-
disabled: _cfg2.default.btnCmdMpy(layoutSt),
|
|
112
|
+
disabled: _cfg2.default.btnCmdMpy(layoutSt) && _cfg2.default.btnCmdIntg(layoutSt),
|
|
113
113
|
onClick: this.onToggle
|
|
114
114
|
},
|
|
115
115
|
children
|
|
@@ -134,7 +134,7 @@ var TriBtn = function (_React$Component) {
|
|
|
134
134
|
|
|
135
135
|
return _react2.default.createElement(
|
|
136
136
|
'span',
|
|
137
|
-
{ disabled: _cfg2.default.btnCmdMpy(layoutSt) },
|
|
137
|
+
{ disabled: _cfg2.default.btnCmdMpy(layoutSt) && _cfg2.default.btnCmdIntg(layoutSt) },
|
|
138
138
|
_react2.default.createElement(
|
|
139
139
|
'span',
|
|
140
140
|
{ className: (0, _classnames2.default)(classes.txtLabel, 'txt-sv-bar-desc') },
|
|
@@ -86,6 +86,7 @@ var ViewerLine = function (_React$Component) {
|
|
|
86
86
|
isUiAddIntgSt = _props.isUiAddIntgSt,
|
|
87
87
|
isUiNoBrushSt = _props.isUiNoBrushSt,
|
|
88
88
|
isHidden = _props.isHidden,
|
|
89
|
+
wavelength = _props.wavelength,
|
|
89
90
|
resetAllAct = _props.resetAllAct;
|
|
90
91
|
|
|
91
92
|
(0, _draw.drawDestroy)(this.rootKlass);
|
|
@@ -108,7 +109,8 @@ var ViewerLine = function (_React$Component) {
|
|
|
108
109
|
mtplySt: mtplySt,
|
|
109
110
|
sweepExtentSt: sweepExtentSt,
|
|
110
111
|
isUiAddIntgSt: isUiAddIntgSt,
|
|
111
|
-
isUiNoBrushSt: isUiNoBrushSt
|
|
112
|
+
isUiNoBrushSt: isUiNoBrushSt,
|
|
113
|
+
wavelength: wavelength
|
|
112
114
|
});
|
|
113
115
|
(0, _draw.drawLabel)(this.rootKlass, cLabel, xLabel, yLabel);
|
|
114
116
|
(0, _draw.drawDisplay)(this.rootKlass, isHidden);
|
|
@@ -119,6 +121,9 @@ var ViewerLine = function (_React$Component) {
|
|
|
119
121
|
var _props2 = this.props,
|
|
120
122
|
seed = _props2.seed,
|
|
121
123
|
peak = _props2.peak,
|
|
124
|
+
cLabel = _props2.cLabel,
|
|
125
|
+
xLabel = _props2.xLabel,
|
|
126
|
+
yLabel = _props2.yLabel,
|
|
122
127
|
freq = _props2.freq,
|
|
123
128
|
comparisons = _props2.comparisons,
|
|
124
129
|
tTrEndPts = _props2.tTrEndPts,
|
|
@@ -130,7 +135,8 @@ var ViewerLine = function (_React$Component) {
|
|
|
130
135
|
sweepExtentSt = _props2.sweepExtentSt,
|
|
131
136
|
isUiAddIntgSt = _props2.isUiAddIntgSt,
|
|
132
137
|
isUiNoBrushSt = _props2.isUiNoBrushSt,
|
|
133
|
-
isHidden = _props2.isHidden
|
|
138
|
+
isHidden = _props2.isHidden,
|
|
139
|
+
wavelength = _props2.wavelength;
|
|
134
140
|
|
|
135
141
|
this.normChange(prevProps);
|
|
136
142
|
|
|
@@ -150,8 +156,10 @@ var ViewerLine = function (_React$Component) {
|
|
|
150
156
|
mtplySt: mtplySt,
|
|
151
157
|
sweepExtentSt: sweepExtentSt,
|
|
152
158
|
isUiAddIntgSt: isUiAddIntgSt,
|
|
153
|
-
isUiNoBrushSt: isUiNoBrushSt
|
|
159
|
+
isUiNoBrushSt: isUiNoBrushSt,
|
|
160
|
+
wavelength: wavelength
|
|
154
161
|
});
|
|
162
|
+
(0, _draw.drawLabel)(this.rootKlass, cLabel, xLabel, yLabel);
|
|
155
163
|
(0, _draw.drawDisplay)(this.rootKlass, isHidden);
|
|
156
164
|
}
|
|
157
165
|
}, {
|
|
@@ -195,7 +203,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
195
203
|
mtplySt: state.multiplicity.present,
|
|
196
204
|
sweepExtentSt: state.ui.sweepExtent,
|
|
197
205
|
isUiAddIntgSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.INTEGRATION_ADD,
|
|
198
|
-
isUiNoBrushSt: _list_ui.LIST_NON_BRUSH_TYPES.indexOf(state.ui.sweepType) < 0
|
|
206
|
+
isUiNoBrushSt: _list_ui.LIST_NON_BRUSH_TYPES.indexOf(state.ui.sweepType) < 0,
|
|
207
|
+
wavelength: state.wavelength
|
|
199
208
|
};
|
|
200
209
|
};
|
|
201
210
|
|
|
@@ -230,7 +239,8 @@ ViewerLine.propTypes = {
|
|
|
230
239
|
clickUiTargetAct: _propTypes2.default.func.isRequired,
|
|
231
240
|
selectUiSweepAct: _propTypes2.default.func.isRequired,
|
|
232
241
|
scrollUiWheelAct: _propTypes2.default.func.isRequired,
|
|
233
|
-
isHidden: _propTypes2.default.bool.isRequired
|
|
242
|
+
isHidden: _propTypes2.default.bool.isRequired,
|
|
243
|
+
wavelength: _propTypes2.default.object.isRequired
|
|
234
244
|
};
|
|
235
245
|
|
|
236
246
|
exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(ViewerLine);
|