@haniffalab/cherita-react 0.2.0-dev.2024-02-14.4bca94c0 → 0.2.0-dev.2024-02-14.0bb7b79c
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/App.scss +128 -0
- package/dist/components/Offcanvas/index.js +111 -0
- package/dist/components/dotplot/Dotplot.js +172 -125
- package/dist/components/heatmap/Heatmap.js +38 -26
- package/dist/components/matrixplot/Matrixplot.js +60 -33
- package/dist/components/obs-list/ObsList.js +70 -40
- package/dist/components/obsm-list/ObsmList.js +17 -11
- package/dist/components/scatterplot/Legend.js +19 -13
- package/dist/components/scatterplot/Scatterplot.js +31 -22
- package/dist/components/scatterplot/Toolbox.js +39 -25
- package/dist/components/var-list/VarList.js +65 -49
- package/dist/components/violin/Violin.js +52 -29
- package/dist/context/DatasetContext.js +12 -8
- package/dist/index.js +32 -1
- package/dist/utils/LoadingSpinner.js +27 -21
- package/package.json +2 -2
|
@@ -13,39 +13,60 @@ var _constants = require("../../constants/constants");
|
|
|
13
13
|
var _reactBootstrap = require("react-bootstrap");
|
|
14
14
|
var _requests = require("../../utils/requests");
|
|
15
15
|
var _LoadingSpinner = require("../../utils/LoadingSpinner");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
18
|
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); }
|
|
18
19
|
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; }
|
|
19
20
|
function MatrixplotControls() {
|
|
20
21
|
const dataset = (0, _DatasetContext.useDataset)();
|
|
21
22
|
const dispatch = (0, _DatasetContext.useDatasetDispatch)();
|
|
22
|
-
const colorScaleList = _constants.PLOTLY_COLORSCALES.map(item => /*#__PURE__*/
|
|
23
|
-
key: item,
|
|
23
|
+
const colorScaleList = _constants.PLOTLY_COLORSCALES.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Dropdown.Item, {
|
|
24
24
|
active: dataset.controls.colorScale === item,
|
|
25
25
|
onClick: () => {
|
|
26
26
|
dispatch({
|
|
27
27
|
type: "set.controls.colorScale",
|
|
28
28
|
colorScale: item
|
|
29
29
|
});
|
|
30
|
-
}
|
|
30
|
+
},
|
|
31
|
+
children: item
|
|
31
32
|
}, item));
|
|
32
|
-
const standardScaleList = _constants.MATRIXPLOT_STANDARDSCALES.map(item => /*#__PURE__*/
|
|
33
|
-
key: item.value,
|
|
33
|
+
const standardScaleList = _constants.MATRIXPLOT_STANDARDSCALES.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Dropdown.Item, {
|
|
34
34
|
active: dataset.controls.standardScale === item.name,
|
|
35
35
|
onClick: () => {
|
|
36
36
|
dispatch({
|
|
37
37
|
type: "set.controls.standardScale",
|
|
38
38
|
standardScale: item.value
|
|
39
39
|
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
},
|
|
41
|
+
children: item.name
|
|
42
|
+
}, item.value));
|
|
43
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.ButtonToolbar, {
|
|
44
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.ButtonGroup, {
|
|
45
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Dropdown, {
|
|
46
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Dropdown.Toggle, {
|
|
47
|
+
id: "dropdownColorscale",
|
|
48
|
+
variant: "light",
|
|
49
|
+
children: dataset.controls.colorScale
|
|
50
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Dropdown.Menu, {
|
|
51
|
+
children: colorScaleList
|
|
52
|
+
})]
|
|
53
|
+
})
|
|
54
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.ButtonGroup, {
|
|
55
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.InputGroup, {
|
|
56
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.InputGroup.Text, {
|
|
57
|
+
children: "Standard scale"
|
|
58
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Dropdown, {
|
|
59
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Dropdown.Toggle, {
|
|
60
|
+
id: "dropdownStandardScale",
|
|
61
|
+
variant: "light",
|
|
62
|
+
children: dataset.controls.standardScale
|
|
63
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Dropdown.Menu, {
|
|
64
|
+
children: standardScaleList
|
|
65
|
+
})]
|
|
66
|
+
})]
|
|
67
|
+
})
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
49
70
|
}
|
|
50
71
|
function Matrixplot() {
|
|
51
72
|
const ENDPOINT = "matrixplot";
|
|
@@ -107,26 +128,32 @@ function Matrixplot() {
|
|
|
107
128
|
}, [dataset.controls.colorScale, updateColorscale]);
|
|
108
129
|
if (!serverError) {
|
|
109
130
|
if (hasSelections) {
|
|
110
|
-
return /*#__PURE__*/
|
|
111
|
-
className: "cherita-matrixplot position-relative"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
131
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
132
|
+
className: "cherita-matrixplot position-relative",
|
|
133
|
+
children: [isPending && /*#__PURE__*/(0, _jsxRuntime.jsx)(_LoadingSpinner.LoadingSpinner, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactPlotly.default, {
|
|
134
|
+
data: data,
|
|
135
|
+
layout: layout,
|
|
136
|
+
useResizeHandler: true,
|
|
137
|
+
style: {
|
|
138
|
+
maxWidth: "100%",
|
|
139
|
+
maxHeight: "100%"
|
|
140
|
+
}
|
|
141
|
+
})]
|
|
142
|
+
});
|
|
121
143
|
}
|
|
122
|
-
return /*#__PURE__*/
|
|
123
|
-
className: "cherita-matrixplot"
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
144
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
145
|
+
className: "cherita-matrixplot",
|
|
146
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Alert, {
|
|
147
|
+
variant: "light",
|
|
148
|
+
children: "Select features and a category"
|
|
149
|
+
})
|
|
150
|
+
});
|
|
127
151
|
} else {
|
|
128
|
-
return /*#__PURE__*/
|
|
129
|
-
|
|
130
|
-
|
|
152
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
153
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Alert, {
|
|
154
|
+
variant: "danger",
|
|
155
|
+
children: serverError.message
|
|
156
|
+
})
|
|
157
|
+
});
|
|
131
158
|
}
|
|
132
159
|
}
|
|
@@ -14,6 +14,7 @@ var _chromaJs = _interopRequireDefault(require("chroma-js"));
|
|
|
14
14
|
var _color = require("../../helpers/color");
|
|
15
15
|
var _LoadingSpinner = require("../../utils/LoadingSpinner");
|
|
16
16
|
var _reactBootstrap = require("react-bootstrap");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
18
|
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); }
|
|
18
19
|
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; }
|
|
19
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -130,31 +131,54 @@ function ObsColsList() {
|
|
|
130
131
|
});
|
|
131
132
|
}, [obs, dispatch]);
|
|
132
133
|
function categoricalList(item) {
|
|
133
|
-
return /*#__PURE__*/
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
134
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Accordion.Item, {
|
|
135
|
+
eventKey: item.name,
|
|
136
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Accordion.Header, {
|
|
137
|
+
children: item.name
|
|
138
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Accordion.Body, {
|
|
139
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.ListGroup, {
|
|
140
|
+
variant: "flush",
|
|
141
|
+
children: item.values.map((value, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.ListGroup.Item, {
|
|
142
|
+
children: [value, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
143
|
+
className: "cm-string cm-color",
|
|
144
|
+
style: {
|
|
145
|
+
backgroundColor: "rgb(".concat(obs[item.name]["state"][index]["color"], ")")
|
|
146
|
+
}
|
|
147
|
+
})]
|
|
148
|
+
}, index))
|
|
149
|
+
})
|
|
150
|
+
})]
|
|
151
|
+
}, item.name);
|
|
146
152
|
}
|
|
147
153
|
function continuousList(item) {
|
|
148
|
-
return /*#__PURE__*/
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
154
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Accordion.Item, {
|
|
155
|
+
eventKey: item.name,
|
|
156
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Accordion.Header, {
|
|
157
|
+
children: item.name
|
|
158
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Accordion.Body, {
|
|
159
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
160
|
+
children: ["Min: ", item.min]
|
|
161
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
162
|
+
children: ["Max: ", item.max]
|
|
163
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
164
|
+
children: ["Mean: ", item.mean]
|
|
165
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
166
|
+
children: ["Median: ", item.median]
|
|
167
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
168
|
+
children: ["NBins: ", item.nBins]
|
|
169
|
+
})]
|
|
170
|
+
})]
|
|
171
|
+
}, item.name);
|
|
152
172
|
}
|
|
153
173
|
function otherList(item) {
|
|
154
|
-
return /*#__PURE__*/
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
174
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Accordion.Item, {
|
|
175
|
+
eventKey: item.name,
|
|
176
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Accordion.Header, {
|
|
177
|
+
children: item.name
|
|
178
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Accordion.Body, {
|
|
179
|
+
children: item.type
|
|
180
|
+
})]
|
|
181
|
+
}, item.name);
|
|
158
182
|
}
|
|
159
183
|
const obsList = (0, _react.useMemo)(() => obsColsList.map(item => {
|
|
160
184
|
if (item.type === "categorical") {
|
|
@@ -166,25 +190,31 @@ function ObsColsList() {
|
|
|
166
190
|
}
|
|
167
191
|
}), [obsColsList]);
|
|
168
192
|
if (!serverError) {
|
|
169
|
-
return /*#__PURE__*/
|
|
170
|
-
className: "position-relative"
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
193
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
194
|
+
className: "position-relative",
|
|
195
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
196
|
+
className: "list-group overflow-auto",
|
|
197
|
+
children: [isPending && /*#__PURE__*/(0, _jsxRuntime.jsx)(_LoadingSpinner.LoadingSpinner, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Accordion, {
|
|
198
|
+
flush: true,
|
|
199
|
+
activeKey: active,
|
|
200
|
+
onSelect: key => {
|
|
201
|
+
if (key != null) {
|
|
202
|
+
dispatch({
|
|
203
|
+
type: "obsSelected",
|
|
204
|
+
obs: obsColsList.find(obs => obs.name === key)
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
children: obsList
|
|
209
|
+
})]
|
|
210
|
+
})
|
|
211
|
+
});
|
|
185
212
|
} else {
|
|
186
|
-
return /*#__PURE__*/
|
|
187
|
-
|
|
188
|
-
|
|
213
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
214
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Alert, {
|
|
215
|
+
variant: "danger",
|
|
216
|
+
children: serverError.message
|
|
217
|
+
})
|
|
218
|
+
});
|
|
189
219
|
}
|
|
190
220
|
}
|
|
@@ -10,6 +10,7 @@ var _requests = require("../../utils/requests");
|
|
|
10
10
|
var _DatasetContext = require("../../context/DatasetContext");
|
|
11
11
|
var _LoadingSpinner = require("../../utils/LoadingSpinner");
|
|
12
12
|
var _reactBootstrap = require("react-bootstrap");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
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); }
|
|
14
15
|
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; }
|
|
15
16
|
function ObsmKeysList() {
|
|
@@ -47,27 +48,32 @@ function ObsmKeysList() {
|
|
|
47
48
|
}
|
|
48
49
|
}, [dataset.selectedObsm]);
|
|
49
50
|
const obsmList = obsmKeysList.map(item => {
|
|
50
|
-
return /*#__PURE__*/
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
51
52
|
type: "button",
|
|
52
|
-
key: item,
|
|
53
53
|
className: "list-group-item list-grou-item-action ".concat(active === item && "active"),
|
|
54
54
|
onClick: () => {
|
|
55
55
|
dispatch({
|
|
56
56
|
type: "obsmSelected",
|
|
57
57
|
obsm: item
|
|
58
58
|
});
|
|
59
|
-
}
|
|
59
|
+
},
|
|
60
|
+
children: item
|
|
60
61
|
}, item);
|
|
61
62
|
});
|
|
62
63
|
if (!serverError) {
|
|
63
|
-
return /*#__PURE__*/
|
|
64
|
-
className: ""
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
65
|
+
className: "",
|
|
66
|
+
children: [isPending && /*#__PURE__*/(0, _jsxRuntime.jsx)(_LoadingSpinner.LoadingSpinner, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
67
|
+
className: "list-group overflow-auto mh-100",
|
|
68
|
+
children: obsmList
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
68
71
|
} else {
|
|
69
|
-
return /*#__PURE__*/
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
73
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Alert, {
|
|
74
|
+
variant: "danger",
|
|
75
|
+
children: serverError.message
|
|
76
|
+
})
|
|
77
|
+
});
|
|
72
78
|
}
|
|
73
79
|
}
|
|
@@ -21,6 +21,7 @@ var _DropdownButton = _interopRequireDefault(require("react-bootstrap/DropdownBu
|
|
|
21
21
|
var _ButtonGroup = _interopRequireDefault(require("react-bootstrap/ButtonGroup"));
|
|
22
22
|
var _reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
23
23
|
var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
|
|
24
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
26
|
function Legend(_ref) {
|
|
26
27
|
let {
|
|
@@ -37,24 +38,29 @@ function Legend(_ref) {
|
|
|
37
38
|
for (var i = 0; i <= 100; i++) {
|
|
38
39
|
var color = c(dmin + i / 100 * (dmax - dmin));
|
|
39
40
|
//console.log(color.hex());
|
|
40
|
-
legendList.push( /*#__PURE__*/
|
|
41
|
+
legendList.push( /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
41
42
|
className: "grad-step",
|
|
42
43
|
style: {
|
|
43
44
|
backgroundColor: color.hex()
|
|
44
45
|
}
|
|
45
46
|
}));
|
|
46
47
|
}
|
|
47
|
-
return /*#__PURE__*/
|
|
48
|
-
className: "cherita-legend"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
48
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
49
|
+
className: "cherita-legend",
|
|
50
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
51
|
+
className: "gradient",
|
|
52
|
+
children: [legendList, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
53
|
+
className: "domain-min",
|
|
54
|
+
children: dmin
|
|
55
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
56
|
+
className: "domain-med",
|
|
57
|
+
children: (dmin + dmax) * 0.5
|
|
58
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
59
|
+
className: "domain-max",
|
|
60
|
+
children: dmax
|
|
61
|
+
})]
|
|
62
|
+
})
|
|
63
|
+
});
|
|
58
64
|
}
|
|
59
|
-
return /*#__PURE__*/
|
|
65
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {});
|
|
60
66
|
}
|
|
@@ -21,6 +21,7 @@ var _DatasetContext = require("../../context/DatasetContext");
|
|
|
21
21
|
var _map = require("../../helpers/map");
|
|
22
22
|
var _zarr = require("../../helpers/zarr");
|
|
23
23
|
var _color = require("../../helpers/color");
|
|
24
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
26
|
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); }
|
|
26
27
|
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; }
|
|
@@ -28,20 +29,25 @@ window.deck.log.level = 1;
|
|
|
28
29
|
function ScatterplotControls() {
|
|
29
30
|
const dataset = (0, _DatasetContext.useDataset)();
|
|
30
31
|
const dispatch = (0, _DatasetContext.useDatasetDispatch)();
|
|
31
|
-
const colormapList = _constants.PLOTLY_COLORSCALES.map(item => /*#__PURE__*/
|
|
32
|
-
key: item,
|
|
32
|
+
const colormapList = _constants.PLOTLY_COLORSCALES.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.default.Item, {
|
|
33
33
|
active: dataset.controls.colorScale === item,
|
|
34
34
|
onClick: () => {
|
|
35
35
|
dispatch({
|
|
36
36
|
type: "set.controls.colorScale",
|
|
37
37
|
colorScale: item
|
|
38
38
|
});
|
|
39
|
-
}
|
|
39
|
+
},
|
|
40
|
+
children: item
|
|
40
41
|
}, item));
|
|
41
|
-
return /*#__PURE__*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Dropdown.default, {
|
|
43
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.default.Toggle, {
|
|
44
|
+
id: "dropdownColorscale",
|
|
45
|
+
variant: "light",
|
|
46
|
+
children: dataset.controls.colorScale
|
|
47
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.default.Menu, {
|
|
48
|
+
children: colormapList
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
45
51
|
}
|
|
46
52
|
function Scatterplot(_ref) {
|
|
47
53
|
let {
|
|
@@ -181,19 +187,22 @@ function Scatterplot(_ref) {
|
|
|
181
187
|
}
|
|
182
188
|
setSelectedFeatureIndexes(info.object ? [info.index] : []);
|
|
183
189
|
}
|
|
184
|
-
return /*#__PURE__*/
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
190
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
191
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
192
|
+
className: "cherita-scatterplot",
|
|
193
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.default, {
|
|
194
|
+
layers: layers,
|
|
195
|
+
initialViewState: viewport,
|
|
196
|
+
controller: true,
|
|
197
|
+
onClick: onLayerClick
|
|
198
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toolbox.Toolbox, {
|
|
199
|
+
mode: mode,
|
|
200
|
+
setMode: setMode,
|
|
201
|
+
features: mode,
|
|
202
|
+
setFeatures: setFeatures
|
|
203
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Legend.Legend, {
|
|
204
|
+
values: values
|
|
205
|
+
})]
|
|
206
|
+
})
|
|
207
|
+
});
|
|
199
208
|
}
|
|
@@ -13,6 +13,7 @@ var _DropdownButton = _interopRequireDefault(require("react-bootstrap/DropdownBu
|
|
|
13
13
|
var _ButtonGroup = _interopRequireDefault(require("react-bootstrap/ButtonGroup"));
|
|
14
14
|
var _reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
15
15
|
var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
18
|
function Toolbox(_ref) {
|
|
18
19
|
let {
|
|
@@ -50,29 +51,42 @@ function Toolbox(_ref) {
|
|
|
50
51
|
features: []
|
|
51
52
|
});
|
|
52
53
|
};
|
|
53
|
-
return /*#__PURE__*/
|
|
54
|
-
className: "cherita-toolbox"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
54
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
55
|
+
className: "cherita-toolbox",
|
|
56
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ButtonGroup.default, {
|
|
57
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_DropdownButton.default, {
|
|
58
|
+
as: _ButtonGroup.default,
|
|
59
|
+
title: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
60
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontawesome.FontAwesomeIcon, {
|
|
61
|
+
icon: _freeSolidSvgIcons.faArrowPointer
|
|
62
|
+
}), " Mode"]
|
|
63
|
+
}),
|
|
64
|
+
id: "bg-nested-dropdown",
|
|
65
|
+
onSelect: onSelect,
|
|
66
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.default.Item, {
|
|
67
|
+
eventKey: "DrawPolygonMode",
|
|
68
|
+
children: "DrawPolygonMode"
|
|
69
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.default.Item, {
|
|
70
|
+
eventKey: "DrawLineStringMode",
|
|
71
|
+
children: "DrawLineStringMode"
|
|
72
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.default.Item, {
|
|
73
|
+
eventKey: "DrawPolygonByDraggingMode",
|
|
74
|
+
children: "DrawPolygonByDraggingMode"
|
|
75
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.default.Item, {
|
|
76
|
+
eventKey: "DrawRectangleMode",
|
|
77
|
+
children: "DrawRectangleMode"
|
|
78
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.default.Item, {
|
|
79
|
+
eventKey: "ModifyMode",
|
|
80
|
+
children: "ModifyMode"
|
|
81
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.default.Item, {
|
|
82
|
+
eventKey: "ViewMode",
|
|
83
|
+
children: "ViewMode"
|
|
84
|
+
})]
|
|
85
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
86
|
+
variant: "primary",
|
|
87
|
+
onClick: deleteFeatures,
|
|
88
|
+
children: "Delete"
|
|
89
|
+
})]
|
|
90
|
+
})
|
|
91
|
+
});
|
|
78
92
|
}
|