@haniffalab/cherita-react 1.4.1-dev.2025-10-23.3179e534 → 1.4.1-dev.2025-10-23.55fbe6ff
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 +1 -1
- package/dist/cjs/components/controls/Controls.js +4 -4
- package/dist/cjs/components/dotplot/Dotplot.js +15 -28
- package/dist/cjs/components/dotplot/DotplotControls.js +5 -5
- package/dist/cjs/components/full-page/FullPage.js +1 -2
- package/dist/cjs/components/full-page/PlotAlert.js +1 -1
- package/dist/cjs/components/full-page/PlotTypeSelector.js +13 -13
- package/dist/cjs/components/heatmap/Heatmap.js +14 -24
- package/dist/cjs/components/icons/DotPlotIcon.js +1 -1
- package/dist/cjs/components/icons/HeatmapIcon.js +1 -1
- package/dist/cjs/components/icons/MatrixPlotIcon.1.js +1 -1
- package/dist/cjs/components/icons/MatrixPlotIcon.js +1 -1
- package/dist/cjs/components/icons/ScatterplotIcon.1.js +1 -1
- package/dist/cjs/components/icons/ScatterplotIcon.js +1 -1
- package/dist/cjs/components/icons/ViolinPlotIcon.js +1 -1
- package/dist/cjs/components/matrixplot/Matrixplot.js +15 -26
- package/dist/cjs/components/obs-list/ObsItem.js +19 -19
- package/dist/cjs/components/obs-list/ObsList.js +17 -17
- package/dist/cjs/components/obsm-list/ObsmList.js +7 -7
- package/dist/cjs/components/pseudospatial/Pseudospatial.js +16 -16
- package/dist/cjs/components/pseudospatial/PseudospatialToolbar.js +10 -10
- package/dist/cjs/components/scatterplot/Scatterplot.js +16 -16
- package/dist/cjs/components/scatterplot/ScatterplotControls.js +1 -1
- package/dist/cjs/components/scatterplot/SpatialControls.js +9 -9
- package/dist/cjs/components/scatterplot/Toolbox.js +4 -4
- package/dist/cjs/components/search-bar/SearchBar.js +14 -14
- package/dist/cjs/components/search-bar/SearchInfo.js +3 -3
- package/dist/cjs/components/search-bar/SearchResults.js +2 -2
- package/dist/cjs/components/toolbar/Toolbar.js +3 -3
- package/dist/cjs/components/var-list/VarItem.js +15 -15
- package/dist/cjs/components/var-list/VarList.js +5 -5
- package/dist/cjs/components/var-list/VarListToolbar.js +4 -4
- package/dist/cjs/components/var-list/VarSet.js +13 -13
- package/dist/cjs/components/violin/Violin.js +17 -41
- package/dist/cjs/constants/colorscales.js +19 -19
- package/dist/cjs/constants/constants.js +47 -47
- package/dist/cjs/context/DatasetContext.js +3 -3
- package/dist/cjs/context/FilterContext.js +2 -2
- package/dist/cjs/context/SettingsContext.js +57 -57
- package/dist/cjs/helpers/color-helper.js +2 -2
- package/dist/cjs/helpers/zarr-helper.js +3 -3
- package/dist/cjs/utils/Filter.js +1 -1
- package/dist/cjs/utils/Histogram.js +2 -2
- package/dist/cjs/utils/ImageViewer.js +2 -2
- package/dist/cjs/utils/Legend.js +1 -1
- package/dist/cjs/utils/LoadingIndicators.js +1 -1
- package/dist/cjs/utils/Resolver.js +7 -7
- package/dist/cjs/utils/Skeleton.js +1 -1
- package/dist/cjs/utils/StyledTooltip.js +5 -5
- package/dist/cjs/utils/VirtualizedList.js +7 -7
- package/dist/cjs/utils/errors.js +15 -15
- package/dist/cjs/utils/requests.js +14 -10
- package/dist/cjs/utils/search.js +4 -4
- package/dist/cjs/utils/string.js +6 -6
- package/dist/cjs/utils/zarrData.js +5 -5
- package/dist/css/cherita.css +21 -20
- package/dist/css/cherita.css.map +1 -1
- package/dist/esm/components/controls/Controls.js +9 -9
- package/dist/esm/components/dotplot/Dotplot.js +28 -41
- package/dist/esm/components/dotplot/DotplotControls.js +9 -9
- package/dist/esm/components/full-page/FullPage.js +22 -23
- package/dist/esm/components/full-page/PlotAlert.js +5 -5
- package/dist/esm/components/full-page/PlotTypeSelector.js +21 -21
- package/dist/esm/components/heatmap/Heatmap.js +27 -37
- package/dist/esm/components/heatmap/HeatmapControls.js +2 -2
- package/dist/esm/components/icons/DotPlotIcon.js +1 -1
- package/dist/esm/components/icons/HeatmapIcon.js +1 -1
- package/dist/esm/components/icons/MatrixPlotIcon.1.js +1 -1
- package/dist/esm/components/icons/MatrixPlotIcon.js +1 -1
- package/dist/esm/components/icons/ScatterplotIcon.1.js +1 -1
- package/dist/esm/components/icons/ScatterplotIcon.js +1 -1
- package/dist/esm/components/icons/ViolinPlotIcon.js +1 -1
- package/dist/esm/components/matrixplot/Matrixplot.js +28 -39
- package/dist/esm/components/matrixplot/MatrixplotControls.js +2 -2
- package/dist/esm/components/obs-list/ObsItem.js +37 -37
- package/dist/esm/components/obs-list/ObsList.js +34 -34
- package/dist/esm/components/obs-list/ObsToolbar.js +1 -1
- package/dist/esm/components/obsm-list/ObsmList.js +15 -15
- package/dist/esm/components/offcanvas/index.js +6 -6
- package/dist/esm/components/pseudospatial/Pseudospatial.js +31 -31
- package/dist/esm/components/pseudospatial/PseudospatialToolbar.js +17 -17
- package/dist/esm/components/scatterplot/Scatterplot.js +38 -38
- package/dist/esm/components/scatterplot/ScatterplotControls.js +9 -9
- package/dist/esm/components/scatterplot/SpatialControls.js +23 -23
- package/dist/esm/components/scatterplot/Toolbox.js +7 -7
- package/dist/esm/components/search-bar/SearchBar.js +27 -27
- package/dist/esm/components/search-bar/SearchInfo.js +14 -14
- package/dist/esm/components/search-bar/SearchResults.js +10 -10
- package/dist/esm/components/toolbar/Toolbar.js +6 -6
- package/dist/esm/components/var-list/VarItem.js +27 -27
- package/dist/esm/components/var-list/VarList.js +21 -21
- package/dist/esm/components/var-list/VarListToolbar.js +10 -10
- package/dist/esm/components/var-list/VarSet.js +22 -22
- package/dist/esm/components/violin/Violin.js +33 -57
- package/dist/esm/components/violin/ViolinControls.js +2 -2
- package/dist/esm/constants/colorscales.js +19 -19
- package/dist/esm/constants/constants.js +47 -47
- package/dist/esm/context/DatasetContext.js +11 -11
- package/dist/esm/context/FilterContext.js +3 -3
- package/dist/esm/context/SettingsContext.js +61 -61
- package/dist/esm/context/ZarrDataContext.js +3 -3
- package/dist/esm/helpers/color-helper.js +5 -5
- package/dist/esm/helpers/map-helper.js +2 -2
- package/dist/esm/helpers/zarr-helper.js +6 -6
- package/dist/esm/index.js +22 -22
- package/dist/esm/utils/Filter.js +8 -8
- package/dist/esm/utils/Histogram.js +6 -6
- package/dist/esm/utils/ImageViewer.js +4 -4
- package/dist/esm/utils/Legend.js +9 -9
- package/dist/esm/utils/LoadingIndicators.js +2 -2
- package/dist/esm/utils/Resolver.js +13 -13
- package/dist/esm/utils/Skeleton.js +2 -2
- package/dist/esm/utils/StyledTooltip.js +6 -6
- package/dist/esm/utils/VirtualizedList.js +9 -9
- package/dist/esm/utils/errors.js +15 -15
- package/dist/esm/utils/requests.js +17 -13
- package/dist/esm/utils/search.js +7 -7
- package/dist/esm/utils/string.js +7 -7
- package/dist/esm/utils/zarrData.js +13 -13
- package/package.json +11 -7
- package/scss/cherita-bootstrap.scss +2 -2
- package/scss/cherita.scss +24 -17
- package/scss/components/accordions.scss +4 -1
- package/scss/components/layouts.scss +13 -12
- package/scss/components/lists.scss +8 -4
- package/scss/components/plotly.scss +1 -0
|
@@ -3,24 +3,24 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
3
3
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
5
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
-
import { useCallback, useEffect, useMemo, useState } from
|
|
7
|
-
import { Tooltip } from
|
|
8
|
-
import { Gauge, SparkLineChart } from
|
|
9
|
-
import _ from
|
|
10
|
-
import { Badge, Form, ListGroup } from
|
|
11
|
-
import { ObsToolbar } from
|
|
12
|
-
import { COLOR_ENCODINGS, OBS_TYPES } from
|
|
13
|
-
import { useDataset } from
|
|
14
|
-
import { useFilteredData } from
|
|
15
|
-
import { useSettings } from
|
|
16
|
-
import { useColor } from
|
|
17
|
-
import { Histogram } from
|
|
18
|
-
import { LoadingLinear } from
|
|
19
|
-
import { useFetch } from
|
|
20
|
-
import { useSelectedVar } from
|
|
21
|
-
import { formatNumerical, FORMATS } from
|
|
22
|
-
import { VirtualizedList } from
|
|
23
|
-
import { useObsData } from
|
|
6
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
7
|
+
import { Tooltip } from '@mui/material';
|
|
8
|
+
import { Gauge, SparkLineChart } from '@mui/x-charts';
|
|
9
|
+
import _ from 'lodash';
|
|
10
|
+
import { Badge, Form, ListGroup } from 'react-bootstrap';
|
|
11
|
+
import { ObsToolbar } from './ObsToolbar';
|
|
12
|
+
import { COLOR_ENCODINGS, OBS_TYPES } from '../../constants/constants';
|
|
13
|
+
import { useDataset } from '../../context/DatasetContext';
|
|
14
|
+
import { useFilteredData } from '../../context/FilterContext';
|
|
15
|
+
import { useSettings } from '../../context/SettingsContext';
|
|
16
|
+
import { useColor } from '../../helpers/color-helper';
|
|
17
|
+
import { Histogram } from '../../utils/Histogram';
|
|
18
|
+
import { LoadingLinear } from '../../utils/LoadingIndicators';
|
|
19
|
+
import { useFetch } from '../../utils/requests';
|
|
20
|
+
import { useSelectedVar } from '../../utils/Resolver';
|
|
21
|
+
import { formatNumerical, FORMATS } from '../../utils/string';
|
|
22
|
+
import { VirtualizedList } from '../../utils/VirtualizedList';
|
|
23
|
+
import { useObsData } from '../../utils/zarrData';
|
|
24
24
|
|
|
25
25
|
// const N_BINS = 5;
|
|
26
26
|
|
|
@@ -43,13 +43,13 @@ import { useObsData } from "../../utils/zarrData";
|
|
|
43
43
|
// }
|
|
44
44
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
45
45
|
function getContinuousLabel(code, binEdges) {
|
|
46
|
-
return "[ ".concat(formatNumerical(binEdges[code][0]), ", ").concat(formatNumerical(binEdges[code][1], FORMATS.EXPONENTIAL)).concat(code === binEdges.length - 1 ?
|
|
46
|
+
return "[ ".concat(formatNumerical(binEdges[code][0]), ", ").concat(formatNumerical(binEdges[code][1], FORMATS.EXPONENTIAL)).concat(code === binEdges.length - 1 ? ' ]' : ' )');
|
|
47
47
|
}
|
|
48
48
|
const useObsHistogram = (obs, _ref) => {
|
|
49
49
|
let {
|
|
50
50
|
enabled = true
|
|
51
51
|
} = _ref;
|
|
52
|
-
const ENDPOINT =
|
|
52
|
+
const ENDPOINT = 'obs/histograms';
|
|
53
53
|
const dataset = useDataset();
|
|
54
54
|
const settings = useSettings();
|
|
55
55
|
const {
|
|
@@ -59,7 +59,7 @@ const useObsHistogram = (obs, _ref) => {
|
|
|
59
59
|
const selectedVar = useSelectedVar();
|
|
60
60
|
const [params, setParams] = useState({
|
|
61
61
|
url: dataset.url,
|
|
62
|
-
obsCol: _.omit(obs,
|
|
62
|
+
obsCol: _.omit(obs, 'omit'),
|
|
63
63
|
// avoid re-rendering when toggling unselected obs
|
|
64
64
|
varKey: selectedVar !== null && selectedVar !== void 0 && selectedVar.isSet ? {
|
|
65
65
|
name: selectedVar === null || selectedVar === void 0 ? void 0 : selectedVar.name,
|
|
@@ -70,7 +70,7 @@ const useObsHistogram = (obs, _ref) => {
|
|
|
70
70
|
useEffect(() => {
|
|
71
71
|
setParams(p => {
|
|
72
72
|
return _objectSpread(_objectSpread({}, p), {}, {
|
|
73
|
-
obsCol: _.omit(obs,
|
|
73
|
+
obsCol: _.omit(obs, 'omit'),
|
|
74
74
|
varKey: selectedVar !== null && selectedVar !== void 0 && selectedVar.isSet ? {
|
|
75
75
|
name: selectedVar === null || selectedVar === void 0 ? void 0 : selectedVar.name,
|
|
76
76
|
indices: selectedVar === null || selectedVar === void 0 ? void 0 : selectedVar.vars.map(v => v.index)
|
|
@@ -188,7 +188,7 @@ function CategoricalItem(_ref2) {
|
|
|
188
188
|
className: "pl-1 m-0",
|
|
189
189
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
190
190
|
title: isSliced ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
191
|
-
children: ["Filtered:",
|
|
191
|
+
children: ["Filtered:", ' ', formatNumerical(filteredStats.pct, FORMATS.EXPONENTIAL), "%", /*#__PURE__*/_jsx("br", {}), "Total: ", formatNumerical(stats.pct, FORMATS.EXPONENTIAL), "%"]
|
|
192
192
|
}) : "".concat(formatNumerical(stats.pct, FORMATS.EXPONENTIAL), "%"),
|
|
193
193
|
placement: "left",
|
|
194
194
|
arrow: true,
|
|
@@ -196,8 +196,8 @@ function CategoricalItem(_ref2) {
|
|
|
196
196
|
className: "d-flex align-items-center",
|
|
197
197
|
children: [/*#__PURE__*/_jsxs(Badge, {
|
|
198
198
|
className: "value-count-badge",
|
|
199
|
-
children: [
|
|
200
|
-
children: [formatNumerical(parseInt(filteredStats.value_counts)),
|
|
199
|
+
children: [' ', isSliced && parseInt(filteredStats.value_counts) !== parseInt(stats.value_counts) && /*#__PURE__*/_jsxs(_Fragment, {
|
|
200
|
+
children: [formatNumerical(parseInt(filteredStats.value_counts)), ' ', "out of", ' ']
|
|
201
201
|
}), formatNumerical(parseInt(stats.value_counts), FORMATS.EXPONENTIAL)]
|
|
202
202
|
}), /*#__PURE__*/_jsx("div", {
|
|
203
203
|
className: "value-pct-gauge-container",
|
|
@@ -206,8 +206,8 @@ function CategoricalItem(_ref2) {
|
|
|
206
206
|
className: "pct-gauge filtered-pct-gauge",
|
|
207
207
|
value: filteredStats.pct,
|
|
208
208
|
text: null,
|
|
209
|
-
innerRadius:
|
|
210
|
-
outerRadius:
|
|
209
|
+
innerRadius: '50%',
|
|
210
|
+
outerRadius: '75%',
|
|
211
211
|
margin: {
|
|
212
212
|
top: 0,
|
|
213
213
|
right: 0,
|
|
@@ -218,7 +218,7 @@ function CategoricalItem(_ref2) {
|
|
|
218
218
|
className: "pct-gauge",
|
|
219
219
|
value: stats.pct,
|
|
220
220
|
text: null,
|
|
221
|
-
innerRadius:
|
|
221
|
+
innerRadius: '75%',
|
|
222
222
|
margin: {
|
|
223
223
|
top: 0,
|
|
224
224
|
right: 0,
|
|
@@ -229,7 +229,7 @@ function CategoricalItem(_ref2) {
|
|
|
229
229
|
}) : /*#__PURE__*/_jsx(Gauge, {
|
|
230
230
|
value: stats.pct,
|
|
231
231
|
text: null,
|
|
232
|
-
innerRadius:
|
|
232
|
+
innerRadius: '50%',
|
|
233
233
|
margin: {
|
|
234
234
|
top: 0,
|
|
235
235
|
right: 0,
|
|
@@ -260,7 +260,7 @@ function CategoricalItem(_ref2) {
|
|
|
260
260
|
grayParams: {
|
|
261
261
|
alpha: 1
|
|
262
262
|
},
|
|
263
|
-
colorEncoding:
|
|
263
|
+
colorEncoding: 'obs'
|
|
264
264
|
}, useUnsColors ? {
|
|
265
265
|
colorscale: colors
|
|
266
266
|
} : {})), ")")
|
|
@@ -350,7 +350,7 @@ function ObsContinuousStats(_ref4) {
|
|
|
350
350
|
let {
|
|
351
351
|
obs
|
|
352
352
|
} = _ref4;
|
|
353
|
-
const ENDPOINT =
|
|
353
|
+
const ENDPOINT = 'obs/distribution';
|
|
354
354
|
const dataset = useDataset();
|
|
355
355
|
const params = {
|
|
356
356
|
url: dataset.url,
|
|
@@ -394,7 +394,7 @@ function ObsContinuousStats(_ref4) {
|
|
|
394
394
|
valueFormatter: v => "".concat(formatNumerical(v, FORMATS.EXPONENTIAL)),
|
|
395
395
|
slotProps: {
|
|
396
396
|
popper: {
|
|
397
|
-
className:
|
|
397
|
+
className: 'feature-histogram-tooltip'
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
})
|
|
@@ -405,28 +405,28 @@ function ObsContinuousStats(_ref4) {
|
|
|
405
405
|
className: "d-flex justify-content-between",
|
|
406
406
|
children: [/*#__PURE__*/_jsx("span", {
|
|
407
407
|
children: "Min"
|
|
408
|
-
}),
|
|
408
|
+
}), ' ', /*#__PURE__*/_jsx("span", {
|
|
409
409
|
children: formatNumerical(obs.min, FORMATS.EXPONENTIAL)
|
|
410
410
|
})]
|
|
411
411
|
}), /*#__PURE__*/_jsxs("div", {
|
|
412
412
|
className: "d-flex justify-content-between",
|
|
413
413
|
children: [/*#__PURE__*/_jsx("span", {
|
|
414
414
|
children: "Max"
|
|
415
|
-
}),
|
|
415
|
+
}), ' ', /*#__PURE__*/_jsx("span", {
|
|
416
416
|
children: formatNumerical(obs.max, FORMATS.EXPONENTIAL)
|
|
417
417
|
})]
|
|
418
418
|
}), /*#__PURE__*/_jsxs("div", {
|
|
419
419
|
className: "d-flex justify-content-between",
|
|
420
420
|
children: [/*#__PURE__*/_jsx("span", {
|
|
421
421
|
children: "Mean"
|
|
422
|
-
}),
|
|
422
|
+
}), ' ', /*#__PURE__*/_jsx("span", {
|
|
423
423
|
children: formatNumerical(obs.mean, FORMATS.EXPONENTIAL)
|
|
424
424
|
})]
|
|
425
425
|
}), /*#__PURE__*/_jsxs("div", {
|
|
426
426
|
className: "d-flex justify-content-between",
|
|
427
427
|
children: [/*#__PURE__*/_jsx("span", {
|
|
428
428
|
children: "Median"
|
|
429
|
-
}),
|
|
429
|
+
}), ' ', /*#__PURE__*/_jsx("span", {
|
|
430
430
|
children: formatNumerical(obs.median, FORMATS.EXPONENTIAL)
|
|
431
431
|
})]
|
|
432
432
|
})]
|
|
@@ -456,7 +456,7 @@ export function ContinuousObs(_ref5) {
|
|
|
456
456
|
const filteredObsData = useFilteredObsData(obs);
|
|
457
457
|
const enabledHistograms = useMemo(() => showHistograms && settings.colorEncoding === COLOR_ENCODINGS.VAR, [settings.colorEncoding, showHistograms]);
|
|
458
458
|
const getLabel = useCallback(index => {
|
|
459
|
-
return isNaN(obs.values[index]) ?
|
|
459
|
+
return isNaN(obs.values[index]) ? 'NaN' : getContinuousLabel(obs.codes[obs.values[index]], obs.bins.binEdges);
|
|
460
460
|
}, [obs.bins.binEdges, obs.codes, obs.values]);
|
|
461
461
|
const getDataAtIndex = useCallback(index => {
|
|
462
462
|
var _obsHistograms$fetche2;
|
|
@@ -3,23 +3,23 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
3
3
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
5
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
-
import { useContext, useEffect, useMemo, useState } from
|
|
7
|
-
import { faChevronDown, faChevronRight } from
|
|
8
|
-
import { FontAwesomeIcon } from
|
|
9
|
-
import CommentIcon from
|
|
10
|
-
import JoinInnerIcon from
|
|
11
|
-
import WaterDropIcon from
|
|
12
|
-
import _ from
|
|
13
|
-
import { Alert } from
|
|
14
|
-
import Accordion from
|
|
15
|
-
import { useAccordionButton } from
|
|
16
|
-
import AccordionContext from
|
|
17
|
-
import { CategoricalObs, ContinuousObs } from
|
|
18
|
-
import { COLOR_ENCODINGS, DEFAULT_OBS_GROUP, OBS_TYPES } from
|
|
19
|
-
import { useDataset } from
|
|
20
|
-
import { useSettings, useSettingsDispatch } from
|
|
21
|
-
import { LoadingSpinner } from
|
|
22
|
-
import { useFetch } from
|
|
6
|
+
import { useContext, useEffect, useMemo, useState } from 'react';
|
|
7
|
+
import { faChevronDown, faChevronRight } from '@fortawesome/free-solid-svg-icons';
|
|
8
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
9
|
+
import CommentIcon from '@mui/icons-material/Comment';
|
|
10
|
+
import JoinInnerIcon from '@mui/icons-material/JoinInner';
|
|
11
|
+
import WaterDropIcon from '@mui/icons-material/WaterDrop';
|
|
12
|
+
import _ from 'lodash';
|
|
13
|
+
import { Alert } from 'react-bootstrap';
|
|
14
|
+
import Accordion from 'react-bootstrap/Accordion';
|
|
15
|
+
import { useAccordionButton } from 'react-bootstrap/AccordionButton';
|
|
16
|
+
import AccordionContext from 'react-bootstrap/AccordionContext';
|
|
17
|
+
import { CategoricalObs, ContinuousObs } from './ObsItem';
|
|
18
|
+
import { COLOR_ENCODINGS, DEFAULT_OBS_GROUP, OBS_TYPES } from '../../constants/constants';
|
|
19
|
+
import { useDataset } from '../../context/DatasetContext';
|
|
20
|
+
import { useSettings, useSettingsDispatch } from '../../context/SettingsContext';
|
|
21
|
+
import { LoadingSpinner } from '../../utils/LoadingIndicators';
|
|
22
|
+
import { useFetch } from '../../utils/requests';
|
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
24
24
|
const ObsAccordionToggle = _ref => {
|
|
25
25
|
let {
|
|
@@ -35,7 +35,7 @@ const ObsAccordionToggle = _ref => {
|
|
|
35
35
|
handleAccordionToggle(eventKey, isCurrentEventKey);
|
|
36
36
|
});
|
|
37
37
|
return /*#__PURE__*/_jsxs("div", {
|
|
38
|
-
className: "obs-accordion-header ".concat(isCurrentEventKey ?
|
|
38
|
+
className: "obs-accordion-header ".concat(isCurrentEventKey ? 'active' : ''),
|
|
39
39
|
onClick: decoratedOnClick,
|
|
40
40
|
children: [/*#__PURE__*/_jsx("span", {
|
|
41
41
|
className: "obs-accordion-header-chevron",
|
|
@@ -56,7 +56,7 @@ export function ObsColsList(_ref2) {
|
|
|
56
56
|
showSelectedAsActive = false,
|
|
57
57
|
showHistograms = true
|
|
58
58
|
} = _ref2;
|
|
59
|
-
const ENDPOINT =
|
|
59
|
+
const ENDPOINT = 'obs/cols';
|
|
60
60
|
const dataset = useDataset();
|
|
61
61
|
const settings = useSettings();
|
|
62
62
|
const dispatch = useSettingsDispatch();
|
|
@@ -67,7 +67,7 @@ export function ObsColsList(_ref2) {
|
|
|
67
67
|
var _dataset$obsGroups;
|
|
68
68
|
return _objectSpread({
|
|
69
69
|
default: _.union(DEFAULT_OBS_GROUP, (_dataset$obsGroups = dataset.obsGroups) === null || _dataset$obsGroups === void 0 ? void 0 : _dataset$obsGroups.default)
|
|
70
|
-
}, _.omit(dataset.obsGroups,
|
|
70
|
+
}, _.omit(dataset.obsGroups, 'default'));
|
|
71
71
|
}, [dataset.obsGroups]);
|
|
72
72
|
const [params, setParams] = useState(_objectSpread({
|
|
73
73
|
url: dataset.url
|
|
@@ -121,7 +121,7 @@ export function ObsColsList(_ref2) {
|
|
|
121
121
|
return _objectSpread(_objectSpread({}, d), {}, {
|
|
122
122
|
omit: []
|
|
123
123
|
});
|
|
124
|
-
}),
|
|
124
|
+
}), 'name'));
|
|
125
125
|
}
|
|
126
126
|
}, [fetchedData, isPending, obsGroups, serverError, enableGroups, (_settings$selectedObs3 = settings.selectedObs) === null || _settings$selectedObs3 === void 0 ? void 0 : _settings$selectedObs3.name, (_settings$selectedObs4 = settings.selectedObs) === null || _settings$selectedObs4 === void 0 ? void 0 : _settings$selectedObs4.omit]);
|
|
127
127
|
useEffect(() => {
|
|
@@ -130,7 +130,7 @@ export function ObsColsList(_ref2) {
|
|
|
130
130
|
if (!obsCols[(_settings$selectedObs5 = settings.selectedObs) === null || _settings$selectedObs5 === void 0 ? void 0 : _settings$selectedObs5.name]) {
|
|
131
131
|
setActive([]);
|
|
132
132
|
dispatch({
|
|
133
|
-
type:
|
|
133
|
+
type: 'select.obs',
|
|
134
134
|
obs: null
|
|
135
135
|
});
|
|
136
136
|
}
|
|
@@ -155,7 +155,7 @@ export function ObsColsList(_ref2) {
|
|
|
155
155
|
});
|
|
156
156
|
if (((_settings$selectedObs6 = settings.selectedObs) === null || _settings$selectedObs6 === void 0 ? void 0 : _settings$selectedObs6.name) === item.name) {
|
|
157
157
|
dispatch({
|
|
158
|
-
type:
|
|
158
|
+
type: 'select.obs',
|
|
159
159
|
obs: _objectSpread(_objectSpread({}, item), {}, {
|
|
160
160
|
omit: omit
|
|
161
161
|
})
|
|
@@ -166,29 +166,29 @@ export function ObsColsList(_ref2) {
|
|
|
166
166
|
const inLabelObs = _.includes(settings.labelObs, item.name);
|
|
167
167
|
if (inLabelObs) {
|
|
168
168
|
dispatch({
|
|
169
|
-
type:
|
|
169
|
+
type: 'remove.label.obs',
|
|
170
170
|
obsName: item.name
|
|
171
171
|
});
|
|
172
172
|
} else {
|
|
173
173
|
dispatch({
|
|
174
|
-
type:
|
|
174
|
+
type: 'add.label.obs',
|
|
175
175
|
obs: item
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
};
|
|
179
179
|
const toggleSlice = item => {
|
|
180
180
|
dispatch({
|
|
181
|
-
type:
|
|
181
|
+
type: 'toggle.slice.obs',
|
|
182
182
|
obs: item
|
|
183
183
|
});
|
|
184
184
|
};
|
|
185
185
|
const toggleColor = item => {
|
|
186
186
|
dispatch({
|
|
187
|
-
type:
|
|
187
|
+
type: 'select.obs',
|
|
188
188
|
obs: item
|
|
189
189
|
});
|
|
190
190
|
dispatch({
|
|
191
|
-
type:
|
|
191
|
+
type: 'set.colorEncoding',
|
|
192
192
|
value: COLOR_ENCODINGS.OBS
|
|
193
193
|
});
|
|
194
194
|
};
|
|
@@ -209,7 +209,7 @@ export function ObsColsList(_ref2) {
|
|
|
209
209
|
});
|
|
210
210
|
if (((_settings$selectedObs7 = settings.selectedObs) === null || _settings$selectedObs7 === void 0 ? void 0 : _settings$selectedObs7.name) === item.name) {
|
|
211
211
|
dispatch({
|
|
212
|
-
type:
|
|
212
|
+
type: 'select.obs',
|
|
213
213
|
obs: _objectSpread(_objectSpread({}, item), {}, {
|
|
214
214
|
omit: omit
|
|
215
215
|
})
|
|
@@ -238,7 +238,7 @@ export function ObsColsList(_ref2) {
|
|
|
238
238
|
}), /*#__PURE__*/_jsxs("div", {
|
|
239
239
|
className: "accordion-header-toolbar",
|
|
240
240
|
children: [/*#__PURE__*/_jsx("span", {
|
|
241
|
-
className: "mx-1 cursor-pointer ".concat(inLabelObs ?
|
|
241
|
+
className: "mx-1 cursor-pointer ".concat(inLabelObs ? 'active-icon' : 'text-muted opacity-50'),
|
|
242
242
|
onClick: event => {
|
|
243
243
|
event.stopPropagation();
|
|
244
244
|
toggleLabel(item);
|
|
@@ -246,7 +246,7 @@ export function ObsColsList(_ref2) {
|
|
|
246
246
|
title: "Add to tooltip",
|
|
247
247
|
children: /*#__PURE__*/_jsx(CommentIcon, {})
|
|
248
248
|
}), /*#__PURE__*/_jsx("span", {
|
|
249
|
-
className: "mx-1 cursor-pointer ".concat(inSliceObs ?
|
|
249
|
+
className: "mx-1 cursor-pointer ".concat(inSliceObs ? 'active-icon' : 'text-muted opacity-50'),
|
|
250
250
|
onClick: event => {
|
|
251
251
|
event.stopPropagation();
|
|
252
252
|
toggleSlice(item);
|
|
@@ -254,12 +254,12 @@ export function ObsColsList(_ref2) {
|
|
|
254
254
|
title: "Filter applied",
|
|
255
255
|
children: /*#__PURE__*/_jsx(JoinInnerIcon, {})
|
|
256
256
|
}), /*#__PURE__*/_jsx("span", {
|
|
257
|
-
className: "mx-1 cursor-pointer ".concat(isColorEncoding ?
|
|
257
|
+
className: "mx-1 cursor-pointer ".concat(isColorEncoding ? 'active-icon' : 'text-muted opacity-50'),
|
|
258
258
|
onClick: event => {
|
|
259
259
|
event.stopPropagation();
|
|
260
260
|
toggleColor(item);
|
|
261
261
|
},
|
|
262
|
-
title: showSelectedAsActive ?
|
|
262
|
+
title: showSelectedAsActive ? 'Is selected' : 'Is color encoding',
|
|
263
263
|
children: /*#__PURE__*/_jsx(WaterDropIcon, {})
|
|
264
264
|
})]
|
|
265
265
|
})]
|
|
@@ -294,7 +294,7 @@ export function ObsColsList(_ref2) {
|
|
|
294
294
|
const groupItems = _.compact(_.map(_.sortBy(obsGroups[group], o => _.lowerCase(o.name)), item => {
|
|
295
295
|
return obsItem(obsCols === null || obsCols === void 0 ? void 0 : obsCols[item]);
|
|
296
296
|
}));
|
|
297
|
-
if (group ===
|
|
297
|
+
if (group === 'default') {
|
|
298
298
|
return groupItems;
|
|
299
299
|
} else {
|
|
300
300
|
return /*#__PURE__*/_jsxs(Accordion.Item, {
|
|
@@ -3,20 +3,20 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
3
3
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
5
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
-
import { useEffect, useState } from
|
|
7
|
-
import _ from
|
|
8
|
-
import { Button, ButtonGroup, Dropdown, DropdownButton, OverlayTrigger, Tooltip } from
|
|
9
|
-
import { DEFAULT_OBSM_KEYS } from
|
|
10
|
-
import { useDataset } from
|
|
11
|
-
import { useSettings, useSettingsDispatch } from
|
|
12
|
-
import { useFetch } from
|
|
13
|
-
import { ObsmKeysListBtn } from
|
|
6
|
+
import { useEffect, useState } from 'react';
|
|
7
|
+
import _ from 'lodash';
|
|
8
|
+
import { Button, ButtonGroup, Dropdown, DropdownButton, OverlayTrigger, Tooltip } from 'react-bootstrap';
|
|
9
|
+
import { DEFAULT_OBSM_KEYS } from '../../constants/constants';
|
|
10
|
+
import { useDataset } from '../../context/DatasetContext';
|
|
11
|
+
import { useSettings, useSettingsDispatch } from '../../context/SettingsContext';
|
|
12
|
+
import { useFetch } from '../../utils/requests';
|
|
13
|
+
import { ObsmKeysListBtn } from '../../utils/Skeleton';
|
|
14
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
15
|
export function ObsmKeysList(_ref) {
|
|
16
16
|
let {
|
|
17
17
|
setHasObsm
|
|
18
18
|
} = _ref;
|
|
19
|
-
const ENDPOINT =
|
|
19
|
+
const ENDPOINT = 'obsm/keys';
|
|
20
20
|
const dataset = useDataset();
|
|
21
21
|
const settings = useSettings();
|
|
22
22
|
const dispatch = useSettingsDispatch();
|
|
@@ -54,7 +54,7 @@ export function ObsmKeysList(_ref) {
|
|
|
54
54
|
const defaultObsm = _.find(fetchedData, item => item.toLowerCase() === k);
|
|
55
55
|
if (defaultObsm) {
|
|
56
56
|
dispatch({
|
|
57
|
-
type:
|
|
57
|
+
type: 'select.obsm',
|
|
58
58
|
obsm: defaultObsm
|
|
59
59
|
});
|
|
60
60
|
return false; // break
|
|
@@ -66,7 +66,7 @@ export function ObsmKeysList(_ref) {
|
|
|
66
66
|
// If selected obsm is not in keys list, reset to null
|
|
67
67
|
if (!_.includes(fetchedData || [], settings.selectedObsm)) {
|
|
68
68
|
dispatch({
|
|
69
|
-
type:
|
|
69
|
+
type: 'select.obsm',
|
|
70
70
|
obsm: null
|
|
71
71
|
});
|
|
72
72
|
} else {
|
|
@@ -77,10 +77,10 @@ export function ObsmKeysList(_ref) {
|
|
|
77
77
|
}, [dispatch, fetchedData, isPending, serverError, setHasObsm, settings.selectedObsm]);
|
|
78
78
|
const obsmList = obsmKeysList.map(item => {
|
|
79
79
|
return /*#__PURE__*/_jsx(Dropdown.Item, {
|
|
80
|
-
className: "custom ".concat(active === item &&
|
|
80
|
+
className: "custom ".concat(active === item && 'active'),
|
|
81
81
|
onClick: () => {
|
|
82
82
|
dispatch({
|
|
83
|
-
type:
|
|
83
|
+
type: 'select.obsm',
|
|
84
84
|
obsm: item
|
|
85
85
|
});
|
|
86
86
|
},
|
|
@@ -93,8 +93,8 @@ export function ObsmKeysList(_ref) {
|
|
|
93
93
|
}
|
|
94
94
|
return /*#__PURE__*/_jsxs(DropdownButton, {
|
|
95
95
|
as: ButtonGroup,
|
|
96
|
-
title: settings.selectedObsm ||
|
|
97
|
-
variant: settings.selectedObsm ?
|
|
96
|
+
title: settings.selectedObsm || 'Select an embedding',
|
|
97
|
+
variant: settings.selectedObsm ? 'primary' : 'warning',
|
|
98
98
|
id: "bg-nested-dropdown",
|
|
99
99
|
size: "sm",
|
|
100
100
|
children: [/*#__PURE__*/_jsx(Dropdown.Header, {
|
|
@@ -7,12 +7,12 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
8
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
9
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
|
-
import Offcanvas from
|
|
11
|
-
import { SELECTION_MODES } from
|
|
12
|
-
import { ObsColsList } from
|
|
13
|
-
import { ObsmKeysList } from
|
|
14
|
-
import { SearchBar } from
|
|
15
|
-
import { VarNamesList } from
|
|
10
|
+
import Offcanvas from 'react-bootstrap/Offcanvas';
|
|
11
|
+
import { SELECTION_MODES } from '../../constants/constants';
|
|
12
|
+
import { ObsColsList } from '../obs-list/ObsList';
|
|
13
|
+
import { ObsmKeysList } from '../obsm-list/ObsmList';
|
|
14
|
+
import { SearchBar } from '../search-bar/SearchBar';
|
|
15
|
+
import { VarNamesList } from '../var-list/VarList';
|
|
16
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
17
|
export function OffcanvasObs(_ref) {
|
|
18
18
|
let {
|
|
@@ -3,24 +3,24 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
3
3
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
5
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from
|
|
7
|
-
import { faEye, faSliders } from
|
|
8
|
-
import _ from
|
|
9
|
-
import { Alert } from
|
|
10
|
-
import Plot from
|
|
11
|
-
import { COLOR_ENCODINGS, OBS_TYPES, PSEUDOSPATIAL_PLOT_TYPES as PLOT_TYPES } from
|
|
12
|
-
import { useDataset } from
|
|
13
|
-
import { useFilteredData } from
|
|
14
|
-
import { useSettings, useSettingsDispatch } from
|
|
15
|
-
import { rgbToHex, useColor } from
|
|
16
|
-
import { ImageViewer } from
|
|
17
|
-
import { Legend } from
|
|
18
|
-
import { LoadingSpinner } from
|
|
19
|
-
import { useDebouncedFetch } from
|
|
20
|
-
import { useSelectedObs, useSelectedVar } from
|
|
6
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
7
|
+
import { faEye, faSliders } from '@fortawesome/free-solid-svg-icons';
|
|
8
|
+
import _ from 'lodash';
|
|
9
|
+
import { Alert } from 'react-bootstrap';
|
|
10
|
+
import Plot from 'react-plotly.js';
|
|
11
|
+
import { COLOR_ENCODINGS, OBS_TYPES, PSEUDOSPATIAL_PLOT_TYPES as PLOT_TYPES } from '../../constants/constants';
|
|
12
|
+
import { useDataset } from '../../context/DatasetContext';
|
|
13
|
+
import { useFilteredData } from '../../context/FilterContext';
|
|
14
|
+
import { useSettings, useSettingsDispatch } from '../../context/SettingsContext';
|
|
15
|
+
import { rgbToHex, useColor } from '../../helpers/color-helper';
|
|
16
|
+
import { ImageViewer } from '../../utils/ImageViewer';
|
|
17
|
+
import { Legend } from '../../utils/Legend';
|
|
18
|
+
import { LoadingSpinner } from '../../utils/LoadingIndicators';
|
|
19
|
+
import { useDebouncedFetch } from '../../utils/requests';
|
|
20
|
+
import { useSelectedObs, useSelectedVar } from '../../utils/Resolver';
|
|
21
21
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
22
|
function usePseudospatialData(plotType) {
|
|
23
|
-
const ENDPOINT =
|
|
23
|
+
const ENDPOINT = 'pseudospatial';
|
|
24
24
|
const dataset = useDataset();
|
|
25
25
|
const settings = useSettings();
|
|
26
26
|
const {
|
|
@@ -37,7 +37,7 @@ function usePseudospatialData(plotType) {
|
|
|
37
37
|
obsIndices: isSliced ? [...(obsIndices || [])] : null,
|
|
38
38
|
varNamesCol: dataset.varNamesCol,
|
|
39
39
|
showColorbar: false,
|
|
40
|
-
format:
|
|
40
|
+
format: 'json'
|
|
41
41
|
};
|
|
42
42
|
}, [dataset.url, settings.pseudospatial.maskSet, settings.pseudospatial.maskValues, dataset.varNamesCol, isSliced, obsIndices]);
|
|
43
43
|
const getPlotParams = useCallback(() => {
|
|
@@ -57,7 +57,7 @@ function usePseudospatialData(plotType) {
|
|
|
57
57
|
obsValues: !(selectedObs !== null && selectedObs !== void 0 && selectedObs.omit.length) ? null : _.difference(selectedObs === null || selectedObs === void 0 ? void 0 : selectedObs.values, selectedObs === null || selectedObs === void 0 ? void 0 : selectedObs.omit),
|
|
58
58
|
mode: settings.pseudospatial.categoricalMode
|
|
59
59
|
};
|
|
60
|
-
} else if (plotType ===
|
|
60
|
+
} else if (plotType === 'continuous') {
|
|
61
61
|
return {
|
|
62
62
|
obsCol: selectedObs,
|
|
63
63
|
obsValues: !(selectedObs !== null && selectedObs !== void 0 && selectedObs.omit.length) ? null : _.difference(selectedObs === null || selectedObs === void 0 ? void 0 : selectedObs.values, selectedObs === null || selectedObs === void 0 ? void 0 : selectedObs.omit)
|
|
@@ -67,7 +67,7 @@ function usePseudospatialData(plotType) {
|
|
|
67
67
|
const params = useMemo(() => {
|
|
68
68
|
return _objectSpread(_objectSpread({}, baseParams), getPlotParams());
|
|
69
69
|
}, [baseParams, getPlotParams]);
|
|
70
|
-
return useDebouncedFetch(ENDPOINT +
|
|
70
|
+
return useDebouncedFetch(ENDPOINT + '/' + plotType, params, 500, {
|
|
71
71
|
enabled: !!plotType && !!settings.pseudospatial.maskSet
|
|
72
72
|
});
|
|
73
73
|
}
|
|
@@ -100,7 +100,7 @@ export function Pseudospatial(_ref) {
|
|
|
100
100
|
useEffect(() => {
|
|
101
101
|
if (_.keys(settings.data.pseudospatial).length && !settings.pseudospatial.maskSet) {
|
|
102
102
|
dispatch({
|
|
103
|
-
type:
|
|
103
|
+
type: 'set.pseudospatial.maskSet',
|
|
104
104
|
maskSet: _.keys(settings.data.pseudospatial)[0]
|
|
105
105
|
});
|
|
106
106
|
}
|
|
@@ -194,17 +194,17 @@ export function Pseudospatial(_ref) {
|
|
|
194
194
|
if (imageUrl) {
|
|
195
195
|
return [_objectSpread({
|
|
196
196
|
source: imageUrl,
|
|
197
|
-
xref:
|
|
198
|
-
yref:
|
|
197
|
+
xref: 'paper',
|
|
198
|
+
yref: 'paper',
|
|
199
199
|
x: 0.5,
|
|
200
200
|
y: 0.5,
|
|
201
201
|
sizex: 1,
|
|
202
202
|
sizey: 1,
|
|
203
|
-
sizing:
|
|
204
|
-
layer:
|
|
205
|
-
xanchor:
|
|
206
|
-
yanchor:
|
|
207
|
-
name:
|
|
203
|
+
sizing: 'contain',
|
|
204
|
+
layer: 'above',
|
|
205
|
+
xanchor: 'center',
|
|
206
|
+
yanchor: 'middle',
|
|
207
|
+
name: 'Reference Image'
|
|
208
208
|
}, settings.pseudospatial.refImg)];
|
|
209
209
|
}
|
|
210
210
|
return [];
|
|
@@ -213,7 +213,7 @@ export function Pseudospatial(_ref) {
|
|
|
213
213
|
var _settings$pseudospati;
|
|
214
214
|
const isRefImgVisible = (_settings$pseudospati = settings.pseudospatial) === null || _settings$pseudospati === void 0 || (_settings$pseudospati = _settings$pseudospati.refImg) === null || _settings$pseudospati === void 0 ? void 0 : _settings$pseudospati.visible;
|
|
215
215
|
return [{
|
|
216
|
-
name:
|
|
216
|
+
name: 'Open plot controls',
|
|
217
217
|
icon: {
|
|
218
218
|
width: 512,
|
|
219
219
|
height: 512,
|
|
@@ -221,14 +221,14 @@ export function Pseudospatial(_ref) {
|
|
|
221
221
|
},
|
|
222
222
|
click: () => setShowControls(prev => !prev)
|
|
223
223
|
}, ...(imageUrl ? [{
|
|
224
|
-
name: isRefImgVisible ?
|
|
224
|
+
name: isRefImgVisible ? 'Hide reference image' : 'Show reference image',
|
|
225
225
|
icon: {
|
|
226
226
|
width: 600,
|
|
227
227
|
height: 512,
|
|
228
228
|
path: faEye.icon[4]
|
|
229
229
|
},
|
|
230
230
|
click: () => dispatch({
|
|
231
|
-
type:
|
|
231
|
+
type: 'toggle.pseudospatial.refImg.visible'
|
|
232
232
|
})
|
|
233
233
|
}] : [])];
|
|
234
234
|
}, [dispatch, imageUrl, setShowControls, (_settings$pseudospati2 = settings.pseudospatial) === null || _settings$pseudospati2 === void 0 || (_settings$pseudospati2 = _settings$pseudospati2.refImg) === null || _settings$pseudospati2 === void 0 ? void 0 : _settings$pseudospati2.visible]);
|
|
@@ -268,7 +268,7 @@ export function Pseudospatial(_ref) {
|
|
|
268
268
|
}), hasSelections && showLegend && /*#__PURE__*/_jsx(Legend, {
|
|
269
269
|
min: layout === null || layout === void 0 || (_layout$coloraxis5 = layout.coloraxis) === null || _layout$coloraxis5 === void 0 ? void 0 : _layout$coloraxis5.cmin,
|
|
270
270
|
max: layout === null || layout === void 0 || (_layout$coloraxis6 = layout.coloraxis) === null || _layout$coloraxis6 === void 0 ? void 0 : _layout$coloraxis6.cmax,
|
|
271
|
-
addText: plotType === PLOT_TYPES.GENE ?
|
|
271
|
+
addText: plotType === PLOT_TYPES.GENE ? ' - Mean expression' : plotType === PLOT_TYPES.CATEGORICAL ? ' - %' : plotType === PLOT_TYPES.CONTINUOUS ? ' - Mean value' : ''
|
|
272
272
|
})]
|
|
273
273
|
})
|
|
274
274
|
});
|