@haniffalab/cherita-react 1.4.1-dev.2025-10-23.e95b5a90 → 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 +8 -8
- 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 +7 -7
- 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 +7 -7
- 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 +10 -10
- 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 +5 -5
- 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 +21 -21
- 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 +20 -20
- 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 +20 -20
- 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 +26 -26
- 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 +8 -8
- 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
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ Install packages
|
|
|
21
21
|
npm i
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Create a
|
|
24
|
+
Create a `.env` file within `sites/demo` to store environment variables for Vite to use. Within it set `REACT_APP_API_URL` to the backend API url like
|
|
25
25
|
|
|
26
26
|
```sh
|
|
27
27
|
REACT_APP_API_URL=http://localhost:5000/api/
|
|
@@ -22,7 +22,7 @@ const ColorscaleSelect = () => {
|
|
|
22
22
|
value: settings.controls.colorScale,
|
|
23
23
|
onChange: e => {
|
|
24
24
|
dispatch({
|
|
25
|
-
type:
|
|
25
|
+
type: 'set.controls.colorScale',
|
|
26
26
|
colorScale: e.target.value
|
|
27
27
|
});
|
|
28
28
|
},
|
|
@@ -50,16 +50,16 @@ const ScaleSelect = _ref => {
|
|
|
50
50
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Form.Label, {
|
|
51
51
|
children: "Standard scale"
|
|
52
52
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Form.Select, {
|
|
53
|
-
value: settings.controls.scale[plot] ||
|
|
53
|
+
value: settings.controls.scale[plot] || '',
|
|
54
54
|
onChange: e => {
|
|
55
55
|
dispatch({
|
|
56
|
-
type:
|
|
56
|
+
type: 'set.controls.scale',
|
|
57
57
|
plot: plot,
|
|
58
58
|
scale: !e.target.value.length ? null : e.target.value
|
|
59
59
|
});
|
|
60
60
|
},
|
|
61
61
|
children: _lodash.default.values(SCALES[plot]).map(scale => /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
62
|
-
value: scale.value ||
|
|
62
|
+
value: scale.value || '',
|
|
63
63
|
children: scale.name
|
|
64
64
|
}, scale.value))
|
|
65
65
|
})]
|
|
@@ -35,7 +35,7 @@ function Dotplot(_ref) {
|
|
|
35
35
|
plotType,
|
|
36
36
|
setPlotType
|
|
37
37
|
} = _ref;
|
|
38
|
-
const ENDPOINT =
|
|
38
|
+
const ENDPOINT = 'dotplot';
|
|
39
39
|
const dataset = (0, _DatasetContext.useDataset)();
|
|
40
40
|
const settings = (0, _SettingsContext.useSettings)();
|
|
41
41
|
const {
|
|
@@ -94,7 +94,7 @@ function Dotplot(_ref) {
|
|
|
94
94
|
setLayout(fetchedData.layout);
|
|
95
95
|
// @TODO: keep colorAxis range from settings
|
|
96
96
|
dispatch({
|
|
97
|
-
type:
|
|
97
|
+
type: 'set.controls.colorAxis',
|
|
98
98
|
colorAxis: {
|
|
99
99
|
dmin: fetchedData.range.min.toFixed(1),
|
|
100
100
|
dmax: fetchedData.range.max.toFixed(1),
|
|
@@ -139,8 +139,8 @@ function Dotplot(_ref) {
|
|
|
139
139
|
layout: layout,
|
|
140
140
|
useResizeHandler: true,
|
|
141
141
|
style: {
|
|
142
|
-
width:
|
|
143
|
-
height:
|
|
142
|
+
width: '100%',
|
|
143
|
+
height: '100%'
|
|
144
144
|
},
|
|
145
145
|
config: {
|
|
146
146
|
displaylogo: false,
|
|
@@ -156,17 +156,17 @@ function Dotplot(_ref) {
|
|
|
156
156
|
setPlotType: setPlotType,
|
|
157
157
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
158
158
|
className: "p-0 m-0",
|
|
159
|
-
children: ["Select one or more",
|
|
159
|
+
children: ["Select one or more", ' ', showVarsBtn ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Button, {
|
|
160
160
|
variant: "link",
|
|
161
161
|
className: "border-0 p-0 align-baseline",
|
|
162
162
|
onClick: setShowVars,
|
|
163
163
|
children: "features"
|
|
164
|
-
}) :
|
|
164
|
+
}) : 'features', ' ', "to display their expression across groups, then choose a", ' ', showObsBtn ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Button, {
|
|
165
165
|
variant: "link",
|
|
166
166
|
className: "border-0 p-0 align-baseline",
|
|
167
167
|
onClick: setShowObs,
|
|
168
168
|
children: "category"
|
|
169
|
-
}) :
|
|
169
|
+
}) : 'category', ' ', "to group observations in the dotplot."]
|
|
170
170
|
})
|
|
171
171
|
});
|
|
172
172
|
} else {
|
|
@@ -175,7 +175,7 @@ function Dotplot(_ref) {
|
|
|
175
175
|
heading: "Error displaying the dotplot",
|
|
176
176
|
plotType: plotType,
|
|
177
177
|
setPlotType: setPlotType,
|
|
178
|
-
children: serverError.message ||
|
|
178
|
+
children: serverError.message || 'An unexpected error occurred while generating the plot.'
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
}
|
|
@@ -78,7 +78,7 @@ function DotplotControls() {
|
|
|
78
78
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Button, {
|
|
79
79
|
variant: "outline-primary",
|
|
80
80
|
onClick: () => dispatch({
|
|
81
|
-
type:
|
|
81
|
+
type: 'set.controls.colorAxis.crange',
|
|
82
82
|
cmin: controls.colorAxis.cmin,
|
|
83
83
|
cmax: controls.colorAxis.cmax
|
|
84
84
|
}),
|
|
@@ -86,7 +86,7 @@ function DotplotControls() {
|
|
|
86
86
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Button, {
|
|
87
87
|
variant: "outline-primary",
|
|
88
88
|
onClick: () => dispatch({
|
|
89
|
-
type:
|
|
89
|
+
type: 'set.controls.colorAxis.crange',
|
|
90
90
|
cmin: settings.controls.colorAxis.dmin,
|
|
91
91
|
cmax: settings.controls.colorAxis.dmax
|
|
92
92
|
}),
|
|
@@ -103,7 +103,7 @@ function DotplotControls() {
|
|
|
103
103
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Form.Control, {
|
|
104
104
|
size: "sm",
|
|
105
105
|
type: "number",
|
|
106
|
-
step:
|
|
106
|
+
step: '0.1',
|
|
107
107
|
min: 0.0,
|
|
108
108
|
value: controls.expressionCutoff,
|
|
109
109
|
onChange: e => {
|
|
@@ -114,7 +114,7 @@ function DotplotControls() {
|
|
|
114
114
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Button, {
|
|
115
115
|
variant: "outline-primary",
|
|
116
116
|
onClick: () => dispatch({
|
|
117
|
-
type:
|
|
117
|
+
type: 'set.controls.expressionCutoff',
|
|
118
118
|
expressionCutoff: parseFloat(controls.expressionCutoff)
|
|
119
119
|
}),
|
|
120
120
|
children: "Apply"
|
|
@@ -129,7 +129,7 @@ function DotplotControls() {
|
|
|
129
129
|
checked: settings.controls.meanOnlyExpressed,
|
|
130
130
|
onChange: () => {
|
|
131
131
|
dispatch({
|
|
132
|
-
type:
|
|
132
|
+
type: 'set.controls.meanOnlyExpressed',
|
|
133
133
|
meanOnlyExpressed: !settings.controls.meanOnlyExpressed
|
|
134
134
|
});
|
|
135
135
|
}
|
|
@@ -7,7 +7,6 @@ exports.FullPage = FullPage;
|
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _material = require("@mui/material");
|
|
9
9
|
var _reactBootstrap = require("react-bootstrap");
|
|
10
|
-
var _PlotTypeSelector = require("./PlotTypeSelector");
|
|
11
10
|
var _constants = require("../../constants/constants");
|
|
12
11
|
var _DatasetContext = require("../../context/DatasetContext");
|
|
13
12
|
var _Dotplot = require("../dotplot/Dotplot");
|
|
@@ -18,6 +17,7 @@ var _Matrixplot = require("../matrixplot/Matrixplot");
|
|
|
18
17
|
var _MatrixplotControls = require("../matrixplot/MatrixplotControls");
|
|
19
18
|
var _ObsList = require("../obs-list/ObsList");
|
|
20
19
|
var _offcanvas = require("../offcanvas");
|
|
20
|
+
var _PlotTypeSelector = require("./PlotTypeSelector");
|
|
21
21
|
var _Pseudospatial = require("../pseudospatial/Pseudospatial");
|
|
22
22
|
var _PseudospatialToolbar = require("../pseudospatial/PseudospatialToolbar");
|
|
23
23
|
var _Scatterplot = require("../scatterplot/Scatterplot");
|
|
@@ -59,7 +59,6 @@ function FullPage(_ref) {
|
|
|
59
59
|
const XlBreakpoint = (0, _material.useMediaQuery)(_constants.BREAKPOINTS.XL);
|
|
60
60
|
const showObsBtn = LgBreakpoint;
|
|
61
61
|
const showVarsBtn = XlBreakpoint;
|
|
62
|
-
const showPlotBtn = showVarsBtn;
|
|
63
62
|
const {
|
|
64
63
|
plotControls,
|
|
65
64
|
varMode,
|
|
@@ -11,7 +11,7 @@ var _constants = require("../../constants/constants");
|
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
function PlotAlert(_ref) {
|
|
13
13
|
let {
|
|
14
|
-
variant =
|
|
14
|
+
variant = 'warning',
|
|
15
15
|
plotType = _constants.PLOT_TYPES.SCATTERPLOT,
|
|
16
16
|
setPlotType,
|
|
17
17
|
heading,
|
|
@@ -22,28 +22,28 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
22
22
|
const plotTypes = [{
|
|
23
23
|
type: _constants.PLOT_TYPES.SCATTERPLOT,
|
|
24
24
|
icon: _ScatterplotIcon.default,
|
|
25
|
-
name:
|
|
26
|
-
description:
|
|
25
|
+
name: 'Scatterplot',
|
|
26
|
+
description: 'Displays cells in 2D based on dimensionality reduction.'
|
|
27
27
|
}, {
|
|
28
28
|
type: _constants.PLOT_TYPES.MATRIXPLOT,
|
|
29
29
|
icon: _MatrixPlotIcon.default,
|
|
30
|
-
name:
|
|
31
|
-
description:
|
|
30
|
+
name: 'Matrix Plot',
|
|
31
|
+
description: 'Shows expression values of genes across categories.'
|
|
32
32
|
}, {
|
|
33
33
|
type: _constants.PLOT_TYPES.DOTPLOT,
|
|
34
34
|
icon: _DotPlotIcon.default,
|
|
35
|
-
name:
|
|
36
|
-
description:
|
|
35
|
+
name: 'Dot Plot',
|
|
36
|
+
description: 'Shows proportion and expression of genes across groups.'
|
|
37
37
|
}, {
|
|
38
38
|
type: _constants.PLOT_TYPES.HEATMAP,
|
|
39
39
|
icon: _HeatmapIcon.default,
|
|
40
|
-
name:
|
|
41
|
-
description:
|
|
40
|
+
name: 'Heatmap',
|
|
41
|
+
description: 'Visualises gene expression or feature activity as a colour-coded matrix.'
|
|
42
42
|
}, {
|
|
43
43
|
type: _constants.PLOT_TYPES.VIOLINPLOT,
|
|
44
44
|
icon: _ViolinPlotIcon.default,
|
|
45
|
-
name:
|
|
46
|
-
description:
|
|
45
|
+
name: 'Violin Plot',
|
|
46
|
+
description: 'Displays distribution of gene expression across categories.'
|
|
47
47
|
}];
|
|
48
48
|
function PlotTypeSelector(_ref) {
|
|
49
49
|
let {
|
|
@@ -68,7 +68,7 @@ function PlotTypeSelector(_ref) {
|
|
|
68
68
|
} = _ref2;
|
|
69
69
|
const isActive = currentType === type;
|
|
70
70
|
const hovered = hoveredMap[type] || false;
|
|
71
|
-
const colour = isActive ?
|
|
71
|
+
const colour = isActive ? '#005a86' : hovered ? '#0071a7' : '#000';
|
|
72
72
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_StyledTooltip.StyledTooltip, {
|
|
73
73
|
title: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
74
74
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("strong", {
|
|
@@ -79,7 +79,7 @@ function PlotTypeSelector(_ref) {
|
|
|
79
79
|
slotProps: {
|
|
80
80
|
popper: {
|
|
81
81
|
modifiers: [{
|
|
82
|
-
name:
|
|
82
|
+
name: 'offset',
|
|
83
83
|
options: {
|
|
84
84
|
offset: [0, -12]
|
|
85
85
|
}
|
|
@@ -90,7 +90,7 @@ function PlotTypeSelector(_ref) {
|
|
|
90
90
|
onMouseEnter: () => handleMouseEnter(type),
|
|
91
91
|
onMouseLeave: () => handleMouseLeave(type),
|
|
92
92
|
onClick: () => onChange(type),
|
|
93
|
-
className: "plotselector-icon".concat(isActive ?
|
|
93
|
+
className: "plotselector-icon".concat(isActive ? ' active' : ''),
|
|
94
94
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
|
95
95
|
size: 34,
|
|
96
96
|
colour: colour
|
|
@@ -35,7 +35,7 @@ function Heatmap(_ref) {
|
|
|
35
35
|
plotType,
|
|
36
36
|
setPlotType
|
|
37
37
|
} = _ref;
|
|
38
|
-
const ENDPOINT =
|
|
38
|
+
const ENDPOINT = 'heatmap';
|
|
39
39
|
const dataset = (0, _DatasetContext.useDataset)();
|
|
40
40
|
const settings = (0, _SettingsContext.useSettings)();
|
|
41
41
|
const {
|
|
@@ -113,8 +113,8 @@ function Heatmap(_ref) {
|
|
|
113
113
|
layout: layout,
|
|
114
114
|
useResizeHandler: true,
|
|
115
115
|
style: {
|
|
116
|
-
width:
|
|
117
|
-
height:
|
|
116
|
+
width: '100%',
|
|
117
|
+
height: '100%'
|
|
118
118
|
},
|
|
119
119
|
config: {
|
|
120
120
|
displaylogo: false,
|
|
@@ -130,17 +130,17 @@ function Heatmap(_ref) {
|
|
|
130
130
|
setPlotType: setPlotType,
|
|
131
131
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
132
132
|
className: "p-0 m-0",
|
|
133
|
-
children: ["Select one or more",
|
|
133
|
+
children: ["Select one or more", ' ', showVarsBtn ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Button, {
|
|
134
134
|
variant: "link",
|
|
135
135
|
className: "border-0 p-0 align-baseline",
|
|
136
136
|
onClick: setShowVars,
|
|
137
137
|
children: "features"
|
|
138
|
-
}) :
|
|
138
|
+
}) : 'features', ' ', "to display their expression, then choose a", ' ', showObsBtn ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Button, {
|
|
139
139
|
variant: "link",
|
|
140
140
|
className: "border-0 p-0 align-baseline",
|
|
141
141
|
onClick: setShowObs,
|
|
142
142
|
children: "category"
|
|
143
|
-
}) :
|
|
143
|
+
}) : 'category', ' ', "to group observations in the heatmap."]
|
|
144
144
|
})
|
|
145
145
|
});
|
|
146
146
|
} else {
|
|
@@ -149,7 +149,7 @@ function Heatmap(_ref) {
|
|
|
149
149
|
heading: "Error displaying the heatmap",
|
|
150
150
|
plotType: plotType,
|
|
151
151
|
setPlotType: setPlotType,
|
|
152
|
-
children: serverError.message ||
|
|
152
|
+
children: serverError.message || 'An unexpected error occurred while generating the plot.'
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
155
|
}
|
|
@@ -16,7 +16,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
16
16
|
function ScatterplotIcon(_ref) {
|
|
17
17
|
let {
|
|
18
18
|
size = 40,
|
|
19
|
-
colour =
|
|
19
|
+
colour = '#000'
|
|
20
20
|
} = _ref,
|
|
21
21
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
22
|
// Points with cluster assignments
|
|
@@ -16,7 +16,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
16
16
|
function ScatterplotIcon(_ref) {
|
|
17
17
|
let {
|
|
18
18
|
size = 40,
|
|
19
|
-
colour =
|
|
19
|
+
colour = '#000'
|
|
20
20
|
} = _ref,
|
|
21
21
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
22
|
// Points with cluster assignments
|
|
@@ -16,7 +16,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
16
16
|
function ViolinPlotIcon(_ref) {
|
|
17
17
|
let {
|
|
18
18
|
size = 40,
|
|
19
|
-
colour =
|
|
19
|
+
colour = '#000'
|
|
20
20
|
} = _ref,
|
|
21
21
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
22
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", _objectSpread(_objectSpread({
|
|
@@ -35,7 +35,7 @@ function Matrixplot(_ref) {
|
|
|
35
35
|
plotType,
|
|
36
36
|
setPlotType
|
|
37
37
|
} = _ref;
|
|
38
|
-
const ENDPOINT =
|
|
38
|
+
const ENDPOINT = 'matrixplot';
|
|
39
39
|
const dataset = (0, _DatasetContext.useDataset)();
|
|
40
40
|
const settings = (0, _SettingsContext.useSettings)();
|
|
41
41
|
const {
|
|
@@ -114,8 +114,8 @@ function Matrixplot(_ref) {
|
|
|
114
114
|
layout: layout,
|
|
115
115
|
useResizeHandler: true,
|
|
116
116
|
style: {
|
|
117
|
-
width:
|
|
118
|
-
height:
|
|
117
|
+
width: '100%',
|
|
118
|
+
height: '100%'
|
|
119
119
|
},
|
|
120
120
|
config: {
|
|
121
121
|
displaylogo: false,
|
|
@@ -131,17 +131,17 @@ function Matrixplot(_ref) {
|
|
|
131
131
|
setPlotType: setPlotType,
|
|
132
132
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
133
133
|
className: "p-0 m-0",
|
|
134
|
-
children: ["Select a",
|
|
134
|
+
children: ["Select a", ' ', showObsBtn ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Button, {
|
|
135
135
|
variant: "link",
|
|
136
136
|
className: "border-0 p-0 align-baseline",
|
|
137
137
|
onClick: setShowObs,
|
|
138
138
|
children: "category"
|
|
139
|
-
}) :
|
|
139
|
+
}) : 'category', ' ', "to group observations, then choose one or more", ' ', showVarsBtn ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Button, {
|
|
140
140
|
variant: "link",
|
|
141
141
|
className: "border-0 p-0 align-baseline",
|
|
142
142
|
onClick: setShowVars,
|
|
143
143
|
children: "features"
|
|
144
|
-
}) :
|
|
144
|
+
}) : 'features', ' ', "to display the matrix plot."]
|
|
145
145
|
})
|
|
146
146
|
});
|
|
147
147
|
} else {
|
|
@@ -150,7 +150,7 @@ function Matrixplot(_ref) {
|
|
|
150
150
|
heading: "Error displaying the matrix plot",
|
|
151
151
|
plotType: plotType,
|
|
152
152
|
setPlotType: setPlotType,
|
|
153
|
-
children: serverError.message ||
|
|
153
|
+
children: serverError.message || 'An unexpected error occurred while generating the plot.'
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
}
|
|
@@ -48,13 +48,13 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
48
48
|
// return { ...data, bins: bins };
|
|
49
49
|
// }
|
|
50
50
|
function getContinuousLabel(code, binEdges) {
|
|
51
|
-
return "[ ".concat((0, _string.formatNumerical)(binEdges[code][0]), ", ").concat((0, _string.formatNumerical)(binEdges[code][1], _string.FORMATS.EXPONENTIAL)).concat(code === binEdges.length - 1 ?
|
|
51
|
+
return "[ ".concat((0, _string.formatNumerical)(binEdges[code][0]), ", ").concat((0, _string.formatNumerical)(binEdges[code][1], _string.FORMATS.EXPONENTIAL)).concat(code === binEdges.length - 1 ? ' ]' : ' )');
|
|
52
52
|
}
|
|
53
53
|
const useObsHistogram = (obs, _ref) => {
|
|
54
54
|
let {
|
|
55
55
|
enabled = true
|
|
56
56
|
} = _ref;
|
|
57
|
-
const ENDPOINT =
|
|
57
|
+
const ENDPOINT = 'obs/histograms';
|
|
58
58
|
const dataset = (0, _DatasetContext.useDataset)();
|
|
59
59
|
const settings = (0, _SettingsContext.useSettings)();
|
|
60
60
|
const {
|
|
@@ -64,7 +64,7 @@ const useObsHistogram = (obs, _ref) => {
|
|
|
64
64
|
const selectedVar = (0, _Resolver.useSelectedVar)();
|
|
65
65
|
const [params, setParams] = (0, _react.useState)({
|
|
66
66
|
url: dataset.url,
|
|
67
|
-
obsCol: _lodash.default.omit(obs,
|
|
67
|
+
obsCol: _lodash.default.omit(obs, 'omit'),
|
|
68
68
|
// avoid re-rendering when toggling unselected obs
|
|
69
69
|
varKey: selectedVar !== null && selectedVar !== void 0 && selectedVar.isSet ? {
|
|
70
70
|
name: selectedVar === null || selectedVar === void 0 ? void 0 : selectedVar.name,
|
|
@@ -75,7 +75,7 @@ const useObsHistogram = (obs, _ref) => {
|
|
|
75
75
|
(0, _react.useEffect)(() => {
|
|
76
76
|
setParams(p => {
|
|
77
77
|
return _objectSpread(_objectSpread({}, p), {}, {
|
|
78
|
-
obsCol: _lodash.default.omit(obs,
|
|
78
|
+
obsCol: _lodash.default.omit(obs, 'omit'),
|
|
79
79
|
varKey: selectedVar !== null && selectedVar !== void 0 && selectedVar.isSet ? {
|
|
80
80
|
name: selectedVar === null || selectedVar === void 0 ? void 0 : selectedVar.name,
|
|
81
81
|
indices: selectedVar === null || selectedVar === void 0 ? void 0 : selectedVar.vars.map(v => v.index)
|
|
@@ -193,7 +193,7 @@ function CategoricalItem(_ref2) {
|
|
|
193
193
|
className: "pl-1 m-0",
|
|
194
194
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
195
195
|
title: isSliced ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
196
|
-
children: ["Filtered:",
|
|
196
|
+
children: ["Filtered:", ' ', (0, _string.formatNumerical)(filteredStats.pct, _string.FORMATS.EXPONENTIAL), "%", /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), "Total: ", (0, _string.formatNumerical)(stats.pct, _string.FORMATS.EXPONENTIAL), "%"]
|
|
197
197
|
}) : "".concat((0, _string.formatNumerical)(stats.pct, _string.FORMATS.EXPONENTIAL), "%"),
|
|
198
198
|
placement: "left",
|
|
199
199
|
arrow: true,
|
|
@@ -201,8 +201,8 @@ function CategoricalItem(_ref2) {
|
|
|
201
201
|
className: "d-flex align-items-center",
|
|
202
202
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Badge, {
|
|
203
203
|
className: "value-count-badge",
|
|
204
|
-
children: [
|
|
205
|
-
children: [(0, _string.formatNumerical)(parseInt(filteredStats.value_counts)),
|
|
204
|
+
children: [' ', isSliced && parseInt(filteredStats.value_counts) !== parseInt(stats.value_counts) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
205
|
+
children: [(0, _string.formatNumerical)(parseInt(filteredStats.value_counts)), ' ', "out of", ' ']
|
|
206
206
|
}), (0, _string.formatNumerical)(parseInt(stats.value_counts), _string.FORMATS.EXPONENTIAL)]
|
|
207
207
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
208
208
|
className: "value-pct-gauge-container",
|
|
@@ -211,8 +211,8 @@ function CategoricalItem(_ref2) {
|
|
|
211
211
|
className: "pct-gauge filtered-pct-gauge",
|
|
212
212
|
value: filteredStats.pct,
|
|
213
213
|
text: null,
|
|
214
|
-
innerRadius:
|
|
215
|
-
outerRadius:
|
|
214
|
+
innerRadius: '50%',
|
|
215
|
+
outerRadius: '75%',
|
|
216
216
|
margin: {
|
|
217
217
|
top: 0,
|
|
218
218
|
right: 0,
|
|
@@ -223,7 +223,7 @@ function CategoricalItem(_ref2) {
|
|
|
223
223
|
className: "pct-gauge",
|
|
224
224
|
value: stats.pct,
|
|
225
225
|
text: null,
|
|
226
|
-
innerRadius:
|
|
226
|
+
innerRadius: '75%',
|
|
227
227
|
margin: {
|
|
228
228
|
top: 0,
|
|
229
229
|
right: 0,
|
|
@@ -234,7 +234,7 @@ function CategoricalItem(_ref2) {
|
|
|
234
234
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_xCharts.Gauge, {
|
|
235
235
|
value: stats.pct,
|
|
236
236
|
text: null,
|
|
237
|
-
innerRadius:
|
|
237
|
+
innerRadius: '50%',
|
|
238
238
|
margin: {
|
|
239
239
|
top: 0,
|
|
240
240
|
right: 0,
|
|
@@ -265,7 +265,7 @@ function CategoricalItem(_ref2) {
|
|
|
265
265
|
grayParams: {
|
|
266
266
|
alpha: 1
|
|
267
267
|
},
|
|
268
|
-
colorEncoding:
|
|
268
|
+
colorEncoding: 'obs'
|
|
269
269
|
}, useUnsColors ? {
|
|
270
270
|
colorscale: colors
|
|
271
271
|
} : {})), ")")
|
|
@@ -355,7 +355,7 @@ function ObsContinuousStats(_ref4) {
|
|
|
355
355
|
let {
|
|
356
356
|
obs
|
|
357
357
|
} = _ref4;
|
|
358
|
-
const ENDPOINT =
|
|
358
|
+
const ENDPOINT = 'obs/distribution';
|
|
359
359
|
const dataset = (0, _DatasetContext.useDataset)();
|
|
360
360
|
const params = {
|
|
361
361
|
url: dataset.url,
|
|
@@ -399,7 +399,7 @@ function ObsContinuousStats(_ref4) {
|
|
|
399
399
|
valueFormatter: v => "".concat((0, _string.formatNumerical)(v, _string.FORMATS.EXPONENTIAL)),
|
|
400
400
|
slotProps: {
|
|
401
401
|
popper: {
|
|
402
|
-
className:
|
|
402
|
+
className: 'feature-histogram-tooltip'
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
405
|
})
|
|
@@ -410,28 +410,28 @@ function ObsContinuousStats(_ref4) {
|
|
|
410
410
|
className: "d-flex justify-content-between",
|
|
411
411
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
412
412
|
children: "Min"
|
|
413
|
-
}),
|
|
413
|
+
}), ' ', /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
414
414
|
children: (0, _string.formatNumerical)(obs.min, _string.FORMATS.EXPONENTIAL)
|
|
415
415
|
})]
|
|
416
416
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
417
417
|
className: "d-flex justify-content-between",
|
|
418
418
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
419
419
|
children: "Max"
|
|
420
|
-
}),
|
|
420
|
+
}), ' ', /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
421
421
|
children: (0, _string.formatNumerical)(obs.max, _string.FORMATS.EXPONENTIAL)
|
|
422
422
|
})]
|
|
423
423
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
424
424
|
className: "d-flex justify-content-between",
|
|
425
425
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
426
426
|
children: "Mean"
|
|
427
|
-
}),
|
|
427
|
+
}), ' ', /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
428
428
|
children: (0, _string.formatNumerical)(obs.mean, _string.FORMATS.EXPONENTIAL)
|
|
429
429
|
})]
|
|
430
430
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
431
431
|
className: "d-flex justify-content-between",
|
|
432
432
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
433
433
|
children: "Median"
|
|
434
|
-
}),
|
|
434
|
+
}), ' ', /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
435
435
|
children: (0, _string.formatNumerical)(obs.median, _string.FORMATS.EXPONENTIAL)
|
|
436
436
|
})]
|
|
437
437
|
})]
|
|
@@ -461,7 +461,7 @@ function ContinuousObs(_ref5) {
|
|
|
461
461
|
const filteredObsData = useFilteredObsData(obs);
|
|
462
462
|
const enabledHistograms = (0, _react.useMemo)(() => showHistograms && settings.colorEncoding === _constants.COLOR_ENCODINGS.VAR, [settings.colorEncoding, showHistograms]);
|
|
463
463
|
const getLabel = (0, _react.useCallback)(index => {
|
|
464
|
-
return isNaN(obs.values[index]) ?
|
|
464
|
+
return isNaN(obs.values[index]) ? 'NaN' : getContinuousLabel(obs.codes[obs.values[index]], obs.bins.binEdges);
|
|
465
465
|
}, [obs.bins.binEdges, obs.codes, obs.values]);
|
|
466
466
|
const getDataAtIndex = (0, _react.useCallback)(index => {
|
|
467
467
|
var _obsHistograms$fetche2;
|