@complat/react-spectra-editor 1.3.5 → 1.4.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.
Files changed (95) hide show
  1. package/dist/__tests__/fixtures/nmr1h_2_jcamp.js +3199 -1944
  2. package/dist/__tests__/units/components/cmd_bar/01_viewer.test.js +21 -18
  3. package/dist/__tests__/units/components/cmd_bar/02_zoom.test.js +15 -13
  4. package/dist/__tests__/units/components/cmd_bar/03_peak.test.js +35 -26
  5. package/dist/__tests__/units/components/cmd_bar/07_pecker.test.js +17 -14
  6. package/dist/__tests__/units/components/cmd_bar/r08_change_axes.test.js +15 -13
  7. package/dist/__tests__/units/components/common/comps.test.js +9 -8
  8. package/dist/__tests__/units/components/common/draw.test.js +26 -34
  9. package/dist/__tests__/units/components/panel/graph_selection.test.js +25 -22
  10. package/dist/__tests__/units/components/panel/info.test.js +30 -25
  11. package/dist/__tests__/units/components/panel/peaks.test.js +29 -24
  12. package/dist/actions/manager.js +6 -2
  13. package/dist/actions/ui.js +13 -21
  14. package/dist/app.js +45 -45
  15. package/dist/components/cmd_bar/01_viewer.js +38 -31
  16. package/dist/components/cmd_bar/02_zoom.js +34 -27
  17. package/dist/components/cmd_bar/03_peak.js +85 -64
  18. package/dist/components/cmd_bar/04_integration.js +97 -76
  19. package/dist/components/cmd_bar/05_multiplicity.js +94 -67
  20. package/dist/components/cmd_bar/06_undo_redo.js +41 -32
  21. package/dist/components/cmd_bar/07_pecker.js +70 -47
  22. package/dist/components/cmd_bar/common.js +8 -8
  23. package/dist/components/cmd_bar/index.js +20 -21
  24. package/dist/components/cmd_bar/r01_layout.js +201 -137
  25. package/dist/components/cmd_bar/r02_scan.js +63 -51
  26. package/dist/components/cmd_bar/r03_threshold.js +95 -69
  27. package/dist/components/cmd_bar/r04_submit.js +155 -133
  28. package/dist/components/cmd_bar/r05_submit_btn.js +39 -36
  29. package/dist/components/cmd_bar/r06_predict_btn.js +66 -52
  30. package/dist/components/cmd_bar/r07_wavelength_btn.js +35 -31
  31. package/dist/components/cmd_bar/r08_change_axes.js +65 -56
  32. package/dist/components/cmd_bar/r09_detector.js +38 -33
  33. package/dist/components/cmd_bar/tri_btn.js +37 -25
  34. package/dist/components/common/comps.js +5 -6
  35. package/dist/components/d3_line/index.js +2 -1
  36. package/dist/components/d3_line/line_focus.js +32 -34
  37. package/dist/components/d3_multi/index.js +2 -1
  38. package/dist/components/d3_multi/multi_focus.js +60 -37
  39. package/dist/components/d3_rect/index.js +2 -1
  40. package/dist/components/d3_rect/rect_focus.js +18 -20
  41. package/dist/components/forecast/comps.js +169 -132
  42. package/dist/components/forecast/ir_comps.js +88 -69
  43. package/dist/components/forecast/ir_viewer.js +35 -28
  44. package/dist/components/forecast/nmr_comps.js +105 -76
  45. package/dist/components/forecast/nmr_viewer.js +36 -29
  46. package/dist/components/forecast/section_loading.js +22 -17
  47. package/dist/components/forecast_viewer.js +19 -17
  48. package/dist/components/multi_jcamps_viewer.js +44 -38
  49. package/dist/components/panel/compare.js +92 -76
  50. package/dist/components/panel/cyclic_voltamery_data.js +171 -122
  51. package/dist/components/panel/graph_selection.js +113 -90
  52. package/dist/components/panel/index.js +43 -39
  53. package/dist/components/panel/info.js +203 -156
  54. package/dist/components/panel/multiplicity.js +85 -63
  55. package/dist/components/panel/multiplicity_coupling.js +36 -29
  56. package/dist/components/panel/multiplicity_select.js +20 -19
  57. package/dist/components/panel/peaks.js +78 -56
  58. package/dist/constants/action_type.js +2 -1
  59. package/dist/helpers/cfg.js +1 -2
  60. package/dist/helpers/chem.js +5 -13
  61. package/dist/helpers/converter.js +1 -2
  62. package/dist/helpers/extractParams.js +1 -2
  63. package/dist/helpers/extractPeaksEdit.js +3 -6
  64. package/dist/helpers/format.js +28 -63
  65. package/dist/helpers/init.js +5 -9
  66. package/dist/helpers/integration.js +1 -2
  67. package/dist/helpers/mount.js +1 -2
  68. package/dist/index.js +306 -276
  69. package/dist/layer_content.js +14 -14
  70. package/dist/layer_init.js +12 -11
  71. package/dist/layer_prism.js +83 -72
  72. package/dist/reducers/reducer_axes.js +2 -5
  73. package/dist/reducers/reducer_curve.js +8 -6
  74. package/dist/reducers/reducer_detector.js +1 -3
  75. package/dist/reducers/reducer_edit_peak.js +1 -3
  76. package/dist/reducers/reducer_forecast.js +1 -3
  77. package/dist/reducers/reducer_integration.js +1 -3
  78. package/dist/reducers/reducer_jcamp.js +5 -8
  79. package/dist/reducers/reducer_layout.js +1 -3
  80. package/dist/reducers/reducer_manager.js +1 -3
  81. package/dist/reducers/reducer_meta.js +1 -3
  82. package/dist/reducers/reducer_multiplicity.js +3 -3
  83. package/dist/reducers/reducer_scan.js +1 -3
  84. package/dist/reducers/reducer_shift.js +1 -3
  85. package/dist/reducers/reducer_simulation.js +1 -3
  86. package/dist/reducers/reducer_status.js +1 -3
  87. package/dist/reducers/reducer_submit.js +1 -3
  88. package/dist/reducers/reducer_threshold.js +199 -29
  89. package/dist/reducers/reducer_ui.js +1 -3
  90. package/dist/reducers/reducer_voltammetry.js +3 -7
  91. package/dist/reducers/reducer_wavelength.js +1 -3
  92. package/dist/sagas/saga_multi_entities.js +35 -14
  93. package/dist/sagas/saga_multiplicity.js +1 -2
  94. package/dist/third_party/jAnalyzer.js +1 -1
  95. package/package.json +18 -1
@@ -8,8 +8,7 @@ exports.InitTip = exports.InitScale = exports.InitPathCall = exports.InitAxisCal
8
8
  var _d3Tip = _interopRequireDefault(require("d3-tip"));
9
9
  var _format = _interopRequireDefault(require("./format"));
10
10
  const d3 = require('d3');
11
- const InitScale = function (target) {
12
- let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
11
+ const InitScale = (target, reverse = true) => {
13
12
  const xRange = reverse ? [target.w, 0] : [0, target.w];
14
13
  const x = d3.scaleLinear().range(xRange);
15
14
  const y = d3.scaleLinear().range([target.h, 0]);
@@ -58,13 +57,10 @@ const tpDiv = (d, digits) => `
58
57
  `;
59
58
  const InitTip = () => {
60
59
  d3.select('.peak-tp').remove();
61
- const tip = (0, _d3Tip.default)().attr('class', 'd3-tip').html(_ref => {
62
- let {
63
- d,
64
- layout
65
- } = _ref;
66
- return tpDiv(d, _format.default.spectraDigit(layout));
67
- });
60
+ const tip = (0, _d3Tip.default)().attr('class', 'd3-tip').html(({
61
+ d,
62
+ layout
63
+ }) => tpDiv(d, _format.default.spectraDigit(layout)));
68
64
  return tip;
69
65
  };
70
66
  exports.InitTip = InitTip;
@@ -44,8 +44,7 @@ const getAbsoluteArea = (xL, xU, data) => {
44
44
  return area;
45
45
  };
46
46
  exports.getAbsoluteArea = getAbsoluteArea;
47
- const calcArea = function (d, refArea, refFactor) {
48
- let ignoreRef = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
47
+ const calcArea = (d, refArea, refFactor, ignoreRef = false) => {
49
48
  if (ignoreRef) {
50
49
  const {
51
50
  absoluteArea
@@ -49,8 +49,7 @@ const MountPath = (target, color) => {
49
49
  return path;
50
50
  };
51
51
  exports.MountPath = MountPath;
52
- const MountComparePath = function (target, color, id) {
53
- let alpha = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
52
+ const MountComparePath = (target, color, id, alpha = 1) => {
54
53
  const path = target.root.append('g').attr('class', 'line-clip-compare').attr('id', id).attr('clip-path', 'url(#clip)').append('path').attr('class', 'line').style('fill', 'none').style('stroke', color).style('stroke-opacity', alpha).style('stroke-width', 1).style('stroke-dasharray', '30, 3').on('click', event => (0, _compass.ClickCompass)(event, target));
55
54
  return path;
56
55
  };