@complat/react-spectra-editor 1.7.1 → 1.8.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/CHANGELOG.md +28 -0
- package/LICENSE +21 -662
- package/README.md +5 -0
- package/dist/__tests__/fixtures/lc_ms_jcamp.js +2329 -0
- package/dist/__tests__/fixtures/lc_ms_jcamp_2.js +2874 -0
- package/dist/__tests__/fixtures/lc_ms_jcamp_mz_chemstation.js +3242 -0
- package/dist/__tests__/fixtures/lc_ms_jcamp_tic_chemstation.js +854 -0
- package/dist/__tests__/fixtures/lc_ms_jcamp_tic_neg.js +1233 -0
- package/dist/__tests__/fixtures/lc_ms_jcamp_tic_pos.js +1233 -0
- package/dist/__tests__/fixtures/lc_ms_jcamp_uvvis.js +48908 -0
- package/dist/__tests__/fixtures/lc_ms_jcamp_uvvis_chemstation.js +15424 -0
- package/dist/__tests__/units/components/cmd_bar/r05_submit_btn.test.js +158 -3
- package/dist/__tests__/units/components/d3_line_rect.test.js +85 -0
- package/dist/__tests__/units/components/d3_multi/multi_focus.test.js +43 -0
- package/dist/__tests__/units/components/hplc_viewer.test.js +123 -0
- package/dist/__tests__/units/components/panel/info.test.js +55 -15
- package/dist/__tests__/units/features/lc-ms/parsing/lcmsCategory.test.js +73 -0
- package/dist/__tests__/units/features/lc-ms/submit/peaks.test.js +310 -0
- package/dist/actions/curve.js +5 -2
- package/dist/actions/hplc_ms.js +66 -0
- package/dist/actions/integration.js +17 -2
- package/dist/actions/ui.js +39 -11
- package/dist/app.js +21 -8
- package/dist/components/cmd_bar/01_viewer.js +15 -11
- package/dist/components/cmd_bar/03_peak.js +25 -16
- package/dist/components/cmd_bar/04_integration.js +116 -17
- package/dist/components/cmd_bar/08_peak_group.js +83 -0
- package/dist/components/cmd_bar/collapsible_toolbar_group.js +101 -0
- package/dist/components/cmd_bar/common.js +4 -3
- package/dist/components/cmd_bar/index.js +76 -18
- package/dist/components/cmd_bar/r01_layout.js +6 -0
- package/dist/components/cmd_bar/r02_scan.js +15 -11
- package/dist/components/cmd_bar/r03_threshold.js +19 -3
- package/dist/components/cmd_bar/r04_submit.js +61 -6
- package/dist/components/cmd_bar/r05_submit_btn.js +60 -13
- package/dist/components/cmd_bar/r06_predict_btn.js +4 -4
- package/dist/components/cmd_bar/r07_wavelength_btn.js +10 -9
- package/dist/components/cmd_bar/r09_detector.js +2 -2
- package/dist/components/cmd_bar/tri_btn.js +4 -1
- package/dist/components/common/draw.js +6 -5
- package/dist/components/d3_line/index.js +70 -15
- package/dist/components/d3_line/line_focus.js +104 -67
- package/dist/components/d3_line_rect/index.js +836 -0
- package/dist/components/d3_line_rect/line_focus.js +526 -0
- package/dist/components/d3_line_rect/multi_focus.js +433 -0
- package/dist/components/d3_line_rect/rect_focus.js +247 -0
- package/dist/components/d3_multi/index.js +154 -163
- package/dist/components/d3_multi/multi_focus.js +117 -68
- package/dist/components/d3_rect/index.js +6 -0
- package/dist/components/d3_rect/rect_focus.js +17 -5
- package/dist/components/hplc_viewer.js +169 -0
- package/dist/components/lc_ms_uv_tools_bar.js +175 -0
- package/dist/components/multi_jcamps_viewer.js +17 -5
- package/dist/components/panel/compare.js +84 -62
- package/dist/components/panel/cyclic_voltamery_data.js +15 -14
- package/dist/components/panel/graph_selection.js +32 -30
- package/dist/components/panel/index.js +28 -22
- package/dist/components/panel/info.js +75 -26
- package/dist/constants/action_type.js +23 -2
- package/dist/constants/list_graph.js +16 -0
- package/dist/constants/list_layout.js +2 -1
- package/dist/constants/list_ui.js +5 -2
- package/dist/features/lc-ms/entities/extractEntityLCMS.js +187 -0
- package/dist/features/lc-ms/parsing/chemstation.js +108 -0
- package/dist/features/lc-ms/parsing/index.js +46 -0
- package/dist/features/lc-ms/parsing/lcmsCategory.js +44 -0
- package/dist/features/lc-ms/parsing/lcmsJcampInfo.js +18 -0
- package/dist/features/lc-ms/parsing/lcmsMsPage.js +241 -0
- package/dist/features/lc-ms/parsing/pageValue.js +27 -0
- package/dist/features/lc-ms/submit/index.js +24 -0
- package/dist/features/lc-ms/submit/peaks.js +66 -0
- package/dist/features/lc-ms/ui/wavelengthSelect.js +54 -0
- package/dist/fn.js +4 -1
- package/dist/helpers/brush.js +74 -19
- package/dist/helpers/calc.js +4 -2
- package/dist/helpers/cfg.js +5 -4
- package/dist/helpers/chem.js +449 -71
- package/dist/helpers/compass.js +181 -17
- package/dist/helpers/extractEntityLCMS.js +24 -0
- package/dist/helpers/extractParams.js +118 -33
- package/dist/helpers/extractPeaksEdit.js +29 -9
- package/dist/helpers/format.js +189 -4
- package/dist/helpers/init.js +25 -5
- package/dist/helpers/integration.js +130 -17
- package/dist/helpers/integration_draft.js +43 -0
- package/dist/helpers/integration_focus.js +155 -0
- package/dist/helpers/integration_jcamp.js +68 -0
- package/dist/helpers/integration_split.js +202 -0
- package/dist/helpers/mount.js +8 -1
- package/dist/helpers/sweep.js +39 -0
- package/dist/index.js +284 -26
- package/dist/layer_content.js +17 -3
- package/dist/layer_init.js +124 -14
- package/dist/layer_prism.js +31 -5
- package/dist/reducers/index.js +3 -1
- package/dist/reducers/reducer_curve.js +54 -36
- package/dist/reducers/reducer_hplc_ms/hydrate.js +289 -0
- package/dist/reducers/reducer_hplc_ms/index.js +122 -0
- package/dist/reducers/reducer_hplc_ms/persistence.js +74 -0
- package/dist/reducers/reducer_hplc_ms/tic.js +70 -0
- package/dist/reducers/reducer_hplc_ms/utils.js +70 -0
- package/dist/reducers/reducer_hplc_ms/uvvis.js +377 -0
- package/dist/reducers/reducer_integration.js +265 -7
- package/dist/reducers/reducer_layout.js +1 -1
- package/dist/reducers/reducer_submit.js +2 -1
- package/dist/reducers/reducer_ui.js +149 -13
- package/dist/reducers/undo_redo_config.js +2 -2
- package/dist/sagas/saga_lcms_ui.js +85 -0
- package/dist/sagas/saga_ui.js +177 -74
- package/dist/setupTests.js +5 -5
- package/package.json +10 -7
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "formatLcmsIntegralsForBackend", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _peaks.formatLcmsIntegralsForBackend;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "formatLcmsPeaksForBackend", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _peaks.formatLcmsPeaksForBackend;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "getLcmsMzPageData", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _peaks.getLcmsMzPageData;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
var _peaks = require("./peaks");
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatLcmsIntegralsForBackend = formatLcmsIntegralsForBackend;
|
|
7
|
+
exports.formatLcmsPeaksForBackend = formatLcmsPeaksForBackend;
|
|
8
|
+
exports.getLcmsMzPageData = getLcmsMzPageData;
|
|
9
|
+
function formatLcmsPeaksForBackend(hplcMsSt) {
|
|
10
|
+
const allPeaks = [];
|
|
11
|
+
if (hplcMsSt && hplcMsSt.uvvis && hplcMsSt.uvvis.spectraList) {
|
|
12
|
+
hplcMsSt.uvvis.spectraList.forEach(spectrum => {
|
|
13
|
+
if (spectrum.peaks && spectrum.peaks.length > 0) {
|
|
14
|
+
const {
|
|
15
|
+
pageValue
|
|
16
|
+
} = spectrum;
|
|
17
|
+
spectrum.peaks.forEach(peak => {
|
|
18
|
+
allPeaks.push({
|
|
19
|
+
...peak,
|
|
20
|
+
wavelength: pageValue
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return allPeaks;
|
|
27
|
+
}
|
|
28
|
+
function formatLcmsIntegralsForBackend(hplcMsSt) {
|
|
29
|
+
const allIntegrals = [];
|
|
30
|
+
if (hplcMsSt && hplcMsSt.uvvis && hplcMsSt.uvvis.spectraList) {
|
|
31
|
+
hplcMsSt.uvvis.spectraList.forEach(spectrum => {
|
|
32
|
+
if (spectrum.integrations && spectrum.integrations.length > 0) {
|
|
33
|
+
const {
|
|
34
|
+
pageValue
|
|
35
|
+
} = spectrum;
|
|
36
|
+
spectrum.integrations.forEach(integral => {
|
|
37
|
+
allIntegrals.push({
|
|
38
|
+
from: integral.xL,
|
|
39
|
+
to: integral.xU,
|
|
40
|
+
value: integral.area,
|
|
41
|
+
integral: integral.absoluteArea,
|
|
42
|
+
wavelength: pageValue
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return allIntegrals;
|
|
49
|
+
}
|
|
50
|
+
function getLcmsMzPageData(hplcMsSt) {
|
|
51
|
+
const tic = hplcMsSt?.tic;
|
|
52
|
+
const ms = hplcMsSt?.ms;
|
|
53
|
+
if (!tic || !ms) return null;
|
|
54
|
+
const polarity = tic.polarity || 'positive';
|
|
55
|
+
let polarityKey = 'neutral';
|
|
56
|
+
if (polarity === 'negative') polarityKey = 'negative';else if (polarity === 'positive') polarityKey = 'positive';
|
|
57
|
+
const ticDataX = tic[polarityKey]?.data?.x;
|
|
58
|
+
if (!Array.isArray(ticDataX) || !Number.isFinite(tic.currentPageValue)) return null;
|
|
59
|
+
let currentIndex = ms[polarityKey]?.pageValues?.findIndex(value => Number.isFinite(value) && Math.abs(value - tic.currentPageValue) < 1e-6);
|
|
60
|
+
if (!Number.isFinite(currentIndex) || currentIndex < 0) {
|
|
61
|
+
currentIndex = ticDataX.findIndex(x => Math.abs(x - tic.currentPageValue) < 1e-6);
|
|
62
|
+
}
|
|
63
|
+
if (currentIndex < 0) return null;
|
|
64
|
+
const peaks = ms[polarityKey]?.peaks?.[currentIndex];
|
|
65
|
+
return Array.isArray(peaks) ? peaks : null;
|
|
66
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _material = require("@mui/material");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
/* eslint-disable react/function-component-definition */
|
|
13
|
+
|
|
14
|
+
const renderWavelengthSelect = (classes, hplcMsSt, updateWavelengthAct, options = {}) => {
|
|
15
|
+
const {
|
|
16
|
+
labelId = 'select-decimal-label',
|
|
17
|
+
label = 'Decimal',
|
|
18
|
+
width = '140px'
|
|
19
|
+
} = options;
|
|
20
|
+
const uvvis = hplcMsSt && hplcMsSt.uvvis || {};
|
|
21
|
+
const {
|
|
22
|
+
listWaveLength = null,
|
|
23
|
+
selectedWaveLength
|
|
24
|
+
} = uvvis;
|
|
25
|
+
const items = listWaveLength ? listWaveLength.map(d => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
26
|
+
value: d,
|
|
27
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
28
|
+
className: (0, _classnames.default)(classes.txtOpt, 'option-sv-bar-decimal'),
|
|
29
|
+
children: d
|
|
30
|
+
})
|
|
31
|
+
}, d)) : [];
|
|
32
|
+
const hasSelectedWaveLength = listWaveLength && listWaveLength.includes(selectedWaveLength);
|
|
33
|
+
const resolvedSelectedWaveLength = hasSelectedWaveLength ? selectedWaveLength : listWaveLength && listWaveLength[0];
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.FormControl, {
|
|
35
|
+
className: (0, _classnames.default)(classes.fieldDecimal),
|
|
36
|
+
variant: "outlined",
|
|
37
|
+
style: {
|
|
38
|
+
width
|
|
39
|
+
},
|
|
40
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.InputLabel, {
|
|
41
|
+
id: labelId,
|
|
42
|
+
className: (0, _classnames.default)(classes.selectLabel, 'select-sv-bar-label'),
|
|
43
|
+
children: "Wavelength (nm)"
|
|
44
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Select, {
|
|
45
|
+
labelId: labelId,
|
|
46
|
+
label: label,
|
|
47
|
+
value: resolvedSelectedWaveLength,
|
|
48
|
+
onChange: updateWavelengthAct,
|
|
49
|
+
className: (0, _classnames.default)(classes.selectInput, 'input-sv-bar-decimal'),
|
|
50
|
+
children: items
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
var _default = exports.default = renderWavelengthSelect;
|
package/dist/fn.js
CHANGED
|
@@ -10,14 +10,17 @@ var _chem = require("./helpers/chem");
|
|
|
10
10
|
var _converter = require("./helpers/converter");
|
|
11
11
|
var _multiplicity_calc = require("./helpers/multiplicity_calc");
|
|
12
12
|
var _carbonFeatures = require("./helpers/carbonFeatures");
|
|
13
|
+
var _integration_jcamp = require("./helpers/integration_jcamp");
|
|
13
14
|
var _list_layout = require("./constants/list_layout");
|
|
14
15
|
/* eslint-disable prefer-object-spread */
|
|
15
16
|
|
|
16
17
|
const FN = Object.assign({}, _format.default, {
|
|
17
18
|
ExtractJcamp: _chem.ExtractJcamp,
|
|
19
|
+
buildLcmsMsPageJcamp: _chem.buildLcmsMsPageJcamp,
|
|
18
20
|
ToXY: _converter.ToXY,
|
|
19
21
|
LIST_LAYOUT: _list_layout.LIST_LAYOUT,
|
|
20
22
|
CalcMpyCenter: _multiplicity_calc.calcMpyCenter,
|
|
21
|
-
CarbonFeatures: _carbonFeatures.carbonFeatures
|
|
23
|
+
CarbonFeatures: _carbonFeatures.carbonFeatures,
|
|
24
|
+
serializeIntegrationRecords: _integration_jcamp.serializeIntegrationRecords
|
|
22
25
|
});
|
|
23
26
|
var _default = exports.default = FN;
|
package/dist/helpers/brush.js
CHANGED
|
@@ -1,31 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = void 0;
|
|
7
8
|
var _compass = require("./compass");
|
|
9
|
+
var _integration_draft = require("./integration_draft.js");
|
|
10
|
+
var _sweep = require("./sweep.js");
|
|
11
|
+
var _list_ui = require("../constants/list_ui");
|
|
12
|
+
var _cfg = _interopRequireDefault(require("./cfg"));
|
|
8
13
|
/* eslint-disable prefer-object-spread */
|
|
9
14
|
|
|
15
|
+
// eslint-disable-line import/extensions
|
|
16
|
+
// eslint-disable-line import/extensions
|
|
17
|
+
|
|
10
18
|
const d3 = require('d3');
|
|
11
19
|
const wheeled = (focus, event) => {
|
|
12
20
|
const {
|
|
13
21
|
currentExtent,
|
|
14
|
-
scrollUiWheelAct
|
|
22
|
+
scrollUiWheelAct,
|
|
23
|
+
brushClass
|
|
15
24
|
} = focus;
|
|
16
25
|
// WORKAROUND: firefox wheel compatibilty
|
|
17
26
|
const wheelEvent = focus.isFirefox ? -event.deltaY : event.wheelDelta; // eslint-disable-line
|
|
18
27
|
const direction = wheelEvent > 0;
|
|
19
28
|
scrollUiWheelAct(Object.assign({}, currentExtent, {
|
|
20
|
-
direction
|
|
29
|
+
direction,
|
|
30
|
+
brushClass
|
|
21
31
|
}));
|
|
22
32
|
};
|
|
23
|
-
const
|
|
33
|
+
const usesTwoClickIntegAdd = (focus, isUiAddIntgSt) => isUiAddIntgSt && _cfg.default.showIntegSplitTools(focus.layout);
|
|
34
|
+
const brushed = (focus, xOnly, event, brushedClass = '.d3Svg') => {
|
|
24
35
|
const {
|
|
25
36
|
selectUiSweepAct,
|
|
26
37
|
data,
|
|
27
38
|
dataPks,
|
|
28
39
|
brush,
|
|
40
|
+
brushX,
|
|
29
41
|
w,
|
|
30
42
|
h,
|
|
31
43
|
scales
|
|
@@ -42,7 +54,15 @@ const brushed = (focus, isUiAddIntgSt, event) => {
|
|
|
42
54
|
yL: yes[0],
|
|
43
55
|
yU: yes[1]
|
|
44
56
|
};
|
|
45
|
-
if (
|
|
57
|
+
if (xOnly) {
|
|
58
|
+
if (focus.isUiAddIntgSt) {
|
|
59
|
+
const payload = (0, _sweep.buildSweepPayloadFromXBounds)(focus, scales.x.invert(selection[0]), scales.x.invert(selection[1]));
|
|
60
|
+
selectUiSweepAct(payload);
|
|
61
|
+
if (brushX) {
|
|
62
|
+
focus.svg.selectAll('.brushX').call(brushX.move, null);
|
|
63
|
+
}
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
46
66
|
xes = selection.map(scales.x.invert).sort((a, b) => a - b);
|
|
47
67
|
xExtent = {
|
|
48
68
|
xL: xes[0],
|
|
@@ -67,34 +87,69 @@ const brushed = (focus, isUiAddIntgSt, event) => {
|
|
|
67
87
|
data,
|
|
68
88
|
dataPks
|
|
69
89
|
});
|
|
70
|
-
|
|
90
|
+
let svgSel = null;
|
|
91
|
+
if (focus?.svg && typeof focus.svg.selectAll === 'function') {
|
|
92
|
+
svgSel = focus.svg;
|
|
93
|
+
} else if (typeof brushedClass === 'string') {
|
|
94
|
+
svgSel = d3.select(brushedClass);
|
|
95
|
+
}
|
|
96
|
+
if (svgSel && typeof svgSel.selectAll === 'function' && !svgSel.empty()) {
|
|
97
|
+
const brushSelection = xOnly ? svgSel.selectAll('.brushX') : svgSel.selectAll('.brush');
|
|
98
|
+
if (!brushSelection.empty()) {
|
|
99
|
+
if (xOnly && brushX) {
|
|
100
|
+
brushSelection.call(brushX.move, null);
|
|
101
|
+
} else if (brush) {
|
|
102
|
+
brushSelection.call(brush.move, null);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
71
106
|
};
|
|
72
|
-
const MountBrush = (focus, isUiAddIntgSt, isUiNoBrushSt) => {
|
|
107
|
+
const MountBrush = (focus, isUiAddIntgSt, isUiNoBrushSt, brushedClass = '.d3Svg') => {
|
|
73
108
|
const {
|
|
74
109
|
root,
|
|
75
110
|
svg,
|
|
76
111
|
brush,
|
|
77
112
|
brushX,
|
|
78
113
|
w,
|
|
79
|
-
h
|
|
114
|
+
h,
|
|
115
|
+
uiSt,
|
|
116
|
+
graphIndex
|
|
80
117
|
} = focus;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
118
|
+
Object.assign(focus, {
|
|
119
|
+
isUiAddIntgSt
|
|
120
|
+
});
|
|
121
|
+
const twoClickIntegAdd = usesTwoClickIntegAdd(focus, isUiAddIntgSt);
|
|
122
|
+
const {
|
|
123
|
+
firstIntegrationPoint,
|
|
124
|
+
data,
|
|
125
|
+
jcampIdx
|
|
126
|
+
} = focus;
|
|
127
|
+
const isSameIntegrationDraft = firstIntegrationPoint && firstIntegrationPoint.jcampIdx === jcampIdx && firstIntegrationPoint.dataLength === data.length;
|
|
128
|
+
if (!isUiAddIntgSt || firstIntegrationPoint && !isSameIntegrationDraft) {
|
|
129
|
+
(0, _integration_draft.clearPendingIntegrationDraft)();
|
|
130
|
+
Object.assign(focus, {
|
|
131
|
+
firstIntegrationPoint: null
|
|
132
|
+
});
|
|
133
|
+
(0, _compass.clearIntegrationPreview)(focus);
|
|
134
|
+
}
|
|
135
|
+
if (!root || !svg || typeof svg.selectAll !== 'function') return;
|
|
136
|
+
svg.selectAll('.brush, .brushX').remove();
|
|
137
|
+
const isZoomInSubview = uiSt?.zoom?.sweepTypes?.[graphIndex] === _list_ui.LIST_UI_SWEEP_TYPE.ZOOMIN;
|
|
138
|
+
const isZoomInGlobal = uiSt?.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.ZOOMIN;
|
|
139
|
+
const isIntegrationAdd = uiSt?.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.INTEGRATION_ADD;
|
|
140
|
+
const isMultiplicitySweepAdd = uiSt?.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.MULTIPLICITY_SWEEP_ADD;
|
|
141
|
+
const isZoomIn = isZoomInSubview || isZoomInGlobal;
|
|
142
|
+
if (graphIndex !== undefined && !(graphIndex === 0 && isIntegrationAdd) && !isZoomIn && !isMultiplicitySweepAdd) return;
|
|
143
|
+
const isXAxisOnly = focus?.xOnlyBrush === true;
|
|
144
|
+
const xOnly = isUiAddIntgSt || isXAxisOnly && !isZoomIn;
|
|
145
|
+
const brushedCb = event => brushed(focus, xOnly, event, brushedClass);
|
|
84
146
|
const wheeledCb = event => wheeled(focus, event);
|
|
85
|
-
if (isUiNoBrushSt) {
|
|
147
|
+
if (isUiNoBrushSt && !twoClickIntegAdd) {
|
|
86
148
|
const target = isUiAddIntgSt ? brushX : brush;
|
|
87
149
|
target.handleSize(10).extent([[0, 0], [w, h]]).on('end', brushedCb);
|
|
88
|
-
|
|
89
|
-
// append brush components
|
|
90
150
|
const klass = isUiAddIntgSt ? 'brushX' : 'brush';
|
|
91
151
|
root.append('g').attr('class', klass).on('mousemove', event => (0, _compass.MouseMove)(event, focus)).call(target);
|
|
92
152
|
}
|
|
93
153
|
svg.on('wheel', wheeledCb);
|
|
94
154
|
};
|
|
95
|
-
var _default = exports.default = MountBrush;
|
|
96
|
-
// main.svg.on('dblclick', resetedCb);
|
|
97
|
-
// const reseted = (main) => {
|
|
98
|
-
// const { selectUiSweepAct } = main;
|
|
99
|
-
// selectUiSweepAct({ xExtent: false, yExtent: false });
|
|
100
|
-
// };
|
|
155
|
+
var _default = exports.default = MountBrush;
|
package/dist/helpers/calc.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.calcSlope = exports.almostEqual = void 0;
|
|
6
|
+
exports.findClosest = exports.calcSlope = exports.almostEqual = void 0;
|
|
7
7
|
const almostEqual = (a, b) => Math.abs(a - b) < 0.00000001 * Math.abs(a + b);
|
|
8
8
|
exports.almostEqual = almostEqual;
|
|
9
9
|
const calcSlope = (x1, y1, x2, y2) => {
|
|
@@ -12,4 +12,6 @@ const calcSlope = (x1, y1, x2, y2) => {
|
|
|
12
12
|
}
|
|
13
13
|
return (y2 - y1) / (x2 - x1);
|
|
14
14
|
};
|
|
15
|
-
exports.calcSlope = calcSlope;
|
|
15
|
+
exports.calcSlope = calcSlope;
|
|
16
|
+
const findClosest = (arr, target) => arr.reduce((prev, curr) => Math.abs(curr - target) < Math.abs(prev - target) ? curr : prev); // eslint-disable-line
|
|
17
|
+
exports.findClosest = findClosest;
|
package/dist/helpers/cfg.js
CHANGED
|
@@ -6,14 +6,14 @@ 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) || _format.default.isGCLayout(layoutSt);
|
|
9
|
+
const btnCmdAnaViewer = layoutSt => _format.default.isMsLayout(layoutSt) || _format.default.isLCMsLayout(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);
|
|
13
|
-
const btnCmdSetRef = layoutSt => !_format.default.isNmrLayout(layoutSt);
|
|
14
|
-
|
|
15
|
-
const btnCmdIntg = layoutSt => !(_format.default.isNmrLayout(layoutSt) || _format.default.isHplcUvVisLayout(layoutSt)); // eslint-disable-line
|
|
13
|
+
const btnCmdSetRef = layoutSt => !_format.default.isNmrLayout(layoutSt);
|
|
14
|
+
const btnCmdIntg = layoutSt => !(_format.default.isNmrLayout(layoutSt) || _format.default.isHplcUvVisLayout(layoutSt) || _format.default.isLCMsLayout(layoutSt)); // eslint-disable-line
|
|
16
15
|
|
|
16
|
+
const showIntegSplitTools = layoutSt => _format.default.isHplcUvVisLayout(layoutSt);
|
|
17
17
|
const btnCmdMpy = layoutSt => !_format.default.isNmrLayout(layoutSt);
|
|
18
18
|
const btnCmdMpyPeak = (layoutSt, mpySt, curveIdx = 0) => {
|
|
19
19
|
const {
|
|
@@ -50,6 +50,7 @@ const Config = {
|
|
|
50
50
|
btnCmdRmPeak,
|
|
51
51
|
btnCmdSetRef,
|
|
52
52
|
btnCmdIntg,
|
|
53
|
+
showIntegSplitTools,
|
|
53
54
|
btnCmdMpy,
|
|
54
55
|
btnCmdMpyPeak,
|
|
55
56
|
hideCmdThres,
|