@complat/react-spectra-editor 1.3.4 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/fixtures/nmr1h_2_jcamp.js +3199 -1944
- package/dist/__tests__/units/components/cmd_bar/01_viewer.test.js +21 -18
- package/dist/__tests__/units/components/cmd_bar/02_zoom.test.js +15 -13
- package/dist/__tests__/units/components/cmd_bar/03_peak.test.js +35 -26
- package/dist/__tests__/units/components/cmd_bar/07_pecker.test.js +17 -14
- package/dist/__tests__/units/components/cmd_bar/r08_change_axes.test.js +15 -13
- package/dist/__tests__/units/components/common/comps.test.js +9 -8
- package/dist/__tests__/units/components/common/draw.test.js +26 -34
- package/dist/__tests__/units/components/panel/graph_selection.test.js +25 -22
- package/dist/__tests__/units/components/panel/info.test.js +30 -25
- package/dist/__tests__/units/components/panel/peaks.test.js +29 -24
- package/dist/actions/manager.js +6 -2
- package/dist/actions/ui.js +13 -21
- package/dist/app.js +47 -47
- package/dist/components/cmd_bar/01_viewer.js +38 -31
- package/dist/components/cmd_bar/02_zoom.js +34 -27
- package/dist/components/cmd_bar/03_peak.js +85 -64
- package/dist/components/cmd_bar/04_integration.js +97 -76
- package/dist/components/cmd_bar/05_multiplicity.js +94 -67
- package/dist/components/cmd_bar/06_undo_redo.js +41 -32
- package/dist/components/cmd_bar/07_pecker.js +70 -47
- package/dist/components/cmd_bar/common.js +8 -8
- package/dist/components/cmd_bar/index.js +20 -21
- package/dist/components/cmd_bar/r01_layout.js +201 -137
- package/dist/components/cmd_bar/r02_scan.js +63 -51
- package/dist/components/cmd_bar/r03_threshold.js +95 -69
- package/dist/components/cmd_bar/r04_submit.js +155 -133
- package/dist/components/cmd_bar/r05_submit_btn.js +39 -36
- package/dist/components/cmd_bar/r06_predict_btn.js +66 -52
- package/dist/components/cmd_bar/r07_wavelength_btn.js +35 -31
- package/dist/components/cmd_bar/r08_change_axes.js +65 -56
- package/dist/components/cmd_bar/r09_detector.js +38 -33
- package/dist/components/cmd_bar/tri_btn.js +37 -25
- package/dist/components/common/comps.js +5 -6
- package/dist/components/d3_line/index.js +2 -1
- package/dist/components/d3_line/line_focus.js +32 -34
- package/dist/components/d3_multi/index.js +2 -1
- package/dist/components/d3_multi/multi_focus.js +60 -37
- package/dist/components/d3_rect/index.js +2 -1
- package/dist/components/d3_rect/rect_focus.js +18 -20
- package/dist/components/forecast/comps.js +169 -132
- package/dist/components/forecast/ir_comps.js +88 -69
- package/dist/components/forecast/ir_viewer.js +35 -28
- package/dist/components/forecast/nmr_comps.js +105 -76
- package/dist/components/forecast/nmr_viewer.js +36 -29
- package/dist/components/forecast/section_loading.js +22 -17
- package/dist/components/forecast_viewer.js +19 -17
- package/dist/components/multi_jcamps_viewer.js +46 -40
- package/dist/components/panel/compare.js +92 -76
- package/dist/components/panel/cyclic_voltamery_data.js +171 -122
- package/dist/components/panel/graph_selection.js +113 -90
- package/dist/components/panel/index.js +45 -41
- package/dist/components/panel/info.js +204 -157
- package/dist/components/panel/multiplicity.js +85 -63
- package/dist/components/panel/multiplicity_coupling.js +36 -29
- package/dist/components/panel/multiplicity_select.js +20 -19
- package/dist/components/panel/peaks.js +78 -56
- package/dist/constants/action_type.js +2 -1
- package/dist/helpers/cfg.js +1 -2
- package/dist/helpers/chem.js +5 -13
- package/dist/helpers/converter.js +1 -2
- package/dist/helpers/extractParams.js +1 -2
- package/dist/helpers/extractPeaksEdit.js +3 -6
- package/dist/helpers/format.js +27 -62
- package/dist/helpers/init.js +5 -9
- package/dist/helpers/integration.js +1 -2
- package/dist/helpers/mount.js +1 -2
- package/dist/index.js +306 -276
- package/dist/layer_content.js +14 -14
- package/dist/layer_init.js +17 -16
- package/dist/layer_prism.js +84 -73
- package/dist/reducers/reducer_axes.js +2 -5
- package/dist/reducers/reducer_curve.js +8 -6
- package/dist/reducers/reducer_detector.js +1 -3
- package/dist/reducers/reducer_edit_peak.js +1 -3
- package/dist/reducers/reducer_forecast.js +1 -3
- package/dist/reducers/reducer_integration.js +1 -3
- package/dist/reducers/reducer_jcamp.js +5 -8
- package/dist/reducers/reducer_layout.js +1 -3
- package/dist/reducers/reducer_manager.js +1 -3
- package/dist/reducers/reducer_meta.js +1 -3
- package/dist/reducers/reducer_multiplicity.js +3 -3
- package/dist/reducers/reducer_scan.js +1 -3
- package/dist/reducers/reducer_shift.js +1 -3
- package/dist/reducers/reducer_simulation.js +1 -3
- package/dist/reducers/reducer_status.js +1 -3
- package/dist/reducers/reducer_submit.js +1 -3
- package/dist/reducers/reducer_threshold.js +199 -29
- package/dist/reducers/reducer_ui.js +1 -3
- package/dist/reducers/reducer_voltammetry.js +3 -7
- package/dist/reducers/reducer_wavelength.js +1 -3
- package/dist/sagas/saga_multi_entities.js +35 -14
- package/dist/sagas/saga_multiplicity.js +1 -2
- package/dist/third_party/jAnalyzer.js +1 -1
- package/package.json +18 -1
|
@@ -16,6 +16,7 @@ var _Help = _interopRequireDefault(require("@mui/icons-material/Help"));
|
|
|
16
16
|
var _material = require("@mui/material");
|
|
17
17
|
var _CloudOff = _interopRequireDefault(require("@mui/icons-material/CloudOff"));
|
|
18
18
|
var _section_loading = _interopRequireDefault(require("./section_loading"));
|
|
19
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
20
|
/* eslint-disable react/function-component-definition, react/destructuring-assignment,
|
|
20
21
|
max-len */
|
|
21
22
|
|
|
@@ -33,157 +34,193 @@ const titleStyle = {
|
|
|
33
34
|
const txtStyle = {
|
|
34
35
|
lineHeight: '20px'
|
|
35
36
|
};
|
|
36
|
-
const TxtLabel =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}, label);
|
|
41
|
-
};
|
|
37
|
+
const TxtLabel = (classes, label, extClsName = 'txt-label') => /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
38
|
+
className: (0, _classnames.default)(classes.txtLabel, extClsName),
|
|
39
|
+
children: label
|
|
40
|
+
});
|
|
42
41
|
exports.TxtLabel = TxtLabel;
|
|
43
42
|
const StatusIcon = status => {
|
|
44
43
|
switch (status) {
|
|
45
44
|
case 'accept':
|
|
46
|
-
return /*#__PURE__*/
|
|
47
|
-
title: /*#__PURE__*/
|
|
48
|
-
className: "txt-sv-tp"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
46
|
+
title: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
47
|
+
className: "txt-sv-tp",
|
|
48
|
+
children: "Accept"
|
|
49
|
+
}),
|
|
50
|
+
placement: "left",
|
|
51
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckCircleOutline.default, {
|
|
52
|
+
style: {
|
|
53
|
+
color: '#4caf50'
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
});
|
|
56
57
|
case 'warning':
|
|
57
|
-
return /*#__PURE__*/
|
|
58
|
-
title: /*#__PURE__*/
|
|
59
|
-
className: "txt-sv-tp"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
59
|
+
title: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
60
|
+
className: "txt-sv-tp",
|
|
61
|
+
children: "Warning"
|
|
62
|
+
}),
|
|
63
|
+
placement: "left",
|
|
64
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ErrorOutline.default, {
|
|
65
|
+
style: {
|
|
66
|
+
color: '#ffc107'
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
});
|
|
67
70
|
case 'reject':
|
|
68
|
-
return /*#__PURE__*/
|
|
69
|
-
title: /*#__PURE__*/
|
|
70
|
-
className: "txt-sv-tp"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
72
|
+
title: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
73
|
+
className: "txt-sv-tp",
|
|
74
|
+
children: "Reject"
|
|
75
|
+
}),
|
|
76
|
+
placement: "left",
|
|
77
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_HighlightOff.default, {
|
|
78
|
+
style: {
|
|
79
|
+
color: '#e91e63'
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
});
|
|
78
83
|
case 'missing':
|
|
79
|
-
return /*#__PURE__*/
|
|
80
|
-
title: /*#__PURE__*/
|
|
81
|
-
className: "txt-sv-tp"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
85
|
+
title: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
86
|
+
className: "txt-sv-tp",
|
|
87
|
+
children: "Missing"
|
|
88
|
+
}),
|
|
89
|
+
placement: "left",
|
|
90
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_HelpOutline.default, {
|
|
91
|
+
style: {
|
|
92
|
+
color: '#5d4037'
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
});
|
|
89
96
|
case 'unknown':
|
|
90
|
-
return /*#__PURE__*/
|
|
91
|
-
title: /*#__PURE__*/
|
|
92
|
-
className: "txt-sv-tp"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
98
|
+
title: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
99
|
+
className: "txt-sv-tp",
|
|
100
|
+
children: "Not Support"
|
|
101
|
+
}),
|
|
102
|
+
placement: "left",
|
|
103
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Help.default, {
|
|
104
|
+
style: {
|
|
105
|
+
color: '#5d4037'
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
});
|
|
100
109
|
default:
|
|
101
110
|
return null;
|
|
102
111
|
}
|
|
103
112
|
};
|
|
104
113
|
exports.StatusIcon = StatusIcon;
|
|
105
|
-
const ConfidenceLabel =
|
|
106
|
-
|
|
107
|
-
|
|
114
|
+
const ConfidenceLabel = (classes, confidence, extClsName = 'txt-label') => {
|
|
115
|
+
if (!confidence) return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
116
|
+
children: " - - "
|
|
117
|
+
});
|
|
108
118
|
const confidenceDp = parseFloat(Math.round(confidence * 100) / 100).toFixed(2);
|
|
109
|
-
return /*#__PURE__*/
|
|
110
|
-
className: (0, _classnames.default)(classes.txtLabel, extClsName)
|
|
111
|
-
|
|
119
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
120
|
+
className: (0, _classnames.default)(classes.txtLabel, extClsName),
|
|
121
|
+
children: `${confidenceDp} %`
|
|
122
|
+
});
|
|
112
123
|
};
|
|
113
124
|
exports.ConfidenceLabel = ConfidenceLabel;
|
|
114
125
|
const sectionInput = (classes, molecule, inputFuncCb) => {
|
|
115
126
|
if (!inputFuncCb) return null;
|
|
116
|
-
return /*#__PURE__*/
|
|
117
|
-
className: (0, _classnames.default)(classes.inputRoot)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
127
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
128
|
+
className: (0, _classnames.default)(classes.inputRoot),
|
|
129
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
130
|
+
container: true,
|
|
131
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
132
|
+
item: true,
|
|
133
|
+
xs: 6,
|
|
134
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TextField, {
|
|
135
|
+
fullWidth: true,
|
|
136
|
+
label: TxtLabel(classes, 'Molfile', 'txt-mol-label'),
|
|
137
|
+
margin: "normal",
|
|
138
|
+
multiline: true,
|
|
139
|
+
onChange: inputFuncCb,
|
|
140
|
+
rows: "2",
|
|
141
|
+
variant: "outlined",
|
|
142
|
+
value: molecule
|
|
143
|
+
})
|
|
144
|
+
})
|
|
145
|
+
})
|
|
146
|
+
});
|
|
133
147
|
};
|
|
134
148
|
exports.sectionInput = sectionInput;
|
|
135
|
-
const SectionRunning = () => /*#__PURE__*/
|
|
136
|
-
style: titleStyle
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}), /*#__PURE__*/
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
style:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}, /*#__PURE__*/
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}),
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
149
|
+
const SectionRunning = () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
150
|
+
style: titleStyle,
|
|
151
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("h2", {
|
|
152
|
+
style: txtStyle,
|
|
153
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.CircularProgress, {
|
|
154
|
+
style: {
|
|
155
|
+
color: 'blue',
|
|
156
|
+
fontSize: 50
|
|
157
|
+
}
|
|
158
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
159
|
+
children: "The server is making predictions..."
|
|
160
|
+
})]
|
|
161
|
+
})
|
|
162
|
+
});
|
|
163
|
+
const SectionMissMatch = () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
164
|
+
style: titleStyle,
|
|
165
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("h2", {
|
|
166
|
+
style: txtStyle,
|
|
167
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ErrorOutline.default, {
|
|
168
|
+
style: {
|
|
169
|
+
color: 'red',
|
|
170
|
+
fontSize: 50
|
|
171
|
+
}
|
|
172
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
173
|
+
className: "txt-predict-fail",
|
|
174
|
+
children: "Peak & Element count mismatch!"
|
|
175
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
176
|
+
className: "txt-predict-fail",
|
|
177
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("sup", {
|
|
178
|
+
children: "1"
|
|
179
|
+
}), "H multiplicity count should not be more than the proton group count. Multiplicity must be assigned manulally before predictions."]
|
|
180
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
181
|
+
className: "txt-predict-fail",
|
|
182
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("sup", {
|
|
183
|
+
children: "13"
|
|
184
|
+
}), "C peak count should not be more than the carbon count, and solvent peaks should be excluded."]
|
|
185
|
+
})]
|
|
186
|
+
})
|
|
187
|
+
});
|
|
188
|
+
const SectionNoService = () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
189
|
+
style: titleStyle,
|
|
190
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("h2", {
|
|
191
|
+
style: txtStyle,
|
|
192
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CloudOff.default, {
|
|
193
|
+
style: {
|
|
194
|
+
color: 'red',
|
|
195
|
+
fontSize: 50
|
|
196
|
+
}
|
|
197
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
198
|
+
children: "Service is not available."
|
|
199
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
200
|
+
children: "Please try it again later."
|
|
201
|
+
})]
|
|
202
|
+
})
|
|
203
|
+
});
|
|
204
|
+
const SectionUnknown = () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
205
|
+
style: titleStyle,
|
|
206
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("h2", {
|
|
207
|
+
style: txtStyle,
|
|
208
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HelpOutline.default, {
|
|
209
|
+
style: {
|
|
210
|
+
color: 'purple',
|
|
211
|
+
fontSize: 50
|
|
212
|
+
}
|
|
213
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
214
|
+
children: "Unknown state."
|
|
215
|
+
})]
|
|
216
|
+
})
|
|
217
|
+
});
|
|
181
218
|
const notToRenderAnalysis = pds => {
|
|
182
|
-
if (pds.running) return /*#__PURE__*/
|
|
183
|
-
if (!pds.outline || !pds.outline.code) return /*#__PURE__*/
|
|
184
|
-
if (pds.outline.code >= 500) return /*#__PURE__*/
|
|
185
|
-
if (pds.outline.code === 400) return /*#__PURE__*/
|
|
186
|
-
if (pds.outline.code >= 300) return /*#__PURE__*/
|
|
219
|
+
if (pds.running) return /*#__PURE__*/(0, _jsxRuntime.jsx)(SectionRunning, {});
|
|
220
|
+
if (!pds.outline || !pds.outline.code) return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {});
|
|
221
|
+
if (pds.outline.code >= 500) return /*#__PURE__*/(0, _jsxRuntime.jsx)(SectionNoService, {});
|
|
222
|
+
if (pds.outline.code === 400) return /*#__PURE__*/(0, _jsxRuntime.jsx)(SectionMissMatch, {});
|
|
223
|
+
if (pds.outline.code >= 300) return /*#__PURE__*/(0, _jsxRuntime.jsx)(SectionUnknown, {});
|
|
187
224
|
return false;
|
|
188
225
|
};
|
|
189
226
|
exports.notToRenderAnalysis = notToRenderAnalysis;
|
|
@@ -192,8 +229,8 @@ const sectionSvg = (classes, predictions) => {
|
|
|
192
229
|
if (renderMsg) return null;
|
|
193
230
|
if (!predictions.output) return null;
|
|
194
231
|
const targetSvg = predictions.output.result[0].svgs[0];
|
|
195
|
-
if (!targetSvg) return /*#__PURE__*/
|
|
196
|
-
return /*#__PURE__*/
|
|
232
|
+
if (!targetSvg) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_section_loading.default, {});
|
|
233
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSvgFileZoomPan.default, {
|
|
197
234
|
svg: targetSvg,
|
|
198
235
|
duration: 300,
|
|
199
236
|
resize: true
|
|
@@ -15,46 +15,51 @@ var _CheckCircleOutline = _interopRequireDefault(require("@mui/icons-material/Ch
|
|
|
15
15
|
var _HighlightOff = _interopRequireDefault(require("@mui/icons-material/HighlightOff"));
|
|
16
16
|
var _comps = require("./comps");
|
|
17
17
|
var _forecast = require("../../actions/forecast");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
19
|
/* eslint-disable react/function-component-definition, function-paren-newline,
|
|
19
20
|
prefer-object-spread */
|
|
20
21
|
|
|
21
22
|
// import SmaToSvg from '../common/chem';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
setIrStatusAct
|
|
29
|
-
} = _ref;
|
|
23
|
+
const baseSelectIrStatus = ({
|
|
24
|
+
sma,
|
|
25
|
+
status,
|
|
26
|
+
identity,
|
|
27
|
+
setIrStatusAct
|
|
28
|
+
}) => {
|
|
30
29
|
const theStatus = ['accept', 'reject'].includes(status) ? status : '';
|
|
31
|
-
return /*#__PURE__*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControl, {
|
|
31
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Select, {
|
|
32
|
+
value: theStatus,
|
|
33
|
+
onChange: e => {
|
|
34
|
+
setIrStatusAct({
|
|
35
|
+
predictions: {
|
|
36
|
+
sma,
|
|
37
|
+
identity,
|
|
38
|
+
value: e.target.value
|
|
39
|
+
},
|
|
40
|
+
svgs: []
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
44
|
+
value: "accept",
|
|
45
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckCircleOutline.default, {
|
|
46
|
+
style: {
|
|
47
|
+
color: '#4caf50'
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
51
|
+
value: "reject",
|
|
52
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_HighlightOff.default, {
|
|
53
|
+
style: {
|
|
54
|
+
color: '#e91e63'
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
58
|
+
value: "",
|
|
59
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {})
|
|
60
|
+
})]
|
|
61
|
+
})
|
|
62
|
+
});
|
|
58
63
|
};
|
|
59
64
|
const bssMapStateToProps = (state, props) => (
|
|
60
65
|
// eslint-disable-line
|
|
@@ -72,15 +77,23 @@ baseSelectIrStatus.defaultProps = {
|
|
|
72
77
|
status: ''
|
|
73
78
|
};
|
|
74
79
|
const SelectIrStatus = (0, _reactRedux.connect)(bssMapStateToProps, bssMapDispatchToProps)(baseSelectIrStatus);
|
|
75
|
-
const IrTableHeader = classes => /*#__PURE__*/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}, (0,
|
|
80
|
+
const IrTableHeader = classes => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TableHead, {
|
|
81
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.TableRow, {
|
|
82
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TableCell, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TableCell, {
|
|
83
|
+
align: "left",
|
|
84
|
+
children: (0, _comps.TxtLabel)(classes, 'FG SMARTS', 'txt-prd-table-title')
|
|
85
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TableCell, {
|
|
86
|
+
align: "right",
|
|
87
|
+
children: (0, _comps.TxtLabel)(classes, 'Machine Confidence', 'txt-prd-table-title')
|
|
88
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TableCell, {
|
|
89
|
+
align: "right",
|
|
90
|
+
children: (0, _comps.TxtLabel)(classes, 'Machine', 'txt-prd-table-title')
|
|
91
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TableCell, {
|
|
92
|
+
align: "right",
|
|
93
|
+
children: (0, _comps.TxtLabel)(classes, 'Owner', 'txt-prd-table-title')
|
|
94
|
+
})]
|
|
95
|
+
})
|
|
96
|
+
});
|
|
84
97
|
exports.IrTableHeader = IrTableHeader;
|
|
85
98
|
const colorStyles = [{
|
|
86
99
|
backgroundColor: '#FFFF00'
|
|
@@ -99,35 +112,41 @@ const colorStyles = [{
|
|
|
99
112
|
}, {
|
|
100
113
|
backgroundColor: '#F5F5DC'
|
|
101
114
|
}];
|
|
102
|
-
const colorLabel =
|
|
103
|
-
let extClsName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'txt-label';
|
|
115
|
+
const colorLabel = (classes, idx, extClsName = 'txt-label') => {
|
|
104
116
|
const style = Object.assign({}, colorStyles[idx % 8], {
|
|
105
117
|
width: 20,
|
|
106
118
|
borderRadius: 20,
|
|
107
119
|
textAlign: 'center'
|
|
108
120
|
});
|
|
109
|
-
return /*#__PURE__*/
|
|
110
|
-
style: style
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
121
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
122
|
+
style: style,
|
|
123
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
124
|
+
className: (0, _classnames.default)(classes.txtLabel, extClsName),
|
|
125
|
+
children: idx + 1
|
|
126
|
+
})
|
|
127
|
+
});
|
|
114
128
|
};
|
|
115
|
-
const IrTableBodyRow = (classes, idx, fg) => /*#__PURE__*/
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}, (0,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
const IrTableBodyRow = (classes, idx, fg) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.TableRow, {
|
|
130
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TableCell, {
|
|
131
|
+
component: "th",
|
|
132
|
+
scope: "row",
|
|
133
|
+
children: colorLabel(classes, idx)
|
|
134
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TableCell, {
|
|
135
|
+
align: "left",
|
|
136
|
+
children: (0, _comps.TxtLabel)(classes, fg.sma, 'txt-prd-table-content')
|
|
137
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TableCell, {
|
|
138
|
+
align: "right",
|
|
139
|
+
children: (0, _comps.ConfidenceLabel)(classes, fg.confidence, 'txt-prd-table-content')
|
|
140
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TableCell, {
|
|
141
|
+
align: "right",
|
|
142
|
+
children: (0, _comps.StatusIcon)(fg.status)
|
|
143
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TableCell, {
|
|
144
|
+
align: "right",
|
|
145
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectIrStatus, {
|
|
146
|
+
sma: fg.sma,
|
|
147
|
+
status: fg.statusOwner,
|
|
148
|
+
identity: "Owner"
|
|
149
|
+
})
|
|
150
|
+
})]
|
|
151
|
+
}, `${idx}-${fg.name}`);
|
|
133
152
|
exports.IrTableBodyRow = IrTableBodyRow;
|
|
@@ -14,6 +14,7 @@ var _styles = require("@mui/styles");
|
|
|
14
14
|
var _material = require("@mui/material");
|
|
15
15
|
var _comps = require("./comps");
|
|
16
16
|
var _ir_comps = require("./ir_comps");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
18
|
const Styles = () => ({
|
|
18
19
|
root: {
|
|
19
20
|
overflowX: 'hidden',
|
|
@@ -62,36 +63,42 @@ const sectionTable = (classes, pds) => {
|
|
|
62
63
|
fgs
|
|
63
64
|
} = pds.output.result[0];
|
|
64
65
|
if (!fgs) return null;
|
|
65
|
-
return /*#__PURE__*/
|
|
66
|
-
className: classes.tableRoot
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Paper, {
|
|
67
|
+
className: classes.tableRoot,
|
|
68
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Table, {
|
|
69
|
+
className: classes.table,
|
|
70
|
+
size: "small",
|
|
71
|
+
children: [(0, _ir_comps.IrTableHeader)(classes), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TableBody, {
|
|
72
|
+
children: fgs.sort((a, b) => b.confidence - a.confidence).map((fg, idx) => (0, _ir_comps.IrTableBodyRow)(classes, idx, fg))
|
|
73
|
+
})]
|
|
74
|
+
})
|
|
75
|
+
});
|
|
71
76
|
};
|
|
72
|
-
const IrViewer =
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
className: (0, _classnames.default)(classes.root, 'card-forecast-viewer')
|
|
82
|
-
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
77
|
+
const IrViewer = ({
|
|
78
|
+
// eslint-disable-line
|
|
79
|
+
classes,
|
|
80
|
+
molecule,
|
|
81
|
+
inputCb,
|
|
82
|
+
forecastSt
|
|
83
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
84
|
+
className: (0, _classnames.default)(classes.root, 'card-forecast-viewer'),
|
|
85
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
83
86
|
className: (0, _classnames.default)(classes.container),
|
|
84
|
-
container: true
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
87
|
+
container: true,
|
|
88
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
89
|
+
item: true,
|
|
90
|
+
xs: 4,
|
|
91
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Paper, {
|
|
92
|
+
className: classes.svgRoot,
|
|
93
|
+
children: (0, _comps.sectionSvg)(classes, forecastSt.predictions)
|
|
94
|
+
})
|
|
95
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
96
|
+
item: true,
|
|
97
|
+
xs: 8,
|
|
98
|
+
children: sectionTable(classes, forecastSt.predictions)
|
|
99
|
+
})]
|
|
100
|
+
}), (0, _comps.sectionInput)(classes, molecule, inputCb)]
|
|
101
|
+
});
|
|
95
102
|
const mapStateToProps = (state, props) => (
|
|
96
103
|
// eslint-disable-line
|
|
97
104
|
{
|