@complat/react-spectra-editor 1.0.0-rc2 → 1.0.0-rc20.patch-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.
- package/README.md +16 -0
- package/dist/__tests__/fixtures/aif_jcamp_1.js +136 -0
- package/dist/__tests__/fixtures/aif_jcamp_2.js +122 -0
- package/dist/__tests__/fixtures/backup/nmr1h_a.js +3518 -0
- package/dist/__tests__/fixtures/backup/xrd_jcamp_1.js +10705 -0
- package/dist/__tests__/fixtures/cds_jcamp.js +861 -0
- package/dist/__tests__/fixtures/compare_ir_1_jcamp.js +585 -0
- package/dist/__tests__/fixtures/compare_ir_2_jcamp.js +515 -0
- package/dist/__tests__/fixtures/compare_uv_vis_jcamp.js +640 -0
- package/dist/__tests__/fixtures/cyclic_voltammetry_1.js +778 -0
- package/dist/__tests__/fixtures/cyclic_voltammetry_2.js +758 -0
- package/dist/__tests__/fixtures/cyclic_voltammetry_3.js +759 -0
- package/dist/__tests__/fixtures/dls_acf_jcamp.js +148 -0
- package/dist/__tests__/fixtures/dls_intensity_jcamp.js +151 -0
- package/dist/__tests__/fixtures/emissions_jcamp.js +883 -0
- package/dist/__tests__/fixtures/hplc_uvvis_jcamp.js +638 -0
- package/dist/__tests__/fixtures/hplc_uvvis_jcamp_2.js +221 -0
- package/dist/__tests__/fixtures/ir_jcamp.js +148 -0
- package/dist/__tests__/fixtures/ir_result.js +46 -0
- package/dist/__tests__/fixtures/ir_svg.js +8 -0
- package/dist/__tests__/fixtures/ms_jcamp.js +64 -0
- package/dist/__tests__/fixtures/nmr13c_dept_jcamp.js +3543 -0
- package/dist/__tests__/fixtures/nmr13c_jcamp.js +1229 -0
- package/dist/__tests__/fixtures/nmr15n_jcamp.js +7177 -0
- package/dist/__tests__/fixtures/nmr19f_jcamp.js +6560 -0
- package/dist/__tests__/fixtures/nmr1h_2_jcamp.js +2005 -0
- package/dist/__tests__/fixtures/nmr1h_jcamp.js +4516 -0
- package/dist/__tests__/fixtures/nmr29si_jcamp.js +3029 -0
- package/dist/__tests__/fixtures/nmr31p_jcamp.js +3418 -0
- package/dist/__tests__/fixtures/nmr_result.js +68 -0
- package/dist/__tests__/fixtures/nmr_svg.js +8 -0
- package/dist/__tests__/fixtures/phenylalanin.js +142 -0
- package/dist/__tests__/fixtures/qDescValue.js +65 -0
- package/dist/__tests__/fixtures/raman_jcamp.js +410 -0
- package/dist/__tests__/fixtures/sec_1_jcamp.js +425 -0
- package/dist/__tests__/fixtures/sec_2_jcamp.js +407 -0
- package/dist/__tests__/fixtures/sec_3_jcamp.js +408 -0
- package/dist/__tests__/fixtures/sec_4_jcamp.js +407 -0
- package/dist/__tests__/fixtures/tga_jcamp.js +4157 -0
- package/dist/__tests__/fixtures/uv_vis_jcamp.js +249 -0
- package/dist/__tests__/fixtures/xrd_jcamp_1.js +436 -0
- package/dist/__tests__/fixtures/xrd_jcamp_2.js +955 -0
- package/dist/__tests__/fixtures/xrd_jcamp_3.js +1871 -0
- package/dist/__tests__/units/components/panel/graph_selection.test.js +72 -0
- package/dist/__tests__/units/components/panel/peaks.test.js +87 -0
- package/dist/actions/curve.js +15 -14
- package/dist/actions/cyclic_voltammetry.js +40 -60
- package/dist/actions/edit_peak.js +8 -12
- package/dist/actions/forecast.js +16 -24
- package/dist/actions/integration.js +12 -18
- package/dist/actions/jcamp.js +16 -24
- package/dist/actions/layout.js +4 -6
- package/dist/actions/manager.js +20 -30
- package/dist/actions/meta.js +4 -6
- package/dist/actions/multiplicity.js +24 -36
- package/dist/actions/scan.js +12 -18
- package/dist/actions/shift.js +8 -12
- package/dist/actions/status.js +12 -18
- package/dist/actions/submit.js +16 -24
- package/dist/actions/threshold.js +20 -30
- package/dist/actions/ui.js +25 -31
- package/dist/actions/wavelength.js +4 -6
- package/dist/app.js +25 -23
- package/dist/components/cmd_bar/01_viewer.js +24 -34
- package/dist/components/cmd_bar/02_zoom.js +18 -28
- package/dist/components/cmd_bar/03_peak.js +50 -66
- package/dist/components/cmd_bar/04_integration.js +70 -84
- package/dist/components/cmd_bar/05_multiplicity.js +42 -56
- package/dist/components/cmd_bar/06_undo_redo.js +22 -36
- package/dist/components/cmd_bar/07_pecker.js +24 -34
- package/dist/components/cmd_bar/common.js +11 -7
- package/dist/components/cmd_bar/index.js +17 -23
- package/dist/components/cmd_bar/r01_layout.js +79 -56
- package/dist/components/cmd_bar/r02_scan.js +70 -87
- package/dist/components/cmd_bar/r03_threshold.js +54 -68
- package/dist/components/cmd_bar/r04_submit.js +71 -83
- package/dist/components/cmd_bar/r05_submit_btn.js +64 -72
- package/dist/components/cmd_bar/r06_predict_btn.js +142 -152
- package/dist/components/cmd_bar/r07_wavelength_btn.js +28 -36
- package/dist/components/cmd_bar/tri_btn.js +91 -113
- package/dist/components/common/chem.js +2 -3
- package/dist/components/common/comps.js +2 -2
- package/dist/components/common/draw.js +30 -11
- package/dist/components/d3_line/index.js +154 -176
- package/dist/components/d3_line/line_focus.js +595 -739
- package/dist/components/d3_multi/index.js +153 -174
- package/dist/components/d3_multi/multi_focus.js +725 -850
- package/dist/components/d3_rect/index.js +112 -134
- package/dist/components/d3_rect/rect_focus.js +163 -208
- package/dist/components/forecast/comps.js +60 -68
- package/dist/components/forecast/ir_comps.js +49 -56
- package/dist/components/forecast/ir_viewer.js +61 -68
- package/dist/components/forecast/nmr_comps.js +62 -72
- package/dist/components/forecast/nmr_viewer.js +59 -68
- package/dist/components/forecast/section_loading.js +39 -63
- package/dist/components/forecast_viewer.js +109 -119
- package/dist/components/multi_jcamps_viewer.js +97 -113
- package/dist/components/panel/compare.js +183 -192
- package/dist/components/panel/cyclic_voltamery_data.js +149 -165
- package/dist/components/panel/graph_selection.js +143 -132
- package/dist/components/panel/index.js +112 -144
- package/dist/components/panel/info.js +125 -132
- package/dist/components/panel/multiplicity.js +215 -223
- package/dist/components/panel/multiplicity_coupling.js +108 -136
- package/dist/components/panel/multiplicity_select.js +43 -51
- package/dist/components/panel/peaks.js +130 -132
- package/dist/constants/action_type.js +23 -39
- package/dist/constants/list_layout.js +7 -4
- package/dist/constants/list_shift.js +117 -103
- package/dist/constants/list_ui.js +3 -6
- package/dist/constants/list_wavelength.js +7 -8
- package/dist/fn.js +2 -3
- package/dist/helpers/brush.js +49 -65
- package/dist/helpers/calc.js +2 -4
- package/dist/helpers/carbonFeatures.js +22 -20
- package/dist/helpers/cfg.js +49 -67
- package/dist/helpers/chem.js +450 -393
- package/dist/helpers/compass.js +92 -83
- package/dist/helpers/converter.js +52 -65
- package/dist/helpers/extractParams.js +60 -52
- package/dist/helpers/extractPeaksEdit.js +29 -25
- package/dist/helpers/focus.js +2 -6
- package/dist/helpers/format.js +416 -361
- package/dist/helpers/init.js +41 -37
- package/dist/helpers/integration.js +18 -21
- package/dist/helpers/mount.js +57 -61
- package/dist/helpers/multiplicity.js +19 -24
- package/dist/helpers/multiplicity_calc.js +39 -50
- package/dist/helpers/multiplicity_complat.js +21 -47
- package/dist/helpers/multiplicity_manual.js +49 -55
- package/dist/helpers/multiplicity_verify_basic.js +108 -111
- package/dist/helpers/shift.js +15 -23
- package/dist/helpers/zoom.js +7 -11
- package/dist/index.js +680 -630
- package/dist/layer_content.js +40 -43
- package/dist/layer_init.js +162 -184
- package/dist/layer_prism.js +38 -41
- package/dist/reducers/index.js +2 -3
- package/dist/reducers/reducer_curve.js +35 -26
- package/dist/reducers/reducer_edit_peak.js +122 -98
- package/dist/reducers/reducer_forecast.js +57 -44
- package/dist/reducers/reducer_integration.js +135 -103
- package/dist/reducers/reducer_jcamp.js +49 -44
- package/dist/reducers/reducer_layout.js +5 -6
- package/dist/reducers/reducer_manager.js +5 -6
- package/dist/reducers/reducer_meta.js +5 -6
- package/dist/reducers/reducer_multiplicity.js +100 -77
- package/dist/reducers/reducer_scan.js +17 -20
- package/dist/reducers/reducer_shift.js +115 -70
- package/dist/reducers/reducer_simulation.js +7 -8
- package/dist/reducers/reducer_status.js +5 -6
- package/dist/reducers/reducer_submit.js +12 -15
- package/dist/reducers/reducer_threshold.js +5 -6
- package/dist/reducers/reducer_ui.js +5 -6
- package/dist/reducers/reducer_voltammetry.js +156 -96
- package/dist/reducers/reducer_wavelength.js +5 -6
- package/dist/reducers/undo_redo_config.js +3 -5
- package/dist/sagas/index.js +2 -15
- package/dist/sagas/saga_edit_peak.js +54 -68
- package/dist/sagas/saga_manager.js +86 -130
- package/dist/sagas/saga_meta.js +25 -31
- package/dist/sagas/saga_multi_entities.js +40 -103
- package/dist/sagas/saga_multiplicity.js +336 -406
- package/dist/sagas/saga_ui.js +296 -475
- package/dist/setupTests.js +8 -0
- package/dist/third_party/jAnalyzer.js +66 -67
- package/dist/third_party/peakInterval.js +34 -34
- package/package.json +14 -14
- package/dist/components/cmd_bar/03_peak_bk.js +0 -139
- package/dist/components/cmd_bar/04_integration_bk.js +0 -180
- package/dist/components/cmd_bar/05_multiplicity_bk.js +0 -131
- package/dist/components/cmd_bar/r01_layout_bk.js +0 -186
- package/dist/components/cmd_bar/r06_predict_btn_bk.js +0 -220
- package/dist/components/d3_line/line_focus_bk.js +0 -825
- package/dist/components/d3_multi/index_bk.js +0 -210
- package/dist/components/d3_multi/multi_focus_bk.js +0 -533
- package/dist/components/panel/compare_bk.js +0 -256
- package/dist/components/panel/cyclic_voltamery_data_bk.js +0 -292
- package/dist/components/panel/index_bk.js +0 -178
- package/dist/components/panel/info_bk.js +0 -235
- package/dist/components/panel/multiplicity_bk.js +0 -280
- package/dist/helpers/carbonFeatures_bk.js +0 -45
- package/dist/helpers/cfg_bk.js +0 -80
- package/dist/helpers/chem_bk.js +0 -787
- package/dist/helpers/compass_bk.js +0 -149
- package/dist/helpers/converter_bk.js +0 -96
- package/dist/helpers/extractPeaksEdit_bk.js +0 -53
- package/dist/helpers/format_bk.js +0 -497
- package/dist/index_bk.js +0 -640
- package/dist/layer_content_bk.js +0 -105
- package/dist/layer_init_bk.js +0 -235
- package/dist/layer_prism_bk.js +0 -133
- package/dist/reducers/reducer_edit_peak_bk.js +0 -108
- package/dist/reducers/reducer_integration_bk.js +0 -134
- package/dist/reducers/reducer_jcamp_bk.js +0 -71
- package/dist/reducers/reducer_multiplicity_bk.js +0 -126
- package/dist/reducers/reducer_shift_bk.js +0 -88
- package/dist/reducers/reducer_voltammetry_bk.js +0 -287
- package/dist/sagas/saga_edit_peak_bk.js +0 -73
- package/dist/sagas/saga_multi_entities_bk.js +0 -106
- package/dist/sagas/saga_multiplicity_bk.js +0 -351
- package/dist/sagas/saga_ui_bk.js +0 -453
|
@@ -5,12 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
8
|
var _react = _interopRequireDefault(require("react"));
|
|
15
9
|
var _reactRedux = require("react-redux");
|
|
16
10
|
var _redux = require("redux");
|
|
@@ -20,114 +14,99 @@ var _styles = require("@material-ui/core/styles");
|
|
|
20
14
|
var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
|
|
21
15
|
var _cfg = _interopRequireDefault(require("../../helpers/cfg"));
|
|
22
16
|
var _common = require("./common");
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var _super = _createSuper(TriBtn);
|
|
42
|
-
function TriBtn(props) {
|
|
43
|
-
var _this;
|
|
44
|
-
(0, _classCallCheck2.default)(this, TriBtn);
|
|
45
|
-
_this = _super.call(this, props);
|
|
46
|
-
_this.state = {
|
|
17
|
+
/* eslint-disable prefer-object-spread */
|
|
18
|
+
|
|
19
|
+
const styles = () => Object.assign({
|
|
20
|
+
btnYes: {
|
|
21
|
+
color: 'green'
|
|
22
|
+
},
|
|
23
|
+
btnNo: {
|
|
24
|
+
color: 'red'
|
|
25
|
+
},
|
|
26
|
+
btnTxtConfirm: {
|
|
27
|
+
fontFamily: 'Helvetica',
|
|
28
|
+
fontSize: 12
|
|
29
|
+
}
|
|
30
|
+
}, _common.commonStyle);
|
|
31
|
+
class TriBtn extends _react.default.Component {
|
|
32
|
+
constructor(props) {
|
|
33
|
+
super(props);
|
|
34
|
+
this.state = {
|
|
47
35
|
toggled: false
|
|
48
36
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return _this;
|
|
37
|
+
this.onToggle = this.onToggle.bind(this);
|
|
38
|
+
this.renderStageOne = this.renderStageOne.bind(this);
|
|
39
|
+
this.renderStageTwo = this.renderStageTwo.bind(this);
|
|
53
40
|
}
|
|
54
|
-
(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
{
|
|
124
|
-
layoutSt: state.layout
|
|
125
|
-
}
|
|
126
|
-
);
|
|
127
|
-
};
|
|
128
|
-
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
129
|
-
return (0, _redux.bindActionCreators)({}, dispatch);
|
|
130
|
-
};
|
|
41
|
+
onToggle(e) {
|
|
42
|
+
e.stopPropagation();
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
const {
|
|
45
|
+
toggled
|
|
46
|
+
} = this.state;
|
|
47
|
+
this.setState({
|
|
48
|
+
toggled: !toggled
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
renderStageOne() {
|
|
52
|
+
const {
|
|
53
|
+
content,
|
|
54
|
+
layoutSt,
|
|
55
|
+
children
|
|
56
|
+
} = this.props;
|
|
57
|
+
const {
|
|
58
|
+
tp
|
|
59
|
+
} = content;
|
|
60
|
+
const title = /*#__PURE__*/_react.default.createElement("span", {
|
|
61
|
+
className: "txt-sv-tp"
|
|
62
|
+
}, tp);
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
64
|
+
title: title
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_common.MuButton, {
|
|
66
|
+
className: (0, _classnames.default)('btn-sv-bar-one'),
|
|
67
|
+
disabled: _cfg.default.btnCmdMpy(layoutSt) && _cfg.default.btnCmdIntg(layoutSt),
|
|
68
|
+
onClick: this.onToggle
|
|
69
|
+
}, children)));
|
|
70
|
+
}
|
|
71
|
+
renderStageTwo() {
|
|
72
|
+
const {
|
|
73
|
+
classes,
|
|
74
|
+
layoutSt,
|
|
75
|
+
cb
|
|
76
|
+
} = this.props;
|
|
77
|
+
const onExec = e => {
|
|
78
|
+
cb();
|
|
79
|
+
this.onToggle(e);
|
|
80
|
+
};
|
|
81
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
82
|
+
disabled: _cfg.default.btnCmdMpy(layoutSt) && _cfg.default.btnCmdIntg(layoutSt)
|
|
83
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
84
|
+
className: (0, _classnames.default)(classes.txtLabel, 'txt-sv-bar-desc')
|
|
85
|
+
}, "Delete ALL?"), /*#__PURE__*/_react.default.createElement(_common.MuButton, {
|
|
86
|
+
className: (0, _classnames.default)('btn-sv-bar-yes'),
|
|
87
|
+
onClick: onExec
|
|
88
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
89
|
+
className: (0, _classnames.default)(classes.txt, classes.btnYes, 'txt-sv-bar-yes')
|
|
90
|
+
}, "Y")), /*#__PURE__*/_react.default.createElement(_common.MuButton, {
|
|
91
|
+
className: (0, _classnames.default)('btn-sv-bar-no'),
|
|
92
|
+
onClick: this.onToggle
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
94
|
+
className: (0, _classnames.default)(classes.txt, classes.btnNo, 'txt-sv-bar-no')
|
|
95
|
+
}, "N")));
|
|
96
|
+
}
|
|
97
|
+
render() {
|
|
98
|
+
const {
|
|
99
|
+
toggled
|
|
100
|
+
} = this.state;
|
|
101
|
+
return !toggled ? this.renderStageOne() : this.renderStageTwo();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const mapStateToProps = (state, props) => (
|
|
105
|
+
// eslint-disable-line
|
|
106
|
+
{
|
|
107
|
+
layoutSt: state.layout
|
|
108
|
+
});
|
|
109
|
+
const mapDispatchToProps = dispatch => (0, _redux.bindActionCreators)({}, dispatch);
|
|
131
110
|
TriBtn.propTypes = {
|
|
132
111
|
classes: _propTypes.default.object.isRequired,
|
|
133
112
|
layoutSt: _propTypes.default.string.isRequired,
|
|
@@ -135,5 +114,4 @@ TriBtn.propTypes = {
|
|
|
135
114
|
cb: _propTypes.default.func.isRequired,
|
|
136
115
|
children: _propTypes.default.node.isRequired
|
|
137
116
|
};
|
|
138
|
-
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)((0, _styles.withStyles)(styles)(TriBtn));
|
|
139
|
-
exports.default = _default;
|
|
117
|
+
var _default = exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)((0, _styles.withStyles)(styles)(TriBtn));
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const SmaToSvg = sma => {
|
|
10
10
|
switch (sma) {
|
|
11
11
|
case 'C-,:O':
|
|
12
12
|
return '<svg version="1.1" baseProfile="full" viewBox="0 0 300 300"><polygon fill="rgb(255,255,255)" stroke="none" stroke-width="0" points="0.00,0.00 300.00,0.00 300.00,300.00 0.00,300.00 0.00,0.00"></polygon> <g> <text font-family="helvetica" font-size="55.00" fill="rgb(255,0,0)" x="192.35" y="183.00">O</text> </g><line x1="86.25" y1="150.00" x2="132.70" y2="150.00" stroke="rgb(0,0,0)" stroke-width="3"></line> <line x1="132.70" y1="150.00" x2="179.16" y2="150.00" stroke="rgb(255,0,0)" stroke-width="3"></line> </svg>';
|
|
@@ -112,5 +112,4 @@ var SmaToSvg = function SmaToSvg(sma) {
|
|
|
112
112
|
};
|
|
113
113
|
|
|
114
114
|
/* eslint-enable */
|
|
115
|
-
var _default = SmaToSvg;
|
|
116
|
-
exports.default = _default;
|
|
115
|
+
var _default = exports.default = SmaToSvg;
|
|
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.TabLabel = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const TabLabel = function (classes, label) {
|
|
11
|
+
let extClsName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'txt-tab-label';
|
|
12
12
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
13
13
|
className: (0, _classnames.default)(classes.tabLabel, extClsName)
|
|
14
14
|
}, label);
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.drawMain = exports.drawLabel = exports.drawDisplay = exports.drawDestroy = void 0;
|
|
6
|
+
exports.drawMain = exports.drawLabel = exports.drawDisplay = exports.drawDestroy = exports.drawArrowOnCurve = void 0;
|
|
8
7
|
var d3 = _interopRequireWildcard(require("d3"));
|
|
9
|
-
function _getRequireWildcardCache(
|
|
10
|
-
function _interopRequireWildcard(
|
|
11
|
-
|
|
12
|
-
d3.select(klass).append('svg').attr('class', 'd3Svg').attr('preserveAspectRatio', 'xMinYMin meet').attr('viewBox',
|
|
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; }
|
|
10
|
+
const drawMain = (klass, w, h) => {
|
|
11
|
+
d3.select(klass).append('svg').attr('class', 'd3Svg').attr('preserveAspectRatio', 'xMinYMin meet').attr('viewBox', `0 0 ${w} ${h}`);
|
|
13
12
|
};
|
|
14
13
|
exports.drawMain = drawMain;
|
|
15
|
-
|
|
14
|
+
const drawLabel = (klass, cLabel, xLabel, yLabel) => {
|
|
16
15
|
d3.select(klass).selectAll('.xLabel').text(xLabel);
|
|
17
16
|
d3.select(klass).selectAll('.yLabel').text(yLabel);
|
|
18
17
|
if (cLabel) {
|
|
@@ -20,7 +19,7 @@ var drawLabel = function drawLabel(klass, cLabel, xLabel, yLabel) {
|
|
|
20
19
|
}
|
|
21
20
|
};
|
|
22
21
|
exports.drawLabel = drawLabel;
|
|
23
|
-
|
|
22
|
+
const drawDisplay = (klass, isHidden) => {
|
|
24
23
|
if (isHidden) {
|
|
25
24
|
d3.select(klass).selectAll('svg').style('width', 0);
|
|
26
25
|
} else {
|
|
@@ -28,7 +27,27 @@ var drawDisplay = function drawDisplay(klass, isHidden) {
|
|
|
28
27
|
}
|
|
29
28
|
};
|
|
30
29
|
exports.drawDisplay = drawDisplay;
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const drawDestroy = klass => d3.select(`${klass} > *`).remove();
|
|
31
|
+
exports.drawDestroy = drawDestroy;
|
|
32
|
+
const drawArrowOnCurve = (klass, isHidden) => {
|
|
33
|
+
if (isHidden) {
|
|
34
|
+
d3.select(klass).selectAll('marker').remove();
|
|
35
|
+
} else {
|
|
36
|
+
d3.select(klass).selectAll('marker').remove();
|
|
37
|
+
const arrowLeft = d3.select(klass).selectAll('defs').append('marker').attr('id', 'arrow-left').attr('viewBox', '0 0 10 10').attr('refX', 5).attr('refY', 5).attr('markerWidth', 6).attr('markerHeight', 6).attr('orient', 'auto').attr('fill', '#00AA0099');
|
|
38
|
+
arrowLeft.append('path').attr('d', 'M 0 0 L 10 5 L 0 10 z');
|
|
39
|
+
|
|
40
|
+
// const arrowRight = d3.select(klass).selectAll('defs')
|
|
41
|
+
// .append('marker')
|
|
42
|
+
// .attr('id', 'arrow-right')
|
|
43
|
+
// .attr('viewBox', '0 0 10 10')
|
|
44
|
+
// .attr('refX', 5)
|
|
45
|
+
// .attr('refY', 5)
|
|
46
|
+
// .attr('markerWidth', 6)
|
|
47
|
+
// .attr('markerHeight', 6)
|
|
48
|
+
// .attr('orient', 'auto-start-reverse');
|
|
49
|
+
// arrowRight.append('path')
|
|
50
|
+
// .attr('d', 'M 0 0 L 10 5 L 0 10 z');
|
|
51
|
+
}
|
|
33
52
|
};
|
|
34
|
-
exports.
|
|
53
|
+
exports.drawArrowOnCurve = drawArrowOnCurve;
|