@complat/react-spectra-editor 1.3.4 → 1.4.0
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/nmr1h_2_jcamp.js +3199 -1944
- package/dist/__tests__/units/components/cmd_bar/01_viewer.test.js +21 -18
- package/dist/__tests__/units/components/cmd_bar/02_zoom.test.js +15 -13
- package/dist/__tests__/units/components/cmd_bar/03_peak.test.js +35 -26
- package/dist/__tests__/units/components/cmd_bar/07_pecker.test.js +17 -14
- package/dist/__tests__/units/components/cmd_bar/r08_change_axes.test.js +15 -13
- package/dist/__tests__/units/components/common/comps.test.js +9 -8
- package/dist/__tests__/units/components/common/draw.test.js +26 -34
- package/dist/__tests__/units/components/panel/graph_selection.test.js +25 -22
- package/dist/__tests__/units/components/panel/info.test.js +30 -25
- package/dist/__tests__/units/components/panel/peaks.test.js +29 -24
- package/dist/actions/manager.js +6 -2
- package/dist/actions/ui.js +13 -21
- package/dist/app.js +47 -47
- package/dist/components/cmd_bar/01_viewer.js +38 -31
- package/dist/components/cmd_bar/02_zoom.js +34 -27
- package/dist/components/cmd_bar/03_peak.js +85 -64
- package/dist/components/cmd_bar/04_integration.js +97 -76
- package/dist/components/cmd_bar/05_multiplicity.js +94 -67
- package/dist/components/cmd_bar/06_undo_redo.js +41 -32
- package/dist/components/cmd_bar/07_pecker.js +70 -47
- package/dist/components/cmd_bar/common.js +8 -8
- package/dist/components/cmd_bar/index.js +20 -21
- package/dist/components/cmd_bar/r01_layout.js +201 -137
- package/dist/components/cmd_bar/r02_scan.js +63 -51
- package/dist/components/cmd_bar/r03_threshold.js +95 -69
- package/dist/components/cmd_bar/r04_submit.js +155 -133
- package/dist/components/cmd_bar/r05_submit_btn.js +39 -36
- package/dist/components/cmd_bar/r06_predict_btn.js +66 -52
- package/dist/components/cmd_bar/r07_wavelength_btn.js +35 -31
- package/dist/components/cmd_bar/r08_change_axes.js +65 -56
- package/dist/components/cmd_bar/r09_detector.js +38 -33
- package/dist/components/cmd_bar/tri_btn.js +37 -25
- package/dist/components/common/comps.js +5 -6
- package/dist/components/d3_line/index.js +2 -1
- package/dist/components/d3_line/line_focus.js +32 -34
- package/dist/components/d3_multi/index.js +2 -1
- package/dist/components/d3_multi/multi_focus.js +60 -37
- package/dist/components/d3_rect/index.js +2 -1
- package/dist/components/d3_rect/rect_focus.js +18 -20
- package/dist/components/forecast/comps.js +169 -132
- package/dist/components/forecast/ir_comps.js +88 -69
- package/dist/components/forecast/ir_viewer.js +35 -28
- package/dist/components/forecast/nmr_comps.js +105 -76
- package/dist/components/forecast/nmr_viewer.js +36 -29
- package/dist/components/forecast/section_loading.js +22 -17
- package/dist/components/forecast_viewer.js +19 -17
- package/dist/components/multi_jcamps_viewer.js +46 -40
- package/dist/components/panel/compare.js +92 -76
- package/dist/components/panel/cyclic_voltamery_data.js +171 -122
- package/dist/components/panel/graph_selection.js +113 -90
- package/dist/components/panel/index.js +45 -41
- package/dist/components/panel/info.js +204 -157
- package/dist/components/panel/multiplicity.js +85 -63
- package/dist/components/panel/multiplicity_coupling.js +36 -29
- package/dist/components/panel/multiplicity_select.js +20 -19
- package/dist/components/panel/peaks.js +78 -56
- package/dist/constants/action_type.js +2 -1
- package/dist/helpers/cfg.js +1 -2
- package/dist/helpers/chem.js +5 -13
- package/dist/helpers/converter.js +1 -2
- package/dist/helpers/extractParams.js +1 -2
- package/dist/helpers/extractPeaksEdit.js +3 -6
- package/dist/helpers/format.js +27 -62
- package/dist/helpers/init.js +5 -9
- package/dist/helpers/integration.js +1 -2
- package/dist/helpers/mount.js +1 -2
- package/dist/index.js +306 -276
- package/dist/layer_content.js +14 -14
- package/dist/layer_init.js +17 -16
- package/dist/layer_prism.js +84 -73
- package/dist/reducers/reducer_axes.js +2 -5
- package/dist/reducers/reducer_curve.js +8 -6
- package/dist/reducers/reducer_detector.js +1 -3
- package/dist/reducers/reducer_edit_peak.js +1 -3
- package/dist/reducers/reducer_forecast.js +1 -3
- package/dist/reducers/reducer_integration.js +1 -3
- package/dist/reducers/reducer_jcamp.js +5 -8
- package/dist/reducers/reducer_layout.js +1 -3
- package/dist/reducers/reducer_manager.js +1 -3
- package/dist/reducers/reducer_meta.js +1 -3
- package/dist/reducers/reducer_multiplicity.js +3 -3
- package/dist/reducers/reducer_scan.js +1 -3
- package/dist/reducers/reducer_shift.js +1 -3
- package/dist/reducers/reducer_simulation.js +1 -3
- package/dist/reducers/reducer_status.js +1 -3
- package/dist/reducers/reducer_submit.js +1 -3
- package/dist/reducers/reducer_threshold.js +199 -29
- package/dist/reducers/reducer_ui.js +1 -3
- package/dist/reducers/reducer_voltammetry.js +3 -7
- package/dist/reducers/reducer_wavelength.js +1 -3
- package/dist/sagas/saga_multi_entities.js +35 -14
- package/dist/sagas/saga_multiplicity.js +1 -2
- package/dist/third_party/jAnalyzer.js +1 -1
- package/package.json +18 -1
package/dist/helpers/init.js
CHANGED
|
@@ -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 =
|
|
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(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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 =
|
|
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
|
package/dist/helpers/mount.js
CHANGED
|
@@ -49,8 +49,7 @@ const MountPath = (target, color) => {
|
|
|
49
49
|
return path;
|
|
50
50
|
};
|
|
51
51
|
exports.MountPath = MountPath;
|
|
52
|
-
const MountComparePath =
|
|
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
|
};
|