@complat/react-spectra-editor 0.10.14-beta.3 → 0.10.14

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.
@@ -449,7 +449,8 @@ var calcIntgRefArea = function calcIntgRefArea(spectra, stack) {
449
449
 
450
450
  var xs = data.x;
451
451
  var ys = data.y;
452
- var maxY = Math.max.apply(Math, _toConsumableArray(ys));
452
+ var maxY = maxArray(ys);
453
+
453
454
  var xyk = calcXYK(xs, ys, maxY, 0);
454
455
  var _stack$ = stack[0],
455
456
  xL = _stack$.xL,
@@ -461,6 +462,16 @@ var calcIntgRefArea = function calcIntgRefArea(spectra, stack) {
461
462
  return { raw2realRatio: raw2realRatio };
462
463
  };
463
464
 
465
+ var maxArray = function maxArray(arr) {
466
+ var len = arr.length;
467
+ var max = -Infinity;
468
+
469
+ while (len--) {
470
+ max = arr[len] > max ? arr[len] : max;
471
+ }
472
+ return max;
473
+ };
474
+
464
475
  var buildIntegFeature = function buildIntegFeature(jcamp, spectra) {
465
476
  var _jcamp$info = jcamp.info,
466
477
  $OBSERVEDINTEGRALS = _jcamp$info.$OBSERVEDINTEGRALS,
@@ -100,11 +100,11 @@ var MouseMove = function MouseMove(focus) {
100
100
  if (_format2.default.isXRDLayout(layout)) {
101
101
  var dValue = 0.0;
102
102
  if (wavelength) {
103
- dValue = (0, _chem.Convert2DValue)(_pt.x, wavelength.value).toFixed(4);
103
+ dValue = (0, _chem.Convert2DValue)(_pt.x, wavelength.value).toExponential(2);
104
104
  } else {
105
- dValue = (0, _chem.Convert2DValue)(_pt.x).toFixed(4);
105
+ dValue = (0, _chem.Convert2DValue)(_pt.x).toExponential(2);
106
106
  }
107
- focus.root.select('.cursor-txt-hz').attr('transform', 'translate(' + _tx + ',' + (_ty - 30) + ')').text('2Theta: ' + _pt.x + ', d-value: ' + dValue);
107
+ focus.root.select('.cursor-txt-hz').attr('transform', 'translate(' + _tx + ',' + (_ty - 30) + ')').text('2Theta: ' + _pt.x.toExponential(2) + ', d-value: ' + dValue);
108
108
  } else {
109
109
  focus.root.select('.cursor-txt').attr('transform', 'translate(' + _tx + ',' + 10 + ')').text(_pt.x.toFixed(3));
110
110
  if (freq) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@complat/react-spectra-editor",
3
- "version": "0.10.14-beta.3",
3
+ "version": "0.10.14",
4
4
  "description": "An editor to View and Edit Chemical Spectra data (NMR, IR and MS).",
5
5
  "repository": {
6
6
  "type": "git",