@complat/react-spectra-editor 1.3.2 → 1.3.5
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/dist/__tests__/fixtures/gc_1_jcamp.js +18061 -0
- package/dist/__tests__/fixtures/gc_2_jcamp.js +18060 -0
- package/dist/__tests__/fixtures/gc_3_jcamp.js +780 -0
- package/dist/__tests__/fixtures/hplc_uvvis_jcamp.js +18063 -574
- package/dist/__tests__/fixtures/hplc_uvvis_jcamp_2.js +12077 -163
- package/dist/app.js +4 -4
- package/dist/components/cmd_bar/r01_layout.js +4 -0
- package/dist/components/d3_line/line_focus.js +1 -1
- package/dist/components/d3_multi/multi_focus.js +5 -4
- package/dist/components/multi_jcamps_viewer.js +16 -6
- package/dist/components/panel/graph_selection.js +11 -2
- package/dist/components/panel/index.js +3 -3
- package/dist/components/panel/info.js +5 -5
- package/dist/constants/list_layout.js +2 -1
- package/dist/helpers/cfg.js +1 -1
- package/dist/helpers/chem.js +4 -1
- package/dist/helpers/extractPeaksEdit.js +9 -2
- package/dist/helpers/format.js +10 -3
- package/dist/helpers/integration.js +4 -1
- package/dist/index.js +19 -1
- package/dist/layer_init.js +5 -5
- package/dist/layer_prism.js +3 -3
- package/dist/sagas/saga_multi_entities.js +45 -1
- package/package.json +3 -2
package/dist/app.js
CHANGED
|
@@ -56,7 +56,7 @@ const SpectraEditor = _ref => {
|
|
|
56
56
|
molSvg,
|
|
57
57
|
editorOnly,
|
|
58
58
|
descriptions,
|
|
59
|
-
|
|
59
|
+
exactMass,
|
|
60
60
|
canChangeDescription,
|
|
61
61
|
onDescriptionChanged,
|
|
62
62
|
multiEntities,
|
|
@@ -83,7 +83,7 @@ const SpectraEditor = _ref => {
|
|
|
83
83
|
molSvg: molSvg,
|
|
84
84
|
multiMolSvgs: multiMolSvgs,
|
|
85
85
|
editorOnly: editorOnly,
|
|
86
|
-
|
|
86
|
+
exactMass: exactMass,
|
|
87
87
|
canChangeDescription: canChangeDescription,
|
|
88
88
|
onDescriptionChanged: onDescriptionChanged
|
|
89
89
|
})));
|
|
@@ -106,7 +106,7 @@ SpectraEditor.propTypes = {
|
|
|
106
106
|
canChangeDescription: _propTypes.default.bool,
|
|
107
107
|
onDescriptionChanged: _propTypes.default.func,
|
|
108
108
|
userManualLink: _propTypes.default.object,
|
|
109
|
-
|
|
109
|
+
exactMass: _propTypes.default.string
|
|
110
110
|
};
|
|
111
111
|
SpectraEditor.defaultProps = {
|
|
112
112
|
others: {
|
|
@@ -122,7 +122,7 @@ SpectraEditor.defaultProps = {
|
|
|
122
122
|
operations: [],
|
|
123
123
|
descriptions: [],
|
|
124
124
|
molSvg: '',
|
|
125
|
-
|
|
125
|
+
exactMass: '',
|
|
126
126
|
multiMolSvgs: [],
|
|
127
127
|
editorOnly: false,
|
|
128
128
|
canChangeDescription: false,
|
|
@@ -156,6 +156,10 @@ const layoutSelect = (classes, layoutSt, updateLayoutAct) => {
|
|
|
156
156
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
157
157
|
className: (0, _classnames.default)(classes.txtOpt, 'option-sv-bar-layout')
|
|
158
158
|
}, "SEC")), /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
|
|
159
|
+
value: _list_layout.LIST_LAYOUT.GC
|
|
160
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
161
|
+
className: (0, _classnames.default)(classes.txtOpt, 'option-sv-bar-layout')
|
|
162
|
+
}, "GC (GAS CHROMATOGRAPHY)")), /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
|
|
159
163
|
value: _list_layout.LIST_LAYOUT.AIF
|
|
160
164
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
161
165
|
className: (0, _classnames.default)(classes.txtOpt, 'option-sv-bar-layout')
|
|
@@ -596,7 +596,7 @@ class LineFocus {
|
|
|
596
596
|
return null;
|
|
597
597
|
}
|
|
598
598
|
reverseXAxis(layoutSt) {
|
|
599
|
-
return [_list_layout.LIST_LAYOUT.UVVIS, _list_layout.LIST_LAYOUT.HPLC_UVVIS, _list_layout.LIST_LAYOUT.TGA, _list_layout.LIST_LAYOUT.DSC, _list_layout.LIST_LAYOUT.XRD, _list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY, _list_layout.LIST_LAYOUT.CDS, _list_layout.LIST_LAYOUT.DLS_ACF, _list_layout.LIST_LAYOUT.SEC, _list_layout.LIST_LAYOUT.EMISSIONS, _list_layout.LIST_LAYOUT.DLS_INTENSITY].indexOf(layoutSt) < 0;
|
|
599
|
+
return [_list_layout.LIST_LAYOUT.UVVIS, _list_layout.LIST_LAYOUT.HPLC_UVVIS, _list_layout.LIST_LAYOUT.TGA, _list_layout.LIST_LAYOUT.DSC, _list_layout.LIST_LAYOUT.XRD, _list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY, _list_layout.LIST_LAYOUT.CDS, _list_layout.LIST_LAYOUT.DLS_ACF, _list_layout.LIST_LAYOUT.SEC, _list_layout.LIST_LAYOUT.GC, _list_layout.LIST_LAYOUT.EMISSIONS, _list_layout.LIST_LAYOUT.DLS_INTENSITY].indexOf(layoutSt) < 0;
|
|
600
600
|
}
|
|
601
601
|
create(_ref) {
|
|
602
602
|
let {
|
|
@@ -171,16 +171,17 @@ class MultiFocus {
|
|
|
171
171
|
if (idx === jcampIdx) {
|
|
172
172
|
this.data = [...currData];
|
|
173
173
|
this.pathColor = color;
|
|
174
|
-
filterSubLayoutValue = feature.xUnit;
|
|
174
|
+
filterSubLayoutValue = _format.default.isSECLayout(layout) ? feature.xUnit : feature.yUnit;
|
|
175
175
|
} else {
|
|
176
|
+
const filterValue = _format.default.isSECLayout(layout) ? feature.xUnit : feature.yUnit;
|
|
176
177
|
this.otherLineData.push({
|
|
177
178
|
data: currData,
|
|
178
179
|
color,
|
|
179
|
-
filterSublayout:
|
|
180
|
+
filterSublayout: filterValue
|
|
180
181
|
});
|
|
181
182
|
}
|
|
182
183
|
});
|
|
183
|
-
if (_format.default.isSECLayout(layout)) {
|
|
184
|
+
if (_format.default.isSECLayout(layout) || _format.default.isGCLayout(layout)) {
|
|
184
185
|
this.otherLineData = this.otherLineData.filter(data => {
|
|
185
186
|
return data.filterSublayout === filterSubLayoutValue;
|
|
186
187
|
});
|
|
@@ -785,7 +786,7 @@ class MultiFocus {
|
|
|
785
786
|
ccp.enter().append('path').attr('d', lineSymbol).attr('class', 'enter-ref').attr('fill', 'green').attr('fill-opacity', 0.8).merge(ccp).attr('transform', d => `translate(${xt(d.x)}, ${yt(d.y)})`);
|
|
786
787
|
}
|
|
787
788
|
reverseXAxis(layoutSt) {
|
|
788
|
-
return [_list_layout.LIST_LAYOUT.UVVIS, _list_layout.LIST_LAYOUT.HPLC_UVVIS, _list_layout.LIST_LAYOUT.TGA, _list_layout.LIST_LAYOUT.DSC, _list_layout.LIST_LAYOUT.XRD, _list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY, _list_layout.LIST_LAYOUT.CDS, _list_layout.LIST_LAYOUT.SEC, _list_layout.LIST_LAYOUT.AIF].indexOf(layoutSt) < 0;
|
|
789
|
+
return [_list_layout.LIST_LAYOUT.UVVIS, _list_layout.LIST_LAYOUT.HPLC_UVVIS, _list_layout.LIST_LAYOUT.TGA, _list_layout.LIST_LAYOUT.DSC, _list_layout.LIST_LAYOUT.XRD, _list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY, _list_layout.LIST_LAYOUT.CDS, _list_layout.LIST_LAYOUT.SEC, _list_layout.LIST_LAYOUT.GC, _list_layout.LIST_LAYOUT.AIF].indexOf(layoutSt) < 0;
|
|
789
790
|
}
|
|
790
791
|
create(_ref) {
|
|
791
792
|
let {
|
|
@@ -17,6 +17,7 @@ var _index3 = _interopRequireDefault(require("./d3_multi/index"));
|
|
|
17
17
|
var _curve = require("../actions/curve");
|
|
18
18
|
var _cyclic_voltammetry = require("../actions/cyclic_voltammetry");
|
|
19
19
|
var _list_layout = require("../constants/list_layout");
|
|
20
|
+
var _format = _interopRequireDefault(require("../helpers/format"));
|
|
20
21
|
/* eslint-disable react/default-props-match-prop-types,
|
|
21
22
|
react/require-default-props, react/no-unused-prop-types, react/jsx-boolean-value,
|
|
22
23
|
prefer-object-spread */
|
|
@@ -62,11 +63,13 @@ class MultiJcampsViewer extends _react.default.Component {
|
|
|
62
63
|
entities,
|
|
63
64
|
userManualLink,
|
|
64
65
|
molSvg,
|
|
65
|
-
|
|
66
|
-
layoutSt
|
|
66
|
+
exactMass,
|
|
67
|
+
layoutSt,
|
|
68
|
+
integrationSt
|
|
67
69
|
} = this.props;
|
|
68
70
|
if (!entities || entities.length === 0) return /*#__PURE__*/_react.default.createElement("div", null);
|
|
69
|
-
const
|
|
71
|
+
const separateCondition = _format.default.isGCLayout(layoutSt) ? 'yUnit' : 'xUnit';
|
|
72
|
+
const seperatedSubLayouts = seperatingSubLayout(entities, separateCondition, layoutSt);
|
|
70
73
|
const {
|
|
71
74
|
curveIdx
|
|
72
75
|
} = curveSt;
|
|
@@ -75,6 +78,10 @@ class MultiJcampsViewer extends _react.default.Component {
|
|
|
75
78
|
feature,
|
|
76
79
|
topic
|
|
77
80
|
} = entity;
|
|
81
|
+
const {
|
|
82
|
+
integrations
|
|
83
|
+
} = integrationSt;
|
|
84
|
+
const currentIntegration = integrations[curveIdx];
|
|
78
85
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
79
86
|
className: classes.root
|
|
80
87
|
}, /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
@@ -105,8 +112,9 @@ class MultiJcampsViewer extends _react.default.Component {
|
|
|
105
112
|
userManualLink: userManualLink,
|
|
106
113
|
feature: feature,
|
|
107
114
|
molSvg: molSvg,
|
|
108
|
-
|
|
115
|
+
exactMass: exactMass,
|
|
109
116
|
subLayoutsInfo: seperatedSubLayouts,
|
|
117
|
+
integration: currentIntegration,
|
|
110
118
|
descriptions: "",
|
|
111
119
|
canChangeDescription: () => {},
|
|
112
120
|
onDescriptionChanged: () => {}
|
|
@@ -119,7 +127,8 @@ const mapStateToProps = (state, _) => (
|
|
|
119
127
|
curveSt: state.curve,
|
|
120
128
|
cyclicVoltaSt: state.cyclicvolta,
|
|
121
129
|
entities: state.curve.listCurves,
|
|
122
|
-
layoutSt: state.layout
|
|
130
|
+
layoutSt: state.layout,
|
|
131
|
+
integrationSt: state.integration.present
|
|
123
132
|
});
|
|
124
133
|
const mapDispatchToProps = dispatch => (0, _redux.bindActionCreators)({
|
|
125
134
|
setAllCurvesAct: _curve.setAllCurves,
|
|
@@ -143,7 +152,8 @@ MultiJcampsViewer.propTypes = {
|
|
|
143
152
|
userManualLink: _propTypes.default.object,
|
|
144
153
|
entities: _propTypes.default.array,
|
|
145
154
|
layoutSt: _propTypes.default.string.isRequired,
|
|
146
|
-
|
|
155
|
+
exactMass: _propTypes.default.string,
|
|
156
|
+
integrationSt: _propTypes.default.object.isRequired
|
|
147
157
|
};
|
|
148
158
|
MultiJcampsViewer.defaultProps = {
|
|
149
159
|
multiEntities: [],
|
|
@@ -61,10 +61,13 @@ const GraphSelectionPanel = _ref => {
|
|
|
61
61
|
toggleShowAllCurveAct
|
|
62
62
|
} = _ref;
|
|
63
63
|
let subLayoutValues = [];
|
|
64
|
-
if (subLayoutsInfo
|
|
64
|
+
if (subLayoutsInfo) {
|
|
65
65
|
subLayoutValues = Object.keys(subLayoutsInfo);
|
|
66
66
|
}
|
|
67
67
|
const [selectedSubLayout, setSelectedSublayout] = (0, _react.useState)(subLayoutValues[0]);
|
|
68
|
+
(0, _react.useEffect)(() => {
|
|
69
|
+
setSelectedSublayout(subLayoutValues[0]);
|
|
70
|
+
}, subLayoutValues);
|
|
68
71
|
if (!curveSt) {
|
|
69
72
|
return /*#__PURE__*/_react.default.createElement("span", null);
|
|
70
73
|
}
|
|
@@ -144,13 +147,19 @@ const GraphSelectionPanel = _ref => {
|
|
|
144
147
|
onChange: onChangeTabSubLayout
|
|
145
148
|
}, subLayoutValues.map((subLayout, i) => {
|
|
146
149
|
let subLayoutName = '';
|
|
147
|
-
switch (subLayout) {
|
|
150
|
+
switch (subLayout.toUpperCase()) {
|
|
148
151
|
case 'G/MOL':
|
|
149
152
|
subLayoutName = 'MWD';
|
|
150
153
|
break;
|
|
151
154
|
case 'MILLILITERS':
|
|
152
155
|
subLayoutName = 'ELU';
|
|
153
156
|
break;
|
|
157
|
+
case 'INTENSITY':
|
|
158
|
+
subLayoutName = 'Chromatogram';
|
|
159
|
+
break;
|
|
160
|
+
case 'DEGREES CELSIUS':
|
|
161
|
+
subLayoutName = 'Temperature';
|
|
162
|
+
break;
|
|
154
163
|
default:
|
|
155
164
|
break;
|
|
156
165
|
}
|
|
@@ -85,7 +85,7 @@ class PanelViewer extends _react.default.Component {
|
|
|
85
85
|
curveSt,
|
|
86
86
|
userManualLink,
|
|
87
87
|
subLayoutsInfo,
|
|
88
|
-
|
|
88
|
+
exactMass
|
|
89
89
|
} = this.props;
|
|
90
90
|
const onExapndInfo = () => this.onExapnd('info');
|
|
91
91
|
const onExapndPeak = () => this.onExapnd('peak');
|
|
@@ -115,7 +115,7 @@ class PanelViewer extends _react.default.Component {
|
|
|
115
115
|
editorOnly: editorOnly,
|
|
116
116
|
expand: expand === 'info',
|
|
117
117
|
molSvg: molSvg,
|
|
118
|
-
|
|
118
|
+
exactMass: exactMass,
|
|
119
119
|
onExapnd: onExapndInfo,
|
|
120
120
|
descriptions: descriptions,
|
|
121
121
|
canChangeDescription: canChangeDescription,
|
|
@@ -159,7 +159,7 @@ PanelViewer.propTypes = {
|
|
|
159
159
|
userManualLink: _propTypes.default.object,
|
|
160
160
|
curveSt: _propTypes.default.object.isRequired,
|
|
161
161
|
subLayoutsInfo: _propTypes.default.object,
|
|
162
|
-
|
|
162
|
+
exactMass: _propTypes.default.string
|
|
163
163
|
};
|
|
164
164
|
var _default = exports.default = (0, _reactRedux.connect)(
|
|
165
165
|
// eslint-disable-line
|
|
@@ -231,7 +231,7 @@ const InfoPanel = _ref3 => {
|
|
|
231
231
|
simulationSt,
|
|
232
232
|
shiftSt,
|
|
233
233
|
curveSt,
|
|
234
|
-
|
|
234
|
+
exactMass,
|
|
235
235
|
onExapnd,
|
|
236
236
|
canChangeDescription,
|
|
237
237
|
onDescriptionChanged,
|
|
@@ -313,13 +313,13 @@ const InfoPanel = _ref3 => {
|
|
|
313
313
|
className: (0, _classnames.default)(classes.tTxt, classes.tHead, 'txt-sv-panel-txt')
|
|
314
314
|
}, "Solv : "), /*#__PURE__*/_react.default.createElement("span", {
|
|
315
315
|
className: (0, _classnames.default)(classes.tTxt, 'txt-sv-panel-txt')
|
|
316
|
-
}, showSolvName)) : null, _format.default.isMsLayout(layoutSt) &&
|
|
316
|
+
}, showSolvName)) : null, _format.default.isMsLayout(layoutSt) && exactMass ? /*#__PURE__*/_react.default.createElement("div", {
|
|
317
317
|
className: (0, _classnames.default)(classes.rowRoot, classes.rowOdd)
|
|
318
318
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
319
319
|
className: (0, _classnames.default)(classes.tTxt, classes.tHead, 'txt-sv-panel-txt')
|
|
320
|
-
}, "
|
|
320
|
+
}, "Exact mass: "), /*#__PURE__*/_react.default.createElement("span", {
|
|
321
321
|
className: (0, _classnames.default)(classes.tTxt, 'txt-sv-panel-txt')
|
|
322
|
-
}, `${parseFloat(
|
|
322
|
+
}, `${parseFloat(exactMass).toFixed(6)} g/mol`)) : null, /*#__PURE__*/_react.default.createElement(SECData, {
|
|
323
323
|
classes: classes,
|
|
324
324
|
layout: layoutSt,
|
|
325
325
|
detector: selectedDetector,
|
|
@@ -383,7 +383,7 @@ InfoPanel.propTypes = {
|
|
|
383
383
|
onExapnd: _propTypes.default.func.isRequired,
|
|
384
384
|
canChangeDescription: _propTypes.default.bool.isRequired,
|
|
385
385
|
onDescriptionChanged: _propTypes.default.func,
|
|
386
|
-
|
|
386
|
+
exactMass: _propTypes.default.string,
|
|
387
387
|
detectorSt: _propTypes.default.object.isRequired,
|
|
388
388
|
metaSt: _propTypes.default.object.isRequired,
|
|
389
389
|
updateDSCMetaDataAct: _propTypes.default.func.isRequired
|
package/dist/helpers/cfg.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _format = _interopRequireDefault(require("./format"));
|
|
9
|
-
const btnCmdAnaViewer = layoutSt => _format.default.isMsLayout(layoutSt) || _format.default.isRamanLayout(layoutSt) || _format.default.is19FLayout(layoutSt) || _format.default.isUvVisLayout(layoutSt) || _format.default.isHplcUvVisLayout(layoutSt) || _format.default.isTGALayout(layoutSt) || _format.default.isDSCLayout(layoutSt) || _format.default.isXRDLayout(layoutSt) || _format.default.is31PLayout(layoutSt) || _format.default.is15NLayout(layoutSt) || _format.default.is29SiLayout(layoutSt) || _format.default.isCyclicVoltaLayout(layoutSt) || _format.default.isCDSLayout(layoutSt) || _format.default.isSECLayout(layoutSt);
|
|
9
|
+
const btnCmdAnaViewer = layoutSt => _format.default.isMsLayout(layoutSt) || _format.default.isRamanLayout(layoutSt) || _format.default.is19FLayout(layoutSt) || _format.default.isUvVisLayout(layoutSt) || _format.default.isHplcUvVisLayout(layoutSt) || _format.default.isTGALayout(layoutSt) || _format.default.isDSCLayout(layoutSt) || _format.default.isXRDLayout(layoutSt) || _format.default.is31PLayout(layoutSt) || _format.default.is15NLayout(layoutSt) || _format.default.is29SiLayout(layoutSt) || _format.default.isCyclicVoltaLayout(layoutSt) || _format.default.isCDSLayout(layoutSt) || _format.default.isSECLayout(layoutSt) || _format.default.isGCLayout(layoutSt);
|
|
10
10
|
const hideCmdAnaViewer = () => false;
|
|
11
11
|
const btnCmdAddPeak = layoutSt => _format.default.isMsLayout(layoutSt);
|
|
12
12
|
const btnCmdRmPeak = layoutSt => _format.default.isMsLayout(layoutSt);
|
package/dist/helpers/chem.js
CHANGED
|
@@ -368,6 +368,9 @@ const readLayout = jcamp => {
|
|
|
368
368
|
if (dataType.includes('SIZE EXCLUSION CHROMATOGRAPHY')) {
|
|
369
369
|
return _list_layout.LIST_LAYOUT.SEC;
|
|
370
370
|
}
|
|
371
|
+
if (dataType.includes('GAS CHROMATOGRAPHY')) {
|
|
372
|
+
return _list_layout.LIST_LAYOUT.GC;
|
|
373
|
+
}
|
|
371
374
|
if (dataType.includes('SORPTION-DESORPTION MEASUREMENT')) {
|
|
372
375
|
return _list_layout.LIST_LAYOUT.AIF;
|
|
373
376
|
}
|
|
@@ -839,7 +842,7 @@ const ExtractJcamp = source => {
|
|
|
839
842
|
layout,
|
|
840
843
|
temperature
|
|
841
844
|
};
|
|
842
|
-
} else if (_format.default.isCyclicVoltaLayout(layout) || _format.default.isSECLayout(layout) || _format.default.isAIFLayout(layout) || _format.default.isCDSLayout(layout)) {
|
|
845
|
+
} else if (_format.default.isCyclicVoltaLayout(layout) || _format.default.isSECLayout(layout) || _format.default.isAIFLayout(layout) || _format.default.isCDSLayout(layout) || _format.default.isGCLayout(layout)) {
|
|
843
846
|
features = extrFeaturesCylicVolta(jcamp, layout, peakUp);
|
|
844
847
|
} else {
|
|
845
848
|
features = extrFeaturesNi(jcamp, layout, peakUp, spectra);
|
|
@@ -59,8 +59,15 @@ const extractAreaUnderCurve = (allIntegrationSt, presentIntegrationSt, layoutSt)
|
|
|
59
59
|
if (_format.default.isHplcUvVisLayout(layoutSt) && Array.isArray(allIntegrationSt) && presentIntegrationSt) {
|
|
60
60
|
const results = [];
|
|
61
61
|
allIntegrationSt.forEach(inte => {
|
|
62
|
-
const
|
|
63
|
-
|
|
62
|
+
const {
|
|
63
|
+
integrations
|
|
64
|
+
} = inte;
|
|
65
|
+
const subResults = [];
|
|
66
|
+
integrations.forEach(subInte => {
|
|
67
|
+
const aucVal = getAUCValue(subInte, layoutSt);
|
|
68
|
+
subResults.push(aucVal);
|
|
69
|
+
});
|
|
70
|
+
results.push(subResults);
|
|
64
71
|
});
|
|
65
72
|
return results;
|
|
66
73
|
}
|
package/dist/helpers/format.js
CHANGED
|
@@ -24,6 +24,7 @@ const spectraDigit = layout => {
|
|
|
24
24
|
case _list_layout.LIST_LAYOUT.XRD:
|
|
25
25
|
case _list_layout.LIST_LAYOUT.CDS:
|
|
26
26
|
case _list_layout.LIST_LAYOUT.SEC:
|
|
27
|
+
case _list_layout.LIST_LAYOUT.GC:
|
|
27
28
|
case _list_layout.LIST_LAYOUT.MS:
|
|
28
29
|
return 0;
|
|
29
30
|
case _list_layout.LIST_LAYOUT.C13:
|
|
@@ -135,6 +136,10 @@ const spectraOps = {
|
|
|
135
136
|
head: 'SIZE EXCLUSION CHROMATOGRAPHY',
|
|
136
137
|
tail: '.'
|
|
137
138
|
},
|
|
139
|
+
[_list_layout.LIST_LAYOUT.GC]: {
|
|
140
|
+
head: 'GAS CHROMATOGRAPHY',
|
|
141
|
+
tail: '.'
|
|
142
|
+
},
|
|
138
143
|
[_list_layout.LIST_LAYOUT.EMISSIONS]: {
|
|
139
144
|
head: 'EMISSION',
|
|
140
145
|
tail: '.'
|
|
@@ -416,7 +421,7 @@ const peaksBody = _ref => {
|
|
|
416
421
|
if (layout === _list_layout.LIST_LAYOUT.DLS_INTENSITY) {
|
|
417
422
|
return formatedDLSIntensity(ordered, maxY, decimal, isAscend, isIntensity, boundary, false);
|
|
418
423
|
}
|
|
419
|
-
if (layout === _list_layout.LIST_LAYOUT.RAMAN || layout === _list_layout.LIST_LAYOUT.TGA || layout === _list_layout.LIST_LAYOUT.DSC || layout === _list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY || layout === _list_layout.LIST_LAYOUT.CDS || layout === _list_layout.LIST_LAYOUT.SEC) {
|
|
424
|
+
if (layout === _list_layout.LIST_LAYOUT.RAMAN || layout === _list_layout.LIST_LAYOUT.TGA || layout === _list_layout.LIST_LAYOUT.DSC || layout === _list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY || layout === _list_layout.LIST_LAYOUT.CDS || layout === _list_layout.LIST_LAYOUT.SEC || layout === _list_layout.LIST_LAYOUT.GC) {
|
|
420
425
|
return formatedEm(ordered, maxY, decimal, isAscend, isIntensity, boundary, false);
|
|
421
426
|
}
|
|
422
427
|
if (layout === _list_layout.LIST_LAYOUT.XRD) {
|
|
@@ -464,8 +469,9 @@ const isXRDLayout = layoutSt => _list_layout.LIST_LAYOUT.XRD === layoutSt;
|
|
|
464
469
|
const isCyclicVoltaLayout = layoutSt => _list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY === layoutSt;
|
|
465
470
|
const isCDSLayout = layoutSt => _list_layout.LIST_LAYOUT.CDS === layoutSt;
|
|
466
471
|
const isSECLayout = layoutSt => _list_layout.LIST_LAYOUT.SEC === layoutSt;
|
|
472
|
+
const isGCLayout = layoutSt => _list_layout.LIST_LAYOUT.GC === layoutSt;
|
|
467
473
|
const isEmWaveLayout = layoutSt => [_list_layout.LIST_LAYOUT.IR, _list_layout.LIST_LAYOUT.RAMAN, _list_layout.LIST_LAYOUT.UVVIS, _list_layout.LIST_LAYOUT.HPLC_UVVIS].indexOf(layoutSt) >= 0;
|
|
468
|
-
const hasMultiCurves = layoutSt => [_list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY, _list_layout.LIST_LAYOUT.SEC, _list_layout.LIST_LAYOUT.AIF].indexOf(layoutSt) >= 0;
|
|
474
|
+
const hasMultiCurves = layoutSt => [_list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY, _list_layout.LIST_LAYOUT.SEC, _list_layout.LIST_LAYOUT.GC, _list_layout.LIST_LAYOUT.AIF].indexOf(layoutSt) >= 0;
|
|
469
475
|
const isAIFLayout = layoutSt => _list_layout.LIST_LAYOUT.AIF === layoutSt;
|
|
470
476
|
const isEmissionsLayout = layoutSt => _list_layout.LIST_LAYOUT.EMISSIONS === layoutSt;
|
|
471
477
|
const isDLSACFLayout = layoutSt => _list_layout.LIST_LAYOUT.DLS_ACF === layoutSt;
|
|
@@ -518,7 +524,7 @@ const formatPeaksByPrediction = function (peaks, layout, isAscend, decimal) {
|
|
|
518
524
|
return body;
|
|
519
525
|
};
|
|
520
526
|
const compareColors = idx => ['#ABB2B9', '#EDBB99', '#ABEBC6', '#D2B4DE', '#F9E79F'][idx % 5];
|
|
521
|
-
const mutiEntitiesColors = idx => ['#
|
|
527
|
+
const mutiEntitiesColors = idx => ['#d35400', '#2980b9', '#8e44ad', '#2c3e50', '#6D214F', '#182C61', '#BDC581'][idx % 7];
|
|
522
528
|
const strNumberFixedDecimal = function (number) {
|
|
523
529
|
let decimal = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;
|
|
524
530
|
if (decimal <= 0) {
|
|
@@ -660,6 +666,7 @@ const Format = {
|
|
|
660
666
|
isEmissionsLayout,
|
|
661
667
|
isDLSIntensityLayout,
|
|
662
668
|
isEmWaveLayout,
|
|
669
|
+
isGCLayout,
|
|
663
670
|
fixDigit,
|
|
664
671
|
formatPeaksByPrediction,
|
|
665
672
|
formatedMS,
|
|
@@ -47,7 +47,10 @@ exports.getAbsoluteArea = getAbsoluteArea;
|
|
|
47
47
|
const calcArea = function (d, refArea, refFactor) {
|
|
48
48
|
let ignoreRef = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
49
49
|
if (ignoreRef) {
|
|
50
|
-
|
|
50
|
+
const {
|
|
51
|
+
absoluteArea
|
|
52
|
+
} = d;
|
|
53
|
+
return !absoluteArea ? 0 : d.absoluteArea.toFixed(2);
|
|
51
54
|
}
|
|
52
55
|
return (d.area * refFactor / refArea).toFixed(2);
|
|
53
56
|
};
|
package/dist/index.js
CHANGED
|
@@ -40,6 +40,9 @@ var _sec_3_jcamp = _interopRequireDefault(require("./__tests__/fixtures/sec_3_jc
|
|
|
40
40
|
var _sec_4_jcamp = _interopRequireDefault(require("./__tests__/fixtures/sec_4_jcamp"));
|
|
41
41
|
var _aif_jcamp_ = _interopRequireDefault(require("./__tests__/fixtures/aif_jcamp_1"));
|
|
42
42
|
var _aif_jcamp_2 = _interopRequireDefault(require("./__tests__/fixtures/aif_jcamp_2"));
|
|
43
|
+
var _gc_1_jcamp = _interopRequireDefault(require("./__tests__/fixtures/gc_1_jcamp"));
|
|
44
|
+
var _gc_2_jcamp = _interopRequireDefault(require("./__tests__/fixtures/gc_2_jcamp"));
|
|
45
|
+
var _gc_3_jcamp = _interopRequireDefault(require("./__tests__/fixtures/gc_3_jcamp"));
|
|
43
46
|
var _emissions_jcamp = _interopRequireDefault(require("./__tests__/fixtures/emissions_jcamp"));
|
|
44
47
|
var _dls_acf_jcamp = _interopRequireDefault(require("./__tests__/fixtures/dls_acf_jcamp"));
|
|
45
48
|
var _dls_intensity_jcamp = _interopRequireDefault(require("./__tests__/fixtures/dls_intensity_jcamp"));
|
|
@@ -78,6 +81,9 @@ const secEntity3 = _app.FN.ExtractJcamp(_sec_3_jcamp.default);
|
|
|
78
81
|
const secEntity4 = _app.FN.ExtractJcamp(_sec_4_jcamp.default);
|
|
79
82
|
const aifEntity1 = _app.FN.ExtractJcamp(_aif_jcamp_.default);
|
|
80
83
|
const aifEntity2 = _app.FN.ExtractJcamp(_aif_jcamp_2.default);
|
|
84
|
+
const gcEntity1 = _app.FN.ExtractJcamp(_gc_1_jcamp.default);
|
|
85
|
+
const gcEntity2 = _app.FN.ExtractJcamp(_gc_2_jcamp.default);
|
|
86
|
+
const gcEntity3 = _app.FN.ExtractJcamp(_gc_3_jcamp.default);
|
|
81
87
|
const emissionsEntity = _app.FN.ExtractJcamp(_emissions_jcamp.default);
|
|
82
88
|
const dlsAcfEntity = _app.FN.ExtractJcamp(_dls_acf_jcamp.default);
|
|
83
89
|
const dlsIntensityEntity = _app.FN.ExtractJcamp(_dls_intensity_jcamp.default);
|
|
@@ -176,6 +182,8 @@ class DemoWriteIr extends _react.default.Component {
|
|
|
176
182
|
return dlsAcfEntity;
|
|
177
183
|
case 'dls intensity':
|
|
178
184
|
return dlsIntensityEntity;
|
|
185
|
+
case 'gc':
|
|
186
|
+
return gcEntity1;
|
|
179
187
|
case 'ms':
|
|
180
188
|
default:
|
|
181
189
|
return msEntity;
|
|
@@ -200,6 +208,8 @@ class DemoWriteIr extends _react.default.Component {
|
|
|
200
208
|
return [secEntity1, secEntity2, secEntity3, secEntity4];
|
|
201
209
|
case 'aif':
|
|
202
210
|
return [aifEntity1, aifEntity2];
|
|
211
|
+
case 'gc':
|
|
212
|
+
return [gcEntity1, gcEntity2, gcEntity3];
|
|
203
213
|
default:
|
|
204
214
|
return false;
|
|
205
215
|
}
|
|
@@ -235,6 +245,7 @@ class DemoWriteIr extends _react.default.Component {
|
|
|
235
245
|
case 'emissions':
|
|
236
246
|
case 'dls acf':
|
|
237
247
|
case 'dls intensity':
|
|
248
|
+
case 'gc':
|
|
238
249
|
default:
|
|
239
250
|
return false;
|
|
240
251
|
}
|
|
@@ -700,6 +711,13 @@ class DemoWriteIr extends _react.default.Component {
|
|
|
700
711
|
},
|
|
701
712
|
onClick: this.onClick('sec')
|
|
702
713
|
}, "SEC"), /*#__PURE__*/_react.default.createElement(_material.Button, {
|
|
714
|
+
id: "btn-sec",
|
|
715
|
+
variant: "contained",
|
|
716
|
+
style: {
|
|
717
|
+
margin: '0 10px 0 10px'
|
|
718
|
+
},
|
|
719
|
+
onClick: this.onClick('gc')
|
|
720
|
+
}, "GC"), /*#__PURE__*/_react.default.createElement(_material.Button, {
|
|
703
721
|
id: "btn-sod",
|
|
704
722
|
variant: "contained",
|
|
705
723
|
style: {
|
|
@@ -762,7 +780,7 @@ class DemoWriteIr extends _react.default.Component {
|
|
|
762
780
|
canChangeDescription: true,
|
|
763
781
|
onDescriptionChanged: this.onDescriptionChanged,
|
|
764
782
|
molSvg: molSvg,
|
|
765
|
-
|
|
783
|
+
exactMass: '123.0',
|
|
766
784
|
userManualLink: {
|
|
767
785
|
cv: "https://www.chemotion.net/chemotionsaurus/docs/eln/chemspectra/cvanalysis"
|
|
768
786
|
},
|
package/dist/layer_init.js
CHANGED
|
@@ -136,7 +136,7 @@ class LayerInit extends _react.default.Component {
|
|
|
136
136
|
descriptions,
|
|
137
137
|
molSvg,
|
|
138
138
|
editorOnly,
|
|
139
|
-
|
|
139
|
+
exactMass,
|
|
140
140
|
canChangeDescription,
|
|
141
141
|
onDescriptionChanged,
|
|
142
142
|
multiEntities,
|
|
@@ -155,7 +155,7 @@ class LayerInit extends _react.default.Component {
|
|
|
155
155
|
entityFileNames: entityFileNames,
|
|
156
156
|
userManualLink: userManualLink,
|
|
157
157
|
molSvg: molSvg,
|
|
158
|
-
|
|
158
|
+
exactMass: exactMass,
|
|
159
159
|
operations: operations
|
|
160
160
|
});
|
|
161
161
|
} else if (_format.default.isCyclicVoltaLayout(layout)) {
|
|
@@ -165,7 +165,7 @@ class LayerInit extends _react.default.Component {
|
|
|
165
165
|
entityFileNames: entityFileNames,
|
|
166
166
|
userManualLink: userManualLink,
|
|
167
167
|
molSvg: molSvg,
|
|
168
|
-
|
|
168
|
+
exactMass: exactMass,
|
|
169
169
|
operations: operations
|
|
170
170
|
});
|
|
171
171
|
}
|
|
@@ -179,7 +179,7 @@ class LayerInit extends _react.default.Component {
|
|
|
179
179
|
descriptions: descriptions,
|
|
180
180
|
molSvg: molSvg,
|
|
181
181
|
editorOnly: editorOnly,
|
|
182
|
-
|
|
182
|
+
exactMass: exactMass,
|
|
183
183
|
canChangeDescription: canChangeDescription,
|
|
184
184
|
onDescriptionChanged: onDescriptionChanged
|
|
185
185
|
});
|
|
@@ -212,7 +212,7 @@ LayerInit.propTypes = {
|
|
|
212
212
|
yLabel: _propTypes.default.string.isRequired,
|
|
213
213
|
molSvg: _propTypes.default.string.isRequired,
|
|
214
214
|
editorOnly: _propTypes.default.bool.isRequired,
|
|
215
|
-
|
|
215
|
+
exactMass: _propTypes.default.string.isRequired,
|
|
216
216
|
forecast: _propTypes.default.object.isRequired,
|
|
217
217
|
operations: _propTypes.default.array.isRequired,
|
|
218
218
|
descriptions: _propTypes.default.array.isRequired,
|
package/dist/layer_prism.js
CHANGED
|
@@ -32,7 +32,7 @@ const LayerPrism = _ref => {
|
|
|
32
32
|
descriptions,
|
|
33
33
|
molSvg,
|
|
34
34
|
editorOnly,
|
|
35
|
-
|
|
35
|
+
exactMass,
|
|
36
36
|
thresSt,
|
|
37
37
|
scanSt,
|
|
38
38
|
uiSt,
|
|
@@ -103,7 +103,7 @@ const LayerPrism = _ref => {
|
|
|
103
103
|
integration: integration,
|
|
104
104
|
editorOnly: editorOnly,
|
|
105
105
|
molSvg: molSvg,
|
|
106
|
-
|
|
106
|
+
exactMass: exactMass,
|
|
107
107
|
descriptions: descriptions,
|
|
108
108
|
canChangeDescription: canChangeDescription,
|
|
109
109
|
onDescriptionChanged: onDescriptionChanged
|
|
@@ -124,7 +124,7 @@ LayerPrism.propTypes = {
|
|
|
124
124
|
yLabel: _propTypes.default.string.isRequired,
|
|
125
125
|
molSvg: _propTypes.default.string.isRequired,
|
|
126
126
|
editorOnly: _propTypes.default.bool.isRequired,
|
|
127
|
-
|
|
127
|
+
exactMass: _propTypes.default.string,
|
|
128
128
|
forecast: _propTypes.default.object.isRequired,
|
|
129
129
|
operations: _propTypes.default.array.isRequired,
|
|
130
130
|
descriptions: _propTypes.default.array.isRequired,
|
|
@@ -11,6 +11,7 @@ var _list_layout = require("../constants/list_layout");
|
|
|
11
11
|
|
|
12
12
|
const getLayoutSt = state => state.layout;
|
|
13
13
|
const getCurveSt = state => state.curve;
|
|
14
|
+
const getIntegrationSt = state => state.integration.present;
|
|
14
15
|
function getMaxMinPeak(curve) {
|
|
15
16
|
return curve.maxminPeak;
|
|
16
17
|
}
|
|
@@ -105,5 +106,48 @@ function* setCyclicVoltametryRef(action) {
|
|
|
105
106
|
}
|
|
106
107
|
});
|
|
107
108
|
}
|
|
108
|
-
|
|
109
|
+
function* setInitIntegrations(action) {
|
|
110
|
+
// eslint-disable-line
|
|
111
|
+
const curveSt = yield (0, _effects.select)(getCurveSt);
|
|
112
|
+
const {
|
|
113
|
+
listCurves
|
|
114
|
+
} = curveSt;
|
|
115
|
+
if (listCurves) {
|
|
116
|
+
for (let index = 0; index < listCurves.length; index++) {
|
|
117
|
+
const integationSt = yield (0, _effects.select)(getIntegrationSt);
|
|
118
|
+
const curve = listCurves[index];
|
|
119
|
+
const {
|
|
120
|
+
integration,
|
|
121
|
+
simulation
|
|
122
|
+
} = curve;
|
|
123
|
+
const {
|
|
124
|
+
integrations
|
|
125
|
+
} = integationSt;
|
|
126
|
+
const newArrIntegration = [...integrations];
|
|
127
|
+
if (index < newArrIntegration.length) {
|
|
128
|
+
newArrIntegration[index] = integration;
|
|
129
|
+
} else {
|
|
130
|
+
newArrIntegration.push(integration);
|
|
131
|
+
}
|
|
132
|
+
const payload = Object.assign({}, integationSt, {
|
|
133
|
+
integrations: newArrIntegration,
|
|
134
|
+
selectedIdx: index
|
|
135
|
+
}); // eslint-disable-line
|
|
136
|
+
|
|
137
|
+
if (integration) {
|
|
138
|
+
yield (0, _effects.put)({
|
|
139
|
+
type: _action_type.INTEGRATION.RESET_ALL_RDC,
|
|
140
|
+
payload
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
if (simulation) {
|
|
144
|
+
yield (0, _effects.put)({
|
|
145
|
+
type: _action_type.SIMULATION.RESET_ALL_RDC,
|
|
146
|
+
payload: simulation
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
const multiEntitiesSagas = [(0, _effects.takeEvery)(_action_type.CURVE.SET_ALL_CURVES, setCyclicVoltametry), (0, _effects.takeEvery)(_action_type.CURVE.SET_ALL_CURVES, setInitIntegrations), (0, _effects.takeEvery)(_action_type.CYCLIC_VOLTA_METRY.SET_FACTOR, setCyclicVoltametryRef)];
|
|
109
153
|
var _default = exports.default = multiEntitiesSagas;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@complat/react-spectra-editor",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"description": "An editor to View and Edit Chemical Spectra data (NMR, IR, MS, CV, UIVIS, XRD, and DSC).",
|
|
3
|
+
"version": "1.3.5",
|
|
4
|
+
"description": "An editor to View and Edit Chemical Spectra data (NMR, IR, MS, CV, UIVIS, XRD, GC, and DSC).",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/ComPlat/react-spectra-editor"
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"@mui/icons-material": "^5.14.9",
|
|
17
17
|
"@mui/material": "^5.14.9",
|
|
18
18
|
"@mui/styles": "^5.14.9",
|
|
19
|
+
"@popperjs/core": "^2.11.8",
|
|
19
20
|
"@types/jest": "^29.5.0",
|
|
20
21
|
"@types/node": "^18.15.11",
|
|
21
22
|
"@types/react": "^18.0.34",
|