@complat/react-spectra-editor 1.1.0 → 1.2.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__/units/components/cmd_bar/03_peak.test.js +56 -6
- package/dist/__tests__/units/components/common/draw.test.js +1 -3
- package/dist/actions/edit_peak.js +7 -2
- package/dist/components/cmd_bar/03_peak.js +47 -10
- package/dist/components/cmd_bar/index.js +2 -1
- package/dist/components/cmd_bar/r01_layout.js +1 -1
- package/dist/components/cmd_bar/tri_btn.js +5 -3
- package/dist/components/common/draw.js +1 -3
- package/dist/components/d3_line/line_focus.js +1 -3
- package/dist/components/d3_multi/multi_focus.js +1 -3
- package/dist/components/d3_rect/rect_focus.js +1 -3
- package/dist/constants/action_type.js +2 -1
- package/dist/helpers/brush.js +1 -3
- package/dist/helpers/compass.js +1 -3
- package/dist/helpers/extractPeaksEdit.js +8 -1
- package/dist/helpers/init.js +1 -3
- package/dist/helpers/zoom.js +1 -3
- package/dist/reducers/reducer_edit_peak.js +26 -1
- package/dist/reducers/undo_redo_config.js +3 -3
- package/package.json +1 -1
|
@@ -13,13 +13,59 @@ const store = mockStore({
|
|
|
13
13
|
ui: {
|
|
14
14
|
sweepType: _list_ui.LIST_UI_SWEEP_TYPE.ZOOMIN
|
|
15
15
|
},
|
|
16
|
-
layout: _list_layout.LIST_LAYOUT.MS
|
|
16
|
+
layout: _list_layout.LIST_LAYOUT.MS,
|
|
17
|
+
curve: {
|
|
18
|
+
curveIdx: 0
|
|
19
|
+
},
|
|
20
|
+
editPeak: {
|
|
21
|
+
present: {
|
|
22
|
+
selectedIdx: 0,
|
|
23
|
+
peaks: [{
|
|
24
|
+
prevOffset: 0,
|
|
25
|
+
pos: [],
|
|
26
|
+
neg: []
|
|
27
|
+
}]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
threshold: {
|
|
31
|
+
isEdit: true,
|
|
32
|
+
value: false,
|
|
33
|
+
upper: false,
|
|
34
|
+
lower: false
|
|
35
|
+
},
|
|
36
|
+
shift: {
|
|
37
|
+
shifts: []
|
|
38
|
+
},
|
|
39
|
+
cyclicvolta: {}
|
|
17
40
|
});
|
|
18
41
|
const nmrStore = mockStore({
|
|
19
42
|
ui: {
|
|
20
43
|
sweepType: _list_ui.LIST_UI_SWEEP_TYPE.ZOOMIN
|
|
21
44
|
},
|
|
22
|
-
layout: _list_layout.LIST_LAYOUT.H1
|
|
45
|
+
layout: _list_layout.LIST_LAYOUT.H1,
|
|
46
|
+
curve: {
|
|
47
|
+
curveIdx: 0
|
|
48
|
+
},
|
|
49
|
+
editPeak: {
|
|
50
|
+
present: {
|
|
51
|
+
selectedIdx: 0,
|
|
52
|
+
peaks: [{
|
|
53
|
+
prevOffset: 0,
|
|
54
|
+
pos: [],
|
|
55
|
+
neg: []
|
|
56
|
+
}]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
threshold: {
|
|
60
|
+
isEdit: true,
|
|
61
|
+
value: false,
|
|
62
|
+
upper: false,
|
|
63
|
+
lower: false
|
|
64
|
+
},
|
|
65
|
+
shift: {
|
|
66
|
+
shifts: []
|
|
67
|
+
},
|
|
68
|
+
cyclicvolta: {}
|
|
23
69
|
});
|
|
24
70
|
const dispatchMock = () => Promise.resolve({});
|
|
25
71
|
store.dispatch = jest.fn(dispatchMock);
|
|
@@ -40,23 +86,27 @@ describe('<Peak />', () => {
|
|
|
40
86
|
it('render when has Set reference button', async () => {
|
|
41
87
|
const renderer = /*#__PURE__*/React.createElement(AppWrapper, {
|
|
42
88
|
store: nmrStore
|
|
43
|
-
}, /*#__PURE__*/React.createElement(_peak.default,
|
|
89
|
+
}, /*#__PURE__*/React.createElement(_peak.default, {
|
|
90
|
+
feature: {}
|
|
91
|
+
}));
|
|
44
92
|
const {
|
|
45
93
|
queryByTestId
|
|
46
94
|
} = (0, _react.render)(renderer);
|
|
47
95
|
const renderResult = queryByTestId('Peak');
|
|
48
96
|
expect(renderResult).toBeInTheDocument();
|
|
49
|
-
expect(renderResult.childElementCount).toEqual(
|
|
97
|
+
expect(renderResult.childElementCount).toEqual(4);
|
|
50
98
|
});
|
|
51
99
|
it('render when does not hav Set reference button', async () => {
|
|
52
100
|
const renderer = /*#__PURE__*/React.createElement(AppWrapper, {
|
|
53
101
|
store: store
|
|
54
|
-
}, /*#__PURE__*/React.createElement(_peak.default,
|
|
102
|
+
}, /*#__PURE__*/React.createElement(_peak.default, {
|
|
103
|
+
feature: {}
|
|
104
|
+
}));
|
|
55
105
|
const {
|
|
56
106
|
queryByTestId
|
|
57
107
|
} = (0, _react.render)(renderer);
|
|
58
108
|
const renderResult = queryByTestId('Peak');
|
|
59
109
|
expect(renderResult).toBeInTheDocument();
|
|
60
|
-
expect(renderResult.childElementCount).toEqual(
|
|
110
|
+
expect(renderResult.childElementCount).toEqual(3);
|
|
61
111
|
});
|
|
62
112
|
});
|
|
@@ -4,9 +4,7 @@ var _react = require("@testing-library/react");
|
|
|
4
4
|
require("@testing-library/jest-dom");
|
|
5
5
|
var _draw = require("../../../../components/common/draw");
|
|
6
6
|
var _react2 = require("react");
|
|
7
|
-
|
|
8
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
7
|
+
const d3 = require('d3');
|
|
10
8
|
describe('common/draw', () => {
|
|
11
9
|
describe('.drawMain()', () => {
|
|
12
10
|
it('d3 draw main svg view box', () => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.rmFromPosList = exports.rmFromNegList = void 0;
|
|
6
|
+
exports.rmFromPosList = exports.rmFromNegList = exports.clearAllPeaks = void 0;
|
|
7
7
|
var _action_type = require("../constants/action_type");
|
|
8
8
|
const rmFromPosList = payload => ({
|
|
9
9
|
type: _action_type.EDITPEAK.RM_POSITIVE,
|
|
@@ -14,4 +14,9 @@ const rmFromNegList = payload => ({
|
|
|
14
14
|
type: _action_type.EDITPEAK.RM_NEGATIVE,
|
|
15
15
|
payload
|
|
16
16
|
});
|
|
17
|
-
exports.rmFromNegList = rmFromNegList;
|
|
17
|
+
exports.rmFromNegList = rmFromNegList;
|
|
18
|
+
const clearAllPeaks = payload => ({
|
|
19
|
+
type: _action_type.EDITPEAK.CLEAR_ALL,
|
|
20
|
+
payload
|
|
21
|
+
});
|
|
22
|
+
exports.clearAllPeaks = clearAllPeaks;
|
|
@@ -17,7 +17,10 @@ var _ui = require("../../actions/ui");
|
|
|
17
17
|
var _cfg = _interopRequireDefault(require("../../helpers/cfg"));
|
|
18
18
|
var _common = require("./common");
|
|
19
19
|
var _list_ui = require("../../constants/list_ui");
|
|
20
|
-
|
|
20
|
+
var _tri_btn = _interopRequireDefault(require("./tri_btn"));
|
|
21
|
+
var _edit_peak = require("../../actions/edit_peak");
|
|
22
|
+
var _extractPeaksEdit = require("../../helpers/extractPeaksEdit");
|
|
23
|
+
/* eslint-disable prefer-object-spread, function-paren-newline, no-unused-vars,
|
|
21
24
|
react/function-component-definition, react/require-default-props, max-len,
|
|
22
25
|
react/no-unused-prop-types */
|
|
23
26
|
|
|
@@ -34,15 +37,28 @@ const Peak = _ref => {
|
|
|
34
37
|
disableSetRefSt,
|
|
35
38
|
isHandleMaxAndMinPeaksSt,
|
|
36
39
|
cyclicVotaSt,
|
|
37
|
-
curveSt
|
|
40
|
+
curveSt,
|
|
41
|
+
clearAllPeaksAct,
|
|
42
|
+
feature,
|
|
43
|
+
editPeakSt,
|
|
44
|
+
thresSt,
|
|
45
|
+
shiftSt,
|
|
46
|
+
layoutSt
|
|
38
47
|
} = _ref;
|
|
39
48
|
let onSweepPeakAdd = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.PEAK_ADD);
|
|
40
49
|
let onSweepPeakDELETE = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.PEAK_DELETE);
|
|
41
50
|
let onSweepAnchorShift = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.ANCHOR_SHIFT);
|
|
51
|
+
const {
|
|
52
|
+
curveIdx
|
|
53
|
+
} = curveSt;
|
|
54
|
+
const onClearAll = () => {
|
|
55
|
+
const dataPeaks = (0, _extractPeaksEdit.extractAutoPeaks)(feature, thresSt, shiftSt, layoutSt);
|
|
56
|
+
clearAllPeaksAct({
|
|
57
|
+
curveIdx,
|
|
58
|
+
dataPeaks
|
|
59
|
+
});
|
|
60
|
+
};
|
|
42
61
|
if (isHandleMaxAndMinPeaksSt) {
|
|
43
|
-
const {
|
|
44
|
-
curveIdx
|
|
45
|
-
} = curveSt;
|
|
46
62
|
const {
|
|
47
63
|
spectraList
|
|
48
64
|
} = cyclicVotaSt;
|
|
@@ -84,7 +100,17 @@ const Peak = _ref => {
|
|
|
84
100
|
onClick: onSweepPeakDELETE
|
|
85
101
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
86
102
|
className: (0, _classnames.default)(classes.txt, 'txt-sv-bar-rmpeak')
|
|
87
|
-
}, "P-")))),
|
|
103
|
+
}, "P-")))), /*#__PURE__*/_react.default.createElement(_tri_btn.default, {
|
|
104
|
+
content: {
|
|
105
|
+
tp: 'Clear All Peaks'
|
|
106
|
+
},
|
|
107
|
+
cb: onClearAll,
|
|
108
|
+
isClearAllDisabled: disableRmPeakSt
|
|
109
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
110
|
+
className: (0, _classnames.default)(classes.txt, 'txt-sv-bar-rmallpeaks')
|
|
111
|
+
}, "P"), /*#__PURE__*/_react.default.createElement("span", {
|
|
112
|
+
className: (0, _classnames.default)(classes.txt, classes.txtIcon, 'txt-sv-bar-rmallpeaks')
|
|
113
|
+
}, "x")), !disableSetRefSt ? /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
88
114
|
title: /*#__PURE__*/_react.default.createElement("span", {
|
|
89
115
|
className: "txt-sv-tp"
|
|
90
116
|
}, "Set Reference")
|
|
@@ -96,7 +122,7 @@ const Peak = _ref => {
|
|
|
96
122
|
className: classes.icon
|
|
97
123
|
})))) : null);
|
|
98
124
|
};
|
|
99
|
-
const mapStateToProps = (state,
|
|
125
|
+
const mapStateToProps = (state, props) => (
|
|
100
126
|
// eslint-disable-line
|
|
101
127
|
{
|
|
102
128
|
isFocusAddPeakSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.PEAK_ADD || state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_ADD_MAX_PEAK || state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_ADD_MIN_PEAK,
|
|
@@ -107,10 +133,15 @@ const mapStateToProps = (state, _) => (
|
|
|
107
133
|
disableSetRefSt: _cfg.default.btnCmdSetRef(state.layout),
|
|
108
134
|
isHandleMaxAndMinPeaksSt: !_cfg.default.hidePanelCyclicVolta(state.layout),
|
|
109
135
|
cyclicVotaSt: state.cyclicvolta,
|
|
110
|
-
curveSt: state.curve
|
|
136
|
+
curveSt: state.curve,
|
|
137
|
+
editPeakSt: state.editPeak.present,
|
|
138
|
+
thresSt: state.threshold,
|
|
139
|
+
layoutSt: state.layout,
|
|
140
|
+
shiftSt: state.shift
|
|
111
141
|
});
|
|
112
142
|
const mapDispatchToProps = dispatch => (0, _redux.bindActionCreators)({
|
|
113
|
-
setUiSweepTypeAct: _ui.setUiSweepType
|
|
143
|
+
setUiSweepTypeAct: _ui.setUiSweepType,
|
|
144
|
+
clearAllPeaksAct: _edit_peak.clearAllPeaks
|
|
114
145
|
}, dispatch);
|
|
115
146
|
Peak.propTypes = {
|
|
116
147
|
classes: _propTypes.default.object.isRequired,
|
|
@@ -123,6 +154,12 @@ Peak.propTypes = {
|
|
|
123
154
|
setUiSweepTypeAct: _propTypes.default.func.isRequired,
|
|
124
155
|
isHandleMaxAndMinPeaksSt: _propTypes.default.bool.isRequired,
|
|
125
156
|
cyclicVotaSt: _propTypes.default.object.isRequired,
|
|
126
|
-
curveSt: _propTypes.default.object.isRequired
|
|
157
|
+
curveSt: _propTypes.default.object.isRequired,
|
|
158
|
+
clearAllPeaksAct: _propTypes.default.func.isRequired,
|
|
159
|
+
feature: _propTypes.default.object.isRequired,
|
|
160
|
+
editPeakSt: _propTypes.default.object.isRequired,
|
|
161
|
+
thresSt: _propTypes.default.object.isRequired,
|
|
162
|
+
layoutSt: _propTypes.default.string.isRequired,
|
|
163
|
+
shiftSt: _propTypes.default.object.isRequired
|
|
127
164
|
};
|
|
128
165
|
var _default = exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), (0, _withStyles.default)(styles))(Peak);
|
|
@@ -44,7 +44,8 @@ const CmdBar = _ref => {
|
|
|
44
44
|
}, /*#__PURE__*/_react.default.createElement(_viewer.default, {
|
|
45
45
|
editorOnly: editorOnly
|
|
46
46
|
}), /*#__PURE__*/_react.default.createElement(_zoom.default, null), /*#__PURE__*/_react.default.createElement(_peak.default, {
|
|
47
|
-
jcampIdx: jcampIdx
|
|
47
|
+
jcampIdx: jcampIdx,
|
|
48
|
+
feature: feature
|
|
48
49
|
}), /*#__PURE__*/_react.default.createElement(_pecker.default, {
|
|
49
50
|
jcampIdx: jcampIdx
|
|
50
51
|
}), /*#__PURE__*/_react.default.createElement(_integration.default, null), /*#__PURE__*/_react.default.createElement(_multiplicity.default, null), /*#__PURE__*/_react.default.createElement(_undo_redo.default, null), /*#__PURE__*/_react.default.createElement(_r04_submit.default, {
|
|
@@ -62,7 +62,7 @@ const shiftSelect = (classes, layoutSt, setShiftRefAct, shiftSt, curveSt) => {
|
|
|
62
62
|
}, /*#__PURE__*/_react.default.createElement(_material.InputLabel, {
|
|
63
63
|
id: "select-solvent-label",
|
|
64
64
|
className: (0, _classnames.default)(classes.selectLabel, 'select-sv-bar-label')
|
|
65
|
-
}, "
|
|
65
|
+
}, "Reference"), /*#__PURE__*/_react.default.createElement(_material.Select, {
|
|
66
66
|
value: shiftRef,
|
|
67
67
|
labelId: "select-solvent-label",
|
|
68
68
|
label: "Solvent",
|
|
@@ -52,7 +52,8 @@ class TriBtn extends _react.default.Component {
|
|
|
52
52
|
const {
|
|
53
53
|
content,
|
|
54
54
|
layoutSt,
|
|
55
|
-
children
|
|
55
|
+
children,
|
|
56
|
+
isClearAllDisabled
|
|
56
57
|
} = this.props;
|
|
57
58
|
const {
|
|
58
59
|
tp
|
|
@@ -64,7 +65,7 @@ class TriBtn extends _react.default.Component {
|
|
|
64
65
|
title: title
|
|
65
66
|
}, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_common.MuButton, {
|
|
66
67
|
className: (0, _classnames.default)('btn-sv-bar-one'),
|
|
67
|
-
disabled: _cfg.default.btnCmdMpy(layoutSt) && _cfg.default.btnCmdIntg(layoutSt),
|
|
68
|
+
disabled: isClearAllDisabled === false ? false : _cfg.default.btnCmdMpy(layoutSt) && _cfg.default.btnCmdIntg(layoutSt),
|
|
68
69
|
onClick: this.onToggle
|
|
69
70
|
}, children)));
|
|
70
71
|
}
|
|
@@ -112,6 +113,7 @@ TriBtn.propTypes = {
|
|
|
112
113
|
layoutSt: _propTypes.default.string.isRequired,
|
|
113
114
|
content: _propTypes.default.object.isRequired,
|
|
114
115
|
cb: _propTypes.default.func.isRequired,
|
|
115
|
-
children: _propTypes.default.node.isRequired
|
|
116
|
+
children: _propTypes.default.node.isRequired,
|
|
117
|
+
isClearAllDisabled: _propTypes.default.bool.isRequired
|
|
116
118
|
};
|
|
117
119
|
var _default = exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)((0, _styles.withStyles)(styles)(TriBtn));
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.drawMain = exports.drawLabel = exports.drawDisplay = exports.drawDestroy = exports.drawArrowOnCurve = void 0;
|
|
7
|
-
|
|
8
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
7
|
+
const d3 = require('d3');
|
|
10
8
|
const drawMain = (klass, w, h) => {
|
|
11
9
|
d3.select(klass).append('svg').attr('class', 'd3Svg').attr('preserveAspectRatio', 'xMinYMin meet').attr('viewBox', `0 0 ${w} ${h}`);
|
|
12
10
|
};
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var d3 = _interopRequireWildcard(require("d3"));
|
|
9
8
|
var _init = require("../../helpers/init");
|
|
10
9
|
var _mount = require("../../helpers/mount");
|
|
11
10
|
var _brush = _interopRequireDefault(require("../../helpers/brush"));
|
|
@@ -18,10 +17,9 @@ var _format = _interopRequireDefault(require("../../helpers/format"));
|
|
|
18
17
|
var _cfg = _interopRequireDefault(require("../../helpers/cfg"));
|
|
19
18
|
var _list_layout = require("../../constants/list_layout");
|
|
20
19
|
var _calc = require("../../helpers/calc");
|
|
21
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
22
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
20
|
/* eslint-disable prefer-object-spread, no-mixed-operators */
|
|
24
21
|
|
|
22
|
+
const d3 = require('d3');
|
|
25
23
|
class LineFocus {
|
|
26
24
|
constructor(props) {
|
|
27
25
|
const {
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var d3 = _interopRequireWildcard(require("d3"));
|
|
9
8
|
var _init = require("../../helpers/init");
|
|
10
9
|
var _mount = require("../../helpers/mount");
|
|
11
10
|
var _converter = require("../../helpers/converter");
|
|
@@ -19,11 +18,10 @@ var _focus = require("../../helpers/focus");
|
|
|
19
18
|
var _integration = require("../../helpers/integration");
|
|
20
19
|
var _multiplicity_calc = require("../../helpers/multiplicity_calc");
|
|
21
20
|
var _calc = require("../../helpers/calc");
|
|
22
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
23
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
21
|
/* eslint-disable no-unused-vars, prefer-object-spread, no-mixed-operators,
|
|
25
22
|
no-unneeded-ternary, arrow-body-style */
|
|
26
23
|
|
|
24
|
+
const d3 = require('d3');
|
|
27
25
|
class MultiFocus {
|
|
28
26
|
constructor(props) {
|
|
29
27
|
const {
|
|
@@ -5,15 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var d3 = _interopRequireWildcard(require("d3"));
|
|
9
8
|
var _init = require("../../helpers/init");
|
|
10
9
|
var _brush = _interopRequireDefault(require("../../helpers/brush"));
|
|
11
10
|
var _mount = require("../../helpers/mount");
|
|
12
11
|
var _compass = require("../../helpers/compass");
|
|
13
12
|
var _converter = require("../../helpers/converter");
|
|
14
13
|
var _list_layout = require("../../constants/list_layout");
|
|
15
|
-
|
|
16
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
const d3 = require('d3');
|
|
17
15
|
class RectFocus {
|
|
18
16
|
constructor(props) {
|
|
19
17
|
const {
|
|
@@ -16,7 +16,8 @@ const EDITPEAK = exports.EDITPEAK = {
|
|
|
16
16
|
ADD_NEGATIVE: 'ADD_TO_NEGATIVE_EDITPEAK_LIST',
|
|
17
17
|
RM_NEGATIVE: 'RM_FROM_NEGATIVE_EDITPEAK_LIST',
|
|
18
18
|
RM_POSITIVE: 'RM_FROM_POSITIVE_EDITPEAK_LIST',
|
|
19
|
-
SHIFT: 'EDITPEAK_SHIFT'
|
|
19
|
+
SHIFT: 'EDITPEAK_SHIFT',
|
|
20
|
+
CLEAR_ALL: 'EDITPEAK_CLEAR_ALL'
|
|
20
21
|
};
|
|
21
22
|
const STATUS = exports.STATUS = {
|
|
22
23
|
TOGGLEBTNSUBMIT: 'TOGGLE_BTN_SUBMIT',
|
package/dist/helpers/brush.js
CHANGED
|
@@ -4,12 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var d3 = _interopRequireWildcard(require("d3"));
|
|
8
7
|
var _compass = require("./compass");
|
|
9
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
8
|
/* eslint-disable prefer-object-spread */
|
|
12
9
|
|
|
10
|
+
const d3 = require('d3');
|
|
13
11
|
const wheeled = (focus, event) => {
|
|
14
12
|
const {
|
|
15
13
|
currentExtent,
|
package/dist/helpers/compass.js
CHANGED
|
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.TfRescale = exports.MouseMove = exports.MountCompass = exports.ClickCompass = void 0;
|
|
8
|
-
var d3 = _interopRequireWildcard(require("d3"));
|
|
9
8
|
var _format = _interopRequireDefault(require("./format"));
|
|
10
9
|
var _chem = require("./chem");
|
|
11
|
-
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
|
+
const d3 = require('d3');
|
|
13
11
|
const TfRescale = focus => {
|
|
14
12
|
const xt = focus.scales.x;
|
|
15
13
|
const yt = focus.scales.y;
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.extractPeaksEdit = exports.extractAreaUnderCurve = void 0;
|
|
7
|
+
exports.extractPeaksEdit = exports.extractAutoPeaks = exports.extractAreaUnderCurve = void 0;
|
|
8
8
|
var _converter = require("./converter");
|
|
9
9
|
var _chem = require("./chem");
|
|
10
10
|
var _shift = require("./shift");
|
|
@@ -35,6 +35,13 @@ const extractPeaksEdit = function (feature, editPeakSt, thresSt, shiftSt, layout
|
|
|
35
35
|
return peaksEdit;
|
|
36
36
|
};
|
|
37
37
|
exports.extractPeaksEdit = extractPeaksEdit;
|
|
38
|
+
const extractAutoPeaks = function (feature, thresSt, shiftSt, layoutSt) {
|
|
39
|
+
let atIndex = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
40
|
+
const offset = _format.default.isMsLayout(layoutSt) ? msOffset() : niOffset(shiftSt, atIndex);
|
|
41
|
+
const peaks = (0, _chem.Convert2Peak)(feature, thresSt.value, offset);
|
|
42
|
+
return peaks;
|
|
43
|
+
};
|
|
44
|
+
exports.extractAutoPeaks = extractAutoPeaks;
|
|
38
45
|
const getAUCValue = (integrationSt, layoutSt) => {
|
|
39
46
|
const {
|
|
40
47
|
refArea,
|
package/dist/helpers/init.js
CHANGED
|
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.InitTip = exports.InitScale = exports.InitPathCall = exports.InitAxisCall = void 0;
|
|
8
|
-
var d3 = _interopRequireWildcard(require("d3"));
|
|
9
8
|
var _d3Tip = _interopRequireDefault(require("d3-tip"));
|
|
10
9
|
var _format = _interopRequireDefault(require("./format"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
|
+
const d3 = require('d3');
|
|
13
11
|
const InitScale = function (target) {
|
|
14
12
|
let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
15
13
|
const xRange = reverse ? [target.w, 0] : [0, target.w];
|
package/dist/helpers/zoom.js
CHANGED
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
7
|
+
const d3 = require('d3');
|
|
10
8
|
const resetZoom = main => {
|
|
11
9
|
main.svg.call(main.zoom.transform, d3.zoomIdentity);
|
|
12
10
|
main.svg.selectAll('.brush').call(main.brush.move, null);
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default = void 0;
|
|
7
|
+
exports.editPeakReducer = exports.default = void 0;
|
|
8
8
|
var _reduxUndo = _interopRequireDefault(require("redux-undo"));
|
|
9
9
|
var _action_type = require("../constants/action_type");
|
|
10
10
|
var _undo_redo_config = require("./undo_redo_config");
|
|
@@ -180,6 +180,28 @@ const processShift = (state, action) => {
|
|
|
180
180
|
peaks: newPeaks
|
|
181
181
|
});
|
|
182
182
|
};
|
|
183
|
+
const clearAllPeaks = (state, action) => {
|
|
184
|
+
const {
|
|
185
|
+
curveIdx,
|
|
186
|
+
dataPeaks
|
|
187
|
+
} = action.payload;
|
|
188
|
+
const {
|
|
189
|
+
peaks
|
|
190
|
+
} = state;
|
|
191
|
+
const selectedEditPeaks = peaks[curveIdx];
|
|
192
|
+
const {
|
|
193
|
+
pos
|
|
194
|
+
} = selectedEditPeaks;
|
|
195
|
+
const newSelectedEditPeaks = Object.assign({}, selectedEditPeaks, {
|
|
196
|
+
pos: [],
|
|
197
|
+
neg: [...pos, ...dataPeaks]
|
|
198
|
+
});
|
|
199
|
+
const newPeaks = [...peaks];
|
|
200
|
+
newPeaks[curveIdx] = newSelectedEditPeaks;
|
|
201
|
+
return Object.assign({}, state, {
|
|
202
|
+
peaks: newPeaks
|
|
203
|
+
});
|
|
204
|
+
};
|
|
183
205
|
const editPeakReducer = function () {
|
|
184
206
|
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
185
207
|
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -194,6 +216,8 @@ const editPeakReducer = function () {
|
|
|
194
216
|
return rmFromNeg(state, action);
|
|
195
217
|
case _action_type.EDITPEAK.SHIFT:
|
|
196
218
|
return processShift(state, action);
|
|
219
|
+
case _action_type.EDITPEAK.CLEAR_ALL:
|
|
220
|
+
return clearAllPeaks(state, action);
|
|
197
221
|
case _action_type.MANAGER.RESETALL:
|
|
198
222
|
return {
|
|
199
223
|
selectedIdx: 0,
|
|
@@ -207,5 +231,6 @@ const editPeakReducer = function () {
|
|
|
207
231
|
return _undo_redo_config.undoRedoActions.indexOf(action.type) >= 0 ? Object.assign({}, state) : state;
|
|
208
232
|
}
|
|
209
233
|
};
|
|
234
|
+
exports.editPeakReducer = editPeakReducer;
|
|
210
235
|
const undoableEditPeakReducer = (0, _reduxUndo.default)(editPeakReducer, _undo_redo_config.undoRedoConfig);
|
|
211
236
|
var _default = exports.default = undoableEditPeakReducer;
|
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.undoRedoConfig = exports.undoRedoActions = void 0;
|
|
7
7
|
var _reduxUndo = require("redux-undo");
|
|
8
8
|
var _action_type = require("../constants/action_type");
|
|
9
|
-
const undoRedoActions = exports.undoRedoActions = [_action_type.EDITPEAK.ADD_POSITIVE, _action_type.EDITPEAK.ADD_NEGATIVE, _action_type.EDITPEAK.RM_POSITIVE, _action_type.EDITPEAK.RM_NEGATIVE, _action_type.EDITPEAK.SHIFT, _action_type.MANAGER.RESETALL, _action_type.MANAGER.RESETSHIFT, _action_type.MANAGER.RESET_INIT_COMMON, _action_type.MANAGER.RESET_INIT_NMR, _action_type.MANAGER.RESET_INIT_MS, _action_type.MANAGER.RESET_INIT_COMMON_WITH_INTERGATION, _action_type.UI.SWEEP.SELECT_INTEGRATION, _action_type.UI.SWEEP.SELECT_MULTIPLICITY_RDC, _action_type.INTEGRATION.RM_ONE, _action_type.INTEGRATION.SET_REF, _action_type.INTEGRATION.SET_FKR, _action_type.INTEGRATION.RESET_ALL, _action_type.INTEGRATION.CLEAR_ALL, _action_type.MULTIPLICITY.PEAK_RM_BY_PANEL_RDC, _action_type.MULTIPLICITY.PEAK_RM_BY_UI_RDC, _action_type.MULTIPLICITY.PEAK_ADD_BY_UI_RDC, _action_type.MULTIPLICITY.RESET_ONE_RDC, _action_type.MULTIPLICITY.UPDATE_J, _action_type.MULTIPLICITY.TYPE_SELECT_RDC, _action_type.MULTIPLICITY.ONE_CLICK, _action_type.MULTIPLICITY.ONE_CLICK_BY_UI, _action_type.MULTIPLICITY.RESET_ALL_RDC, _action_type.MULTIPLICITY.CLEAR_ALL];
|
|
9
|
+
const undoRedoActions = exports.undoRedoActions = [_action_type.EDITPEAK.ADD_POSITIVE, _action_type.EDITPEAK.ADD_NEGATIVE, _action_type.EDITPEAK.RM_POSITIVE, _action_type.EDITPEAK.RM_NEGATIVE, _action_type.EDITPEAK.SHIFT, _action_type.EDITPEAK.CLEAR_ALL, _action_type.MANAGER.RESETALL, _action_type.MANAGER.RESETSHIFT, _action_type.MANAGER.RESET_INIT_COMMON, _action_type.MANAGER.RESET_INIT_NMR, _action_type.MANAGER.RESET_INIT_MS, _action_type.MANAGER.RESET_INIT_COMMON_WITH_INTERGATION, _action_type.UI.SWEEP.SELECT_INTEGRATION, _action_type.UI.SWEEP.SELECT_MULTIPLICITY_RDC, _action_type.INTEGRATION.RM_ONE, _action_type.INTEGRATION.SET_REF, _action_type.INTEGRATION.SET_FKR, _action_type.INTEGRATION.RESET_ALL, _action_type.INTEGRATION.CLEAR_ALL, _action_type.MULTIPLICITY.PEAK_RM_BY_PANEL_RDC, _action_type.MULTIPLICITY.PEAK_RM_BY_UI_RDC, _action_type.MULTIPLICITY.PEAK_ADD_BY_UI_RDC, _action_type.MULTIPLICITY.RESET_ONE_RDC, _action_type.MULTIPLICITY.UPDATE_J, _action_type.MULTIPLICITY.TYPE_SELECT_RDC, _action_type.MULTIPLICITY.ONE_CLICK, _action_type.MULTIPLICITY.ONE_CLICK_BY_UI, _action_type.MULTIPLICITY.RESET_ALL_RDC, _action_type.MULTIPLICITY.CLEAR_ALL];
|
|
10
10
|
const undoRedoConfig = exports.undoRedoConfig = {
|
|
11
11
|
debug: false,
|
|
12
12
|
limit: 10,
|
|
13
13
|
ignoreInitialState: true,
|
|
14
14
|
filter: (0, _reduxUndo.includeAction)(undoRedoActions),
|
|
15
|
-
clearHistoryType: [_action_type.EDITPEAK.SHIFT, _action_type.MANAGER.RESETALL, _action_type.MANAGER.RESETSHIFT, _action_type.MANAGER.RESET_INIT_COMMON, _action_type.MANAGER.RESET_INIT_NMR, _action_type.MANAGER.RESET_INIT_MS, _action_type.MANAGER.RESET_INIT_COMMON_WITH_INTERGATION],
|
|
16
|
-
neverSkipReducer: [_action_type.EDITPEAK.SHIFT, _action_type.MANAGER.RESETALL, _action_type.MANAGER.RESETSHIFT, _action_type.MANAGER.RESET_INIT_COMMON, _action_type.MANAGER.RESET_INIT_NMR, _action_type.MANAGER.RESET_INIT_MS, _action_type.MANAGER.RESET_INIT_COMMON_WITH_INTERGATION]
|
|
15
|
+
clearHistoryType: [_action_type.EDITPEAK.SHIFT, _action_type.EDITPEAK.CLEAR_ALL, _action_type.MANAGER.RESETALL, _action_type.MANAGER.RESETSHIFT, _action_type.MANAGER.RESET_INIT_COMMON, _action_type.MANAGER.RESET_INIT_NMR, _action_type.MANAGER.RESET_INIT_MS, _action_type.MANAGER.RESET_INIT_COMMON_WITH_INTERGATION],
|
|
16
|
+
neverSkipReducer: [_action_type.EDITPEAK.SHIFT, _action_type.EDITPEAK.CLEAR_ALL, _action_type.MANAGER.RESETALL, _action_type.MANAGER.RESETSHIFT, _action_type.MANAGER.RESET_INIT_COMMON, _action_type.MANAGER.RESET_INIT_NMR, _action_type.MANAGER.RESET_INIT_MS, _action_type.MANAGER.RESET_INIT_COMMON_WITH_INTERGATION]
|
|
17
17
|
};
|