@complat/react-spectra-editor 0.11.3 → 0.11.4-beta.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/components/d3_line/line_focus_bk.js +860 -0
- package/dist/components/d3_multi/index_bk.js +240 -0
- package/dist/components/d3_multi/multi_focus_bk.js +550 -0
- package/dist/components/panel/compare_bk.js +370 -0
- package/dist/components/panel/info_bk.js +341 -0
- package/dist/components/panel/multiplicity_bk.js +405 -0
- package/dist/helpers/chem_bk.js +779 -0
- package/dist/helpers/converter_bk.js +106 -0
- package/dist/helpers/format_bk.js +462 -0
- package/dist/index_bk.js +760 -0
- package/dist/layer_content_bk.js +128 -0
- package/dist/layer_prism_bk.js +186 -0
- package/dist/reducers/reducer_edit_peak_bk.js +111 -0
- package/dist/reducers/reducer_integration_bk.js +137 -0
- package/dist/reducers/reducer_jcamp_bk.js +74 -0
- package/dist/reducers/reducer_multiplicity_bk.js +131 -0
- package/dist/reducers/reducer_shift_bk.js +99 -0
- package/dist/sagas/saga_edit_peak_bk.js +84 -0
- package/dist/sagas/saga_multiplicity_bk.js +387 -0
- package/dist/sagas/saga_ui_bk.js +488 -0
- package/package.json +3 -2
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
8
|
+
|
|
9
|
+
var _react = require('react');
|
|
10
|
+
|
|
11
|
+
var _react2 = _interopRequireDefault(_react);
|
|
12
|
+
|
|
13
|
+
var _reactRedux = require('react-redux');
|
|
14
|
+
|
|
15
|
+
var _redux = require('redux');
|
|
16
|
+
|
|
17
|
+
var _propTypes = require('prop-types');
|
|
18
|
+
|
|
19
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
20
|
+
|
|
21
|
+
var _chem = require('../../helpers/chem');
|
|
22
|
+
|
|
23
|
+
var _manager = require('../../actions/manager');
|
|
24
|
+
|
|
25
|
+
var _ui = require('../../actions/ui');
|
|
26
|
+
|
|
27
|
+
var _list_ui = require('../../constants/list_ui');
|
|
28
|
+
|
|
29
|
+
var _cyclic_voltammetry = require('../../actions/cyclic_voltammetry');
|
|
30
|
+
|
|
31
|
+
var _multi_focus = require('./multi_focus');
|
|
32
|
+
|
|
33
|
+
var _multi_focus2 = _interopRequireDefault(_multi_focus);
|
|
34
|
+
|
|
35
|
+
var _draw = require('../common/draw');
|
|
36
|
+
|
|
37
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
38
|
+
|
|
39
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
40
|
+
|
|
41
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
42
|
+
|
|
43
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
44
|
+
|
|
45
|
+
var W = Math.round(window.innerWidth * 0.90 * 9 / 12); // ROI
|
|
46
|
+
var H = Math.round(window.innerHeight * 0.90 * 0.85); // ROI
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
var ViewerMulti = function (_React$Component) {
|
|
50
|
+
_inherits(ViewerMulti, _React$Component);
|
|
51
|
+
|
|
52
|
+
function ViewerMulti(props) {
|
|
53
|
+
_classCallCheck(this, ViewerMulti);
|
|
54
|
+
|
|
55
|
+
var _this = _possibleConstructorReturn(this, (ViewerMulti.__proto__ || Object.getPrototypeOf(ViewerMulti)).call(this, props));
|
|
56
|
+
|
|
57
|
+
var _this$props = _this.props,
|
|
58
|
+
entities = _this$props.entities,
|
|
59
|
+
clickUiTargetAct = _this$props.clickUiTargetAct,
|
|
60
|
+
selectUiSweepAct = _this$props.selectUiSweepAct,
|
|
61
|
+
scrollUiWheelAct = _this$props.scrollUiWheelAct;
|
|
62
|
+
|
|
63
|
+
_this.rootKlass = ".d3Line";
|
|
64
|
+
|
|
65
|
+
_this.focus = new _multi_focus2.default({
|
|
66
|
+
W: W, H: H, entities: entities, clickUiTargetAct: clickUiTargetAct, selectUiSweepAct: selectUiSweepAct, scrollUiWheelAct: scrollUiWheelAct
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
_this.normChange = _this.normChange.bind(_this);
|
|
70
|
+
return _this;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
_createClass(ViewerMulti, [{
|
|
74
|
+
key: 'componentDidMount',
|
|
75
|
+
value: function componentDidMount() {
|
|
76
|
+
var _props = this.props,
|
|
77
|
+
curveSt = _props.curveSt,
|
|
78
|
+
seed = _props.seed,
|
|
79
|
+
peak = _props.peak,
|
|
80
|
+
cLabel = _props.cLabel,
|
|
81
|
+
xLabel = _props.xLabel,
|
|
82
|
+
yLabel = _props.yLabel,
|
|
83
|
+
feature = _props.feature,
|
|
84
|
+
tTrEndPts = _props.tTrEndPts,
|
|
85
|
+
tSfPeaks = _props.tSfPeaks,
|
|
86
|
+
editPeakSt = _props.editPeakSt,
|
|
87
|
+
layoutSt = _props.layoutSt,
|
|
88
|
+
sweepExtentSt = _props.sweepExtentSt,
|
|
89
|
+
isUiNoBrushSt = _props.isUiNoBrushSt,
|
|
90
|
+
isHidden = _props.isHidden,
|
|
91
|
+
resetAllAct = _props.resetAllAct,
|
|
92
|
+
cyclicvoltaSt = _props.cyclicvoltaSt;
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
(0, _draw.drawDestroy)(this.rootKlass);
|
|
96
|
+
resetAllAct(feature);
|
|
97
|
+
|
|
98
|
+
var filterSeed = seed;
|
|
99
|
+
var filterPeak = peak;
|
|
100
|
+
|
|
101
|
+
(0, _draw.drawMain)(this.rootKlass, W, H);
|
|
102
|
+
this.focus.create({
|
|
103
|
+
curveSt: curveSt,
|
|
104
|
+
filterSeed: filterSeed,
|
|
105
|
+
filterPeak: filterPeak,
|
|
106
|
+
tTrEndPts: tTrEndPts,
|
|
107
|
+
tSfPeaks: tSfPeaks,
|
|
108
|
+
editPeakSt: editPeakSt,
|
|
109
|
+
layoutSt: layoutSt,
|
|
110
|
+
sweepExtentSt: sweepExtentSt,
|
|
111
|
+
isUiNoBrushSt: isUiNoBrushSt,
|
|
112
|
+
cyclicvoltaSt: cyclicvoltaSt
|
|
113
|
+
});
|
|
114
|
+
(0, _draw.drawLabel)(this.rootKlass, cLabel, xLabel, yLabel);
|
|
115
|
+
(0, _draw.drawDisplay)(this.rootKlass, isHidden);
|
|
116
|
+
}
|
|
117
|
+
}, {
|
|
118
|
+
key: 'componentDidUpdate',
|
|
119
|
+
value: function componentDidUpdate(prevProps) {
|
|
120
|
+
var _props2 = this.props,
|
|
121
|
+
entities = _props2.entities,
|
|
122
|
+
curveSt = _props2.curveSt,
|
|
123
|
+
seed = _props2.seed,
|
|
124
|
+
peak = _props2.peak,
|
|
125
|
+
cLabel = _props2.cLabel,
|
|
126
|
+
xLabel = _props2.xLabel,
|
|
127
|
+
yLabel = _props2.yLabel,
|
|
128
|
+
tTrEndPts = _props2.tTrEndPts,
|
|
129
|
+
tSfPeaks = _props2.tSfPeaks,
|
|
130
|
+
editPeakSt = _props2.editPeakSt,
|
|
131
|
+
layoutSt = _props2.layoutSt,
|
|
132
|
+
sweepExtentSt = _props2.sweepExtentSt,
|
|
133
|
+
isUiNoBrushSt = _props2.isUiNoBrushSt,
|
|
134
|
+
isHidden = _props2.isHidden,
|
|
135
|
+
cyclicvoltaSt = _props2.cyclicvoltaSt;
|
|
136
|
+
|
|
137
|
+
this.normChange(prevProps);
|
|
138
|
+
|
|
139
|
+
var filterSeed = seed;
|
|
140
|
+
var filterPeak = peak;
|
|
141
|
+
|
|
142
|
+
this.focus.update({
|
|
143
|
+
entities: entities,
|
|
144
|
+
curveSt: curveSt,
|
|
145
|
+
filterSeed: filterSeed,
|
|
146
|
+
filterPeak: filterPeak,
|
|
147
|
+
tTrEndPts: tTrEndPts,
|
|
148
|
+
tSfPeaks: tSfPeaks,
|
|
149
|
+
editPeakSt: editPeakSt,
|
|
150
|
+
layoutSt: layoutSt,
|
|
151
|
+
sweepExtentSt: sweepExtentSt,
|
|
152
|
+
isUiNoBrushSt: isUiNoBrushSt,
|
|
153
|
+
cyclicvoltaSt: cyclicvoltaSt
|
|
154
|
+
});
|
|
155
|
+
(0, _draw.drawLabel)(this.rootKlass, cLabel, xLabel, yLabel);
|
|
156
|
+
(0, _draw.drawDisplay)(this.rootKlass, isHidden);
|
|
157
|
+
}
|
|
158
|
+
}, {
|
|
159
|
+
key: 'componentWillUnmount',
|
|
160
|
+
value: function componentWillUnmount() {
|
|
161
|
+
(0, _draw.drawDestroy)(this.rootKlass);
|
|
162
|
+
}
|
|
163
|
+
}, {
|
|
164
|
+
key: 'normChange',
|
|
165
|
+
value: function normChange(prevProps) {
|
|
166
|
+
var _props3 = this.props,
|
|
167
|
+
feature = _props3.feature,
|
|
168
|
+
resetAllAct = _props3.resetAllAct,
|
|
169
|
+
entities = _props3.entities;
|
|
170
|
+
|
|
171
|
+
var oldEntities = prevProps.entities;
|
|
172
|
+
if (oldEntities !== entities) {
|
|
173
|
+
resetAllAct(feature);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}, {
|
|
177
|
+
key: 'render',
|
|
178
|
+
value: function render() {
|
|
179
|
+
return _react2.default.createElement('div', { className: 'd3Line' });
|
|
180
|
+
}
|
|
181
|
+
}]);
|
|
182
|
+
|
|
183
|
+
return ViewerMulti;
|
|
184
|
+
}(_react2.default.Component);
|
|
185
|
+
|
|
186
|
+
var mapStateToProps = function mapStateToProps(state, props) {
|
|
187
|
+
return {
|
|
188
|
+
curveSt: state.curve,
|
|
189
|
+
seed: (0, _chem.Topic2Seed)(state, props),
|
|
190
|
+
peak: (0, _chem.Feature2Peak)(state, props),
|
|
191
|
+
tTrEndPts: (0, _chem.ToThresEndPts)(state, props),
|
|
192
|
+
tSfPeaks: (0, _chem.ToShiftPeaks)(state, props),
|
|
193
|
+
editPeakSt: state.editPeak.present,
|
|
194
|
+
layoutSt: state.layout,
|
|
195
|
+
sweepExtentSt: state.ui.sweepExtent,
|
|
196
|
+
isUiNoBrushSt: _list_ui.LIST_NON_BRUSH_TYPES.indexOf(state.ui.sweepType) < 0,
|
|
197
|
+
cyclicvoltaSt: state.cyclicvolta,
|
|
198
|
+
maxminPeakSt: (0, _chem.Feature2MaxMinPeak)(state, props)
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
203
|
+
return (0, _redux.bindActionCreators)({
|
|
204
|
+
resetAllAct: _manager.resetAll,
|
|
205
|
+
clickUiTargetAct: _ui.clickUiTarget,
|
|
206
|
+
selectUiSweepAct: _ui.selectUiSweep,
|
|
207
|
+
scrollUiWheelAct: _ui.scrollUiWheel,
|
|
208
|
+
addNewCylicVoltaPairPeakAct: _cyclic_voltammetry.addNewCylicVoltaPairPeak,
|
|
209
|
+
addCylicVoltaMaxPeakAct: _cyclic_voltammetry.addCylicVoltaMaxPeak,
|
|
210
|
+
addCylicVoltaMinPeakAct: _cyclic_voltammetry.addCylicVoltaMinPeak
|
|
211
|
+
}, dispatch);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
ViewerMulti.propTypes = {
|
|
215
|
+
curveSt: _propTypes2.default.object.isRequired,
|
|
216
|
+
entities: _propTypes2.default.array.isRequired,
|
|
217
|
+
seed: _propTypes2.default.array.isRequired,
|
|
218
|
+
peak: _propTypes2.default.array.isRequired,
|
|
219
|
+
xLabel: _propTypes2.default.string.isRequired,
|
|
220
|
+
yLabel: _propTypes2.default.string.isRequired,
|
|
221
|
+
feature: _propTypes2.default.object.isRequired,
|
|
222
|
+
tTrEndPts: _propTypes2.default.array.isRequired,
|
|
223
|
+
tSfPeaks: _propTypes2.default.array.isRequired,
|
|
224
|
+
editPeakSt: _propTypes2.default.object.isRequired,
|
|
225
|
+
layoutSt: _propTypes2.default.string.isRequired,
|
|
226
|
+
sweepExtentSt: _propTypes2.default.object.isRequired,
|
|
227
|
+
isUiNoBrushSt: _propTypes2.default.bool.isRequired,
|
|
228
|
+
resetAllAct: _propTypes2.default.func.isRequired,
|
|
229
|
+
clickUiTargetAct: _propTypes2.default.func.isRequired,
|
|
230
|
+
selectUiSweepAct: _propTypes2.default.func.isRequired,
|
|
231
|
+
scrollUiWheelAct: _propTypes2.default.func.isRequired,
|
|
232
|
+
isHidden: _propTypes2.default.bool,
|
|
233
|
+
cyclicvoltaSt: _propTypes2.default.object.isRequired,
|
|
234
|
+
maxminPeakSt: _propTypes2.default.object,
|
|
235
|
+
addNewCylicVoltaPairPeakAct: _propTypes2.default.func.isRequired,
|
|
236
|
+
addCylicVoltaMaxPeakAct: _propTypes2.default.func.isRequired,
|
|
237
|
+
addCylicVoltaMinPeakAct: _propTypes2.default.func.isRequired
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(ViewerMulti);
|