@complat/react-spectra-editor 1.3.1 → 1.3.4
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/cyclic_voltammetry_1.js +2 -0
- package/dist/__tests__/fixtures/dsc_jcamp.js +425 -0
- 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/__tests__/units/components/panel/info.test.js +2 -1
- package/dist/actions/meta.js +7 -2
- package/dist/components/cmd_bar/r01_layout.js +8 -0
- package/dist/components/cmd_bar/r05_submit_btn.js +13 -6
- 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 +14 -4
- package/dist/components/panel/graph_selection.js +11 -2
- package/dist/components/panel/info.js +77 -7
- package/dist/constants/action_type.js +3 -1
- package/dist/constants/list_layout.js +3 -1
- package/dist/helpers/cfg.js +1 -1
- package/dist/helpers/chem.js +27 -4
- package/dist/helpers/compass.js +1 -1
- package/dist/helpers/extractPeaksEdit.js +9 -2
- package/dist/helpers/format.js +106 -5
- package/dist/helpers/integration.js +4 -1
- package/dist/index.js +70 -4
- package/dist/layer_init.js +11 -3
- package/dist/reducers/reducer_meta.js +14 -0
- package/dist/sagas/saga_meta.js +9 -1
- package/dist/sagas/saga_multi_entities.js +45 -1
- package/dist/sagas/saga_ui.js +1 -0
- package/package.json +3 -2
package/dist/helpers/format.js
CHANGED
|
@@ -20,9 +20,11 @@ const spectraDigit = layout => {
|
|
|
20
20
|
case _list_layout.LIST_LAYOUT.UVVIS:
|
|
21
21
|
case _list_layout.LIST_LAYOUT.HPLC_UVVIS:
|
|
22
22
|
case _list_layout.LIST_LAYOUT.TGA:
|
|
23
|
+
case _list_layout.LIST_LAYOUT.DSC:
|
|
23
24
|
case _list_layout.LIST_LAYOUT.XRD:
|
|
24
25
|
case _list_layout.LIST_LAYOUT.CDS:
|
|
25
26
|
case _list_layout.LIST_LAYOUT.SEC:
|
|
27
|
+
case _list_layout.LIST_LAYOUT.GC:
|
|
26
28
|
case _list_layout.LIST_LAYOUT.MS:
|
|
27
29
|
return 0;
|
|
28
30
|
case _list_layout.LIST_LAYOUT.C13:
|
|
@@ -110,6 +112,10 @@ const spectraOps = {
|
|
|
110
112
|
head: 'THERMOGRAVIMETRIC ANALYSIS',
|
|
111
113
|
tail: ' SECONDS'
|
|
112
114
|
},
|
|
115
|
+
[_list_layout.LIST_LAYOUT.DSC]: {
|
|
116
|
+
head: 'DIFFERENTIAL SCANNING CALORIMETRY',
|
|
117
|
+
tail: ' SECONDS'
|
|
118
|
+
},
|
|
113
119
|
[_list_layout.LIST_LAYOUT.MS]: {
|
|
114
120
|
head: 'MASS',
|
|
115
121
|
tail: ' m/z'
|
|
@@ -119,7 +125,7 @@ const spectraOps = {
|
|
|
119
125
|
tail: '.'
|
|
120
126
|
},
|
|
121
127
|
[_list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY]: {
|
|
122
|
-
head: '
|
|
128
|
+
head: 'CV',
|
|
123
129
|
tail: '.'
|
|
124
130
|
},
|
|
125
131
|
[_list_layout.LIST_LAYOUT.CDS]: {
|
|
@@ -130,6 +136,10 @@ const spectraOps = {
|
|
|
130
136
|
head: 'SIZE EXCLUSION CHROMATOGRAPHY',
|
|
131
137
|
tail: '.'
|
|
132
138
|
},
|
|
139
|
+
[_list_layout.LIST_LAYOUT.GC]: {
|
|
140
|
+
head: 'GAS CHROMATOGRAPHY',
|
|
141
|
+
tail: '.'
|
|
142
|
+
},
|
|
133
143
|
[_list_layout.LIST_LAYOUT.EMISSIONS]: {
|
|
134
144
|
head: 'EMISSION',
|
|
135
145
|
tail: '.'
|
|
@@ -411,7 +421,7 @@ const peaksBody = _ref => {
|
|
|
411
421
|
if (layout === _list_layout.LIST_LAYOUT.DLS_INTENSITY) {
|
|
412
422
|
return formatedDLSIntensity(ordered, maxY, decimal, isAscend, isIntensity, boundary, false);
|
|
413
423
|
}
|
|
414
|
-
if (layout === _list_layout.LIST_LAYOUT.RAMAN || layout === _list_layout.LIST_LAYOUT.TGA || 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) {
|
|
415
425
|
return formatedEm(ordered, maxY, decimal, isAscend, isIntensity, boundary, false);
|
|
416
426
|
}
|
|
417
427
|
if (layout === _list_layout.LIST_LAYOUT.XRD) {
|
|
@@ -454,12 +464,14 @@ const isRamanLayout = layoutSt => _list_layout.LIST_LAYOUT.RAMAN === layoutSt;
|
|
|
454
464
|
const isUvVisLayout = layoutSt => _list_layout.LIST_LAYOUT.UVVIS === layoutSt;
|
|
455
465
|
const isHplcUvVisLayout = layoutSt => _list_layout.LIST_LAYOUT.HPLC_UVVIS === layoutSt;
|
|
456
466
|
const isTGALayout = layoutSt => _list_layout.LIST_LAYOUT.TGA === layoutSt;
|
|
467
|
+
const isDSCLayout = layoutSt => _list_layout.LIST_LAYOUT.DSC === layoutSt;
|
|
457
468
|
const isXRDLayout = layoutSt => _list_layout.LIST_LAYOUT.XRD === layoutSt;
|
|
458
469
|
const isCyclicVoltaLayout = layoutSt => _list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY === layoutSt;
|
|
459
470
|
const isCDSLayout = layoutSt => _list_layout.LIST_LAYOUT.CDS === layoutSt;
|
|
460
471
|
const isSECLayout = layoutSt => _list_layout.LIST_LAYOUT.SEC === layoutSt;
|
|
472
|
+
const isGCLayout = layoutSt => _list_layout.LIST_LAYOUT.GC === layoutSt;
|
|
461
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;
|
|
462
|
-
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;
|
|
463
475
|
const isAIFLayout = layoutSt => _list_layout.LIST_LAYOUT.AIF === layoutSt;
|
|
464
476
|
const isEmissionsLayout = layoutSt => _list_layout.LIST_LAYOUT.EMISSIONS === layoutSt;
|
|
465
477
|
const isDLSACFLayout = layoutSt => _list_layout.LIST_LAYOUT.DLS_ACF === layoutSt;
|
|
@@ -512,7 +524,7 @@ const formatPeaksByPrediction = function (peaks, layout, isAscend, decimal) {
|
|
|
512
524
|
return body;
|
|
513
525
|
};
|
|
514
526
|
const compareColors = idx => ['#ABB2B9', '#EDBB99', '#ABEBC6', '#D2B4DE', '#F9E79F'][idx % 5];
|
|
515
|
-
const mutiEntitiesColors = idx => ['#
|
|
527
|
+
const mutiEntitiesColors = idx => ['#d35400', '#2980b9', '#8e44ad', '#2c3e50', '#6D214F', '#182C61', '#BDC581'][idx % 7];
|
|
516
528
|
const strNumberFixedDecimal = function (number) {
|
|
517
529
|
let decimal = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;
|
|
518
530
|
if (decimal <= 0) {
|
|
@@ -538,6 +550,92 @@ const strNumberFixedLength = function (number) {
|
|
|
538
550
|
|
|
539
551
|
return number.toFixed(lengthToFix);
|
|
540
552
|
};
|
|
553
|
+
const inlineNotation = function (layout, data) {
|
|
554
|
+
let sampleName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
555
|
+
let formattedString = '';
|
|
556
|
+
let quillData = [];
|
|
557
|
+
const {
|
|
558
|
+
scanRate,
|
|
559
|
+
voltaData
|
|
560
|
+
} = data;
|
|
561
|
+
switch (layout) {
|
|
562
|
+
case _list_layout.LIST_LAYOUT.CYCLIC_VOLTAMMETRY:
|
|
563
|
+
{
|
|
564
|
+
if (!voltaData) {
|
|
565
|
+
break;
|
|
566
|
+
}
|
|
567
|
+
let refString = '';
|
|
568
|
+
let nonRefString = '';
|
|
569
|
+
let refOps = [];
|
|
570
|
+
const nonRefOps = [];
|
|
571
|
+
const {
|
|
572
|
+
listPeaks,
|
|
573
|
+
xyData
|
|
574
|
+
} = voltaData;
|
|
575
|
+
const {
|
|
576
|
+
x
|
|
577
|
+
} = xyData;
|
|
578
|
+
listPeaks.forEach(item => {
|
|
579
|
+
const {
|
|
580
|
+
isRef,
|
|
581
|
+
e12,
|
|
582
|
+
max,
|
|
583
|
+
min
|
|
584
|
+
} = item;
|
|
585
|
+
const e12Str = e12 ? strNumberFixedLength(e12, 3) : '0';
|
|
586
|
+
const scanRateStr = scanRate ? strNumberFixedLength(scanRate, 3) : '0';
|
|
587
|
+
if (isRef) {
|
|
588
|
+
const posNegString = x[0] > x[1] ? 'neg.' : 'pos.';
|
|
589
|
+
refString = `CV (<conc. of sample> mM in <solvent> vs. Ref (Fc+/Fc) = ${e12Str} V, v = ${scanRateStr} V/s, to ${posNegString}):`;
|
|
590
|
+
refOps = [{
|
|
591
|
+
insert: 'CV (<conc. of sample> mM in <solvent> vs. Ref '
|
|
592
|
+
}, {
|
|
593
|
+
insert: '(Fc'
|
|
594
|
+
}, {
|
|
595
|
+
insert: '+',
|
|
596
|
+
attributes: {
|
|
597
|
+
script: 'super'
|
|
598
|
+
}
|
|
599
|
+
}, {
|
|
600
|
+
insert: '/Fc) '
|
|
601
|
+
}, {
|
|
602
|
+
insert: `= ${e12Str} V, v = ${scanRateStr} V/s, to ${posNegString}):`
|
|
603
|
+
}];
|
|
604
|
+
} else {
|
|
605
|
+
const delta = max && min ? strNumberFixedLength(Math.abs(max.x - min.x) * 1000, 3) : '0';
|
|
606
|
+
nonRefString += `\nE1/2 = ([${sampleName}] , ΔEp) = ${e12Str} V (${delta} mV)`;
|
|
607
|
+
const currentNoneOps = [{
|
|
608
|
+
insert: '\nE'
|
|
609
|
+
}, {
|
|
610
|
+
insert: '1/2',
|
|
611
|
+
attributes: {
|
|
612
|
+
script: 'sub'
|
|
613
|
+
}
|
|
614
|
+
}, {
|
|
615
|
+
insert: ` = ([${sampleName}] , ΔE`
|
|
616
|
+
}, {
|
|
617
|
+
insert: 'p',
|
|
618
|
+
attributes: {
|
|
619
|
+
script: 'sub'
|
|
620
|
+
}
|
|
621
|
+
}, {
|
|
622
|
+
insert: `) = ${e12Str} V (${delta} mV)`
|
|
623
|
+
}];
|
|
624
|
+
nonRefOps.push(...currentNoneOps);
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
formattedString = refString + nonRefString;
|
|
628
|
+
quillData = [...refOps, ...nonRefOps];
|
|
629
|
+
break;
|
|
630
|
+
}
|
|
631
|
+
default:
|
|
632
|
+
break;
|
|
633
|
+
}
|
|
634
|
+
return {
|
|
635
|
+
quillData,
|
|
636
|
+
formattedString
|
|
637
|
+
};
|
|
638
|
+
};
|
|
541
639
|
const Format = {
|
|
542
640
|
toPeakStr,
|
|
543
641
|
buildData,
|
|
@@ -560,6 +658,7 @@ const Format = {
|
|
|
560
658
|
isUvVisLayout,
|
|
561
659
|
isHplcUvVisLayout,
|
|
562
660
|
isTGALayout,
|
|
661
|
+
isDSCLayout,
|
|
563
662
|
isXRDLayout,
|
|
564
663
|
isCyclicVoltaLayout,
|
|
565
664
|
isCDSLayout,
|
|
@@ -567,6 +666,7 @@ const Format = {
|
|
|
567
666
|
isEmissionsLayout,
|
|
568
667
|
isDLSIntensityLayout,
|
|
569
668
|
isEmWaveLayout,
|
|
669
|
+
isGCLayout,
|
|
570
670
|
fixDigit,
|
|
571
671
|
formatPeaksByPrediction,
|
|
572
672
|
formatedMS,
|
|
@@ -579,6 +679,7 @@ const Format = {
|
|
|
579
679
|
isDLSACFLayout,
|
|
580
680
|
strNumberFixedDecimal,
|
|
581
681
|
formatedXRD,
|
|
582
|
-
strNumberFixedLength
|
|
682
|
+
strNumberFixedLength,
|
|
683
|
+
inlineNotation
|
|
583
684
|
};
|
|
584
685
|
var _default = exports.default = Format;
|
|
@@ -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
|
@@ -27,6 +27,7 @@ var _uv_vis_jcamp = _interopRequireDefault(require("./__tests__/fixtures/uv_vis_
|
|
|
27
27
|
var _hplc_uvvis_jcamp = _interopRequireDefault(require("./__tests__/fixtures/hplc_uvvis_jcamp"));
|
|
28
28
|
var _hplc_uvvis_jcamp_ = _interopRequireDefault(require("./__tests__/fixtures/hplc_uvvis_jcamp_2"));
|
|
29
29
|
var _tga_jcamp = _interopRequireDefault(require("./__tests__/fixtures/tga_jcamp"));
|
|
30
|
+
var _dsc_jcamp = _interopRequireDefault(require("./__tests__/fixtures/dsc_jcamp"));
|
|
30
31
|
var _xrd_jcamp_ = _interopRequireDefault(require("./__tests__/fixtures/xrd_jcamp_1"));
|
|
31
32
|
var _xrd_jcamp_2 = _interopRequireDefault(require("./__tests__/fixtures/xrd_jcamp_2"));
|
|
32
33
|
var _cyclic_voltammetry_ = _interopRequireDefault(require("./__tests__/fixtures/cyclic_voltammetry_1"));
|
|
@@ -39,6 +40,9 @@ var _sec_3_jcamp = _interopRequireDefault(require("./__tests__/fixtures/sec_3_jc
|
|
|
39
40
|
var _sec_4_jcamp = _interopRequireDefault(require("./__tests__/fixtures/sec_4_jcamp"));
|
|
40
41
|
var _aif_jcamp_ = _interopRequireDefault(require("./__tests__/fixtures/aif_jcamp_1"));
|
|
41
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"));
|
|
42
46
|
var _emissions_jcamp = _interopRequireDefault(require("./__tests__/fixtures/emissions_jcamp"));
|
|
43
47
|
var _dls_acf_jcamp = _interopRequireDefault(require("./__tests__/fixtures/dls_acf_jcamp"));
|
|
44
48
|
var _dls_intensity_jcamp = _interopRequireDefault(require("./__tests__/fixtures/dls_intensity_jcamp"));
|
|
@@ -64,6 +68,7 @@ const compUvVisEntity = _app.FN.ExtractJcamp(_compare_uv_vis_jcamp.default);
|
|
|
64
68
|
const hplcUVVisEntity = _app.FN.ExtractJcamp(_hplc_uvvis_jcamp.default);
|
|
65
69
|
const hplcUVVisEntity2 = _app.FN.ExtractJcamp(_hplc_uvvis_jcamp_.default);
|
|
66
70
|
const tgaEntity = _app.FN.ExtractJcamp(_tga_jcamp.default);
|
|
71
|
+
const dscEntity = _app.FN.ExtractJcamp(_dsc_jcamp.default);
|
|
67
72
|
const xrdEntity1 = _app.FN.ExtractJcamp(_xrd_jcamp_.default);
|
|
68
73
|
const xrdEntity2 = _app.FN.ExtractJcamp(_xrd_jcamp_2.default);
|
|
69
74
|
const cyclicVoltaEntity1 = _app.FN.ExtractJcamp(_cyclic_voltammetry_.default);
|
|
@@ -76,6 +81,9 @@ const secEntity3 = _app.FN.ExtractJcamp(_sec_3_jcamp.default);
|
|
|
76
81
|
const secEntity4 = _app.FN.ExtractJcamp(_sec_4_jcamp.default);
|
|
77
82
|
const aifEntity1 = _app.FN.ExtractJcamp(_aif_jcamp_.default);
|
|
78
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);
|
|
79
87
|
const emissionsEntity = _app.FN.ExtractJcamp(_emissions_jcamp.default);
|
|
80
88
|
const dlsAcfEntity = _app.FN.ExtractJcamp(_dls_acf_jcamp.default);
|
|
81
89
|
const dlsIntensityEntity = _app.FN.ExtractJcamp(_dls_intensity_jcamp.default);
|
|
@@ -156,6 +164,8 @@ class DemoWriteIr extends _react.default.Component {
|
|
|
156
164
|
return hplcUVVisEntity;
|
|
157
165
|
case 'tga':
|
|
158
166
|
return tgaEntity;
|
|
167
|
+
case 'dsc':
|
|
168
|
+
return dscEntity;
|
|
159
169
|
case 'xrd':
|
|
160
170
|
return xrdEntity1;
|
|
161
171
|
case 'cyclic volta':
|
|
@@ -172,6 +182,8 @@ class DemoWriteIr extends _react.default.Component {
|
|
|
172
182
|
return dlsAcfEntity;
|
|
173
183
|
case 'dls intensity':
|
|
174
184
|
return dlsIntensityEntity;
|
|
185
|
+
case 'gc':
|
|
186
|
+
return gcEntity1;
|
|
175
187
|
case 'ms':
|
|
176
188
|
default:
|
|
177
189
|
return msEntity;
|
|
@@ -196,6 +208,8 @@ class DemoWriteIr extends _react.default.Component {
|
|
|
196
208
|
return [secEntity1, secEntity2, secEntity3, secEntity4];
|
|
197
209
|
case 'aif':
|
|
198
210
|
return [aifEntity1, aifEntity2];
|
|
211
|
+
case 'gc':
|
|
212
|
+
return [gcEntity1, gcEntity2, gcEntity3];
|
|
199
213
|
default:
|
|
200
214
|
return false;
|
|
201
215
|
}
|
|
@@ -221,6 +235,7 @@ class DemoWriteIr extends _react.default.Component {
|
|
|
221
235
|
case 'uv/vis':
|
|
222
236
|
case 'hplc uv/vis':
|
|
223
237
|
case 'tga':
|
|
238
|
+
case 'dsc':
|
|
224
239
|
case 'xrd':
|
|
225
240
|
case 'ms':
|
|
226
241
|
case 'cyclic volta':
|
|
@@ -230,6 +245,7 @@ class DemoWriteIr extends _react.default.Component {
|
|
|
230
245
|
case 'emissions':
|
|
231
246
|
case 'dls acf':
|
|
232
247
|
case 'dls intensity':
|
|
248
|
+
case 'gc':
|
|
233
249
|
default:
|
|
234
250
|
return false;
|
|
235
251
|
}
|
|
@@ -259,7 +275,9 @@ class DemoWriteIr extends _react.default.Component {
|
|
|
259
275
|
decimal,
|
|
260
276
|
isIntensity,
|
|
261
277
|
integration,
|
|
262
|
-
waveLength
|
|
278
|
+
waveLength,
|
|
279
|
+
cyclicvoltaSt,
|
|
280
|
+
curveSt
|
|
263
281
|
} = _ref;
|
|
264
282
|
const entity = this.loadEntity();
|
|
265
283
|
const {
|
|
@@ -289,7 +307,36 @@ class DemoWriteIr extends _react.default.Component {
|
|
|
289
307
|
temperature
|
|
290
308
|
});
|
|
291
309
|
const wrapper = _app.FN.peaksWrapper(layout, shift);
|
|
292
|
-
|
|
310
|
+
let desc = this.rmDollarSign(wrapper.head) + body + wrapper.tail;
|
|
311
|
+
if (_app.FN.isCyclicVoltaLayout(layout)) {
|
|
312
|
+
const {
|
|
313
|
+
spectraList
|
|
314
|
+
} = cyclicvoltaSt;
|
|
315
|
+
const {
|
|
316
|
+
curveIdx,
|
|
317
|
+
listCurves
|
|
318
|
+
} = curveSt;
|
|
319
|
+
const selectedVolta = spectraList[curveIdx];
|
|
320
|
+
const selectedCurve = listCurves[curveIdx];
|
|
321
|
+
const {
|
|
322
|
+
feature
|
|
323
|
+
} = selectedCurve;
|
|
324
|
+
const {
|
|
325
|
+
scanRate
|
|
326
|
+
} = feature;
|
|
327
|
+
const data = {
|
|
328
|
+
scanRate,
|
|
329
|
+
voltaData: {
|
|
330
|
+
listPeaks: selectedVolta.list,
|
|
331
|
+
xyData: feature.data[0]
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
const inlineData = _app.FN.inlineNotation(layout, data);
|
|
335
|
+
const {
|
|
336
|
+
formattedString
|
|
337
|
+
} = inlineData;
|
|
338
|
+
desc = formattedString;
|
|
339
|
+
}
|
|
293
340
|
return desc;
|
|
294
341
|
}
|
|
295
342
|
formatMpy(_ref2) {
|
|
@@ -393,7 +440,9 @@ class DemoWriteIr extends _react.default.Component {
|
|
|
393
440
|
decimal,
|
|
394
441
|
isIntensity,
|
|
395
442
|
integration,
|
|
396
|
-
waveLength
|
|
443
|
+
waveLength,
|
|
444
|
+
cyclicvoltaSt,
|
|
445
|
+
curveSt
|
|
397
446
|
} = _ref4;
|
|
398
447
|
const desc = this.formatPks({
|
|
399
448
|
peaks,
|
|
@@ -403,7 +452,10 @@ class DemoWriteIr extends _react.default.Component {
|
|
|
403
452
|
decimal,
|
|
404
453
|
isIntensity,
|
|
405
454
|
integration,
|
|
406
|
-
waveLength
|
|
455
|
+
waveLength,
|
|
456
|
+
// eslint-disable-line
|
|
457
|
+
cyclicvoltaSt,
|
|
458
|
+
curveSt // eslint-disable-line
|
|
407
459
|
});
|
|
408
460
|
this.setState({
|
|
409
461
|
desc
|
|
@@ -625,6 +677,13 @@ class DemoWriteIr extends _react.default.Component {
|
|
|
625
677
|
},
|
|
626
678
|
onClick: this.onClick('tga')
|
|
627
679
|
}, "TGA"), /*#__PURE__*/_react.default.createElement(_material.Button, {
|
|
680
|
+
id: "btn-dsc",
|
|
681
|
+
variant: "contained",
|
|
682
|
+
style: {
|
|
683
|
+
margin: '0 10px 0 10px'
|
|
684
|
+
},
|
|
685
|
+
onClick: this.onClick('dsc')
|
|
686
|
+
}, "DSC"), /*#__PURE__*/_react.default.createElement(_material.Button, {
|
|
628
687
|
id: "btn-xrd",
|
|
629
688
|
variant: "contained",
|
|
630
689
|
style: {
|
|
@@ -652,6 +711,13 @@ class DemoWriteIr extends _react.default.Component {
|
|
|
652
711
|
},
|
|
653
712
|
onClick: this.onClick('sec')
|
|
654
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, {
|
|
655
721
|
id: "btn-sod",
|
|
656
722
|
variant: "contained",
|
|
657
723
|
style: {
|
package/dist/layer_init.js
CHANGED
|
@@ -61,7 +61,8 @@ class LayerInit extends _react.default.Component {
|
|
|
61
61
|
resetInitMsAct,
|
|
62
62
|
resetInitNmrAct,
|
|
63
63
|
resetInitCommonWithIntergationAct,
|
|
64
|
-
resetDetectorAct
|
|
64
|
+
resetDetectorAct,
|
|
65
|
+
updateDSCMetaDataAct
|
|
65
66
|
} = this.props;
|
|
66
67
|
resetInitCommonAct();
|
|
67
68
|
resetDetectorAct();
|
|
@@ -96,6 +97,11 @@ class LayerInit extends _react.default.Component {
|
|
|
96
97
|
resetInitCommonWithIntergationAct({
|
|
97
98
|
integration
|
|
98
99
|
});
|
|
100
|
+
} else if (_format.default.isDSCLayout(layout)) {
|
|
101
|
+
const {
|
|
102
|
+
dscMetaData
|
|
103
|
+
} = features;
|
|
104
|
+
updateDSCMetaDataAct(dscMetaData);
|
|
99
105
|
}
|
|
100
106
|
}
|
|
101
107
|
initReducer() {
|
|
@@ -191,7 +197,8 @@ const mapDispatchToProps = dispatch => (0, _redux.bindActionCreators)({
|
|
|
191
197
|
updateOperationAct: _submit.updateOperation,
|
|
192
198
|
updateMetaPeaksAct: _meta.updateMetaPeaks,
|
|
193
199
|
addOthersAct: _jcamp.addOthers,
|
|
194
|
-
setAllCurvesAct: _curve.setAllCurves
|
|
200
|
+
setAllCurvesAct: _curve.setAllCurves,
|
|
201
|
+
updateDSCMetaDataAct: _meta.updateDSCMetaData
|
|
195
202
|
}, dispatch);
|
|
196
203
|
LayerInit.propTypes = {
|
|
197
204
|
entity: _propTypes.default.object.isRequired,
|
|
@@ -222,7 +229,8 @@ LayerInit.propTypes = {
|
|
|
222
229
|
setAllCurvesAct: _propTypes.default.func.isRequired,
|
|
223
230
|
userManualLink: _propTypes.default.object,
|
|
224
231
|
// eslint-disable-line
|
|
225
|
-
resetDetectorAct: _propTypes.default.func.isRequired
|
|
232
|
+
resetDetectorAct: _propTypes.default.func.isRequired,
|
|
233
|
+
updateDSCMetaDataAct: _propTypes.default.func.isRequired
|
|
226
234
|
};
|
|
227
235
|
var _default = exports.default = (0, _reactRedux.connect)(
|
|
228
236
|
// eslint-disable-line
|
|
@@ -13,14 +13,28 @@ const initialState = {
|
|
|
13
13
|
intervalR: null,
|
|
14
14
|
observeFrequency: null,
|
|
15
15
|
deltaX: null
|
|
16
|
+
},
|
|
17
|
+
dscMetaData: {
|
|
18
|
+
meltingPoint: null,
|
|
19
|
+
tg: null
|
|
16
20
|
}
|
|
17
21
|
};
|
|
22
|
+
const updateMetaData = (state, action) => {
|
|
23
|
+
const {
|
|
24
|
+
dscMetaData
|
|
25
|
+
} = action.payload;
|
|
26
|
+
return Object.assign({}, state, {
|
|
27
|
+
dscMetaData
|
|
28
|
+
});
|
|
29
|
+
};
|
|
18
30
|
const metaReducer = function () {
|
|
19
31
|
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
20
32
|
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
21
33
|
switch (action.type) {
|
|
22
34
|
case _action_type.META.UPDATE_PEAKS_RDC:
|
|
23
35
|
return Object.assign({}, state, action.payload);
|
|
36
|
+
case _action_type.META.UPDATE_META_DATA_RDC:
|
|
37
|
+
return updateMetaData(state, action);
|
|
24
38
|
default:
|
|
25
39
|
return state;
|
|
26
40
|
}
|
package/dist/sagas/saga_meta.js
CHANGED
|
@@ -32,5 +32,13 @@ function* updateMetaPeaks(action) {
|
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
function* updateMetaData(action) {
|
|
36
|
+
yield (0, _effects.put)({
|
|
37
|
+
type: _action_type.META.UPDATE_META_DATA_RDC,
|
|
38
|
+
payload: {
|
|
39
|
+
dscMetaData: action.payload
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
const metaSagas = [(0, _effects.takeEvery)(_action_type.META.UPDATE_PEAKS, updateMetaPeaks), (0, _effects.takeEvery)(_action_type.META.UPDATE_META_DATA, updateMetaData)];
|
|
36
44
|
var _default = exports.default = metaSagas;
|
|
@@ -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/dist/sagas/saga_ui.js
CHANGED
|
@@ -139,6 +139,7 @@ function* scrollUiWheel(action) {
|
|
|
139
139
|
case _list_layout.LIST_LAYOUT.UVVIS:
|
|
140
140
|
case _list_layout.LIST_LAYOUT.HPLC_UVVIS:
|
|
141
141
|
case _list_layout.LIST_LAYOUT.TGA:
|
|
142
|
+
case _list_layout.LIST_LAYOUT.DSC:
|
|
142
143
|
case _list_layout.LIST_LAYOUT.XRD:
|
|
143
144
|
default:
|
|
144
145
|
[nyeL, nyeU] = [yeL, yeL + (yeU - yeL) * scale];
|
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
|
|
3
|
+
"version": "1.3.4",
|
|
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",
|