@haniffalab/cherita-react 1.4.1-dev.2025-10-22.61540191 → 1.4.1-dev.2025-10-23.3179e534
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/cjs/components/controls/Controls.js +38 -30
- package/dist/cjs/components/dotplot/Dotplot.js +40 -33
- package/dist/cjs/components/dotplot/DotplotControls.js +103 -83
- package/dist/cjs/components/full-page/FullPage.js +92 -69
- package/dist/cjs/components/full-page/PlotAlert.js +25 -16
- package/dist/cjs/components/full-page/PlotTypeSelector.js +43 -36
- package/dist/cjs/components/heatmap/Heatmap.js +40 -33
- package/dist/cjs/components/heatmap/HeatmapControls.js +6 -3
- package/dist/cjs/components/icons/DotPlotIcon.js +16 -10
- package/dist/cjs/components/icons/HeatmapIcon.js +17 -11
- package/dist/cjs/components/icons/MatrixPlotIcon.1.js +22 -16
- package/dist/cjs/components/icons/MatrixPlotIcon.js +22 -16
- package/dist/cjs/components/icons/ScatterplotIcon.1.js +21 -15
- package/dist/cjs/components/icons/ScatterplotIcon.js +21 -15
- package/dist/cjs/components/icons/ViolinPlotIcon.js +22 -14
- package/dist/cjs/components/matrixplot/Matrixplot.js +40 -33
- package/dist/cjs/components/matrixplot/MatrixplotControls.js +8 -5
- package/dist/cjs/components/obs-list/ObsItem.js +238 -190
- package/dist/cjs/components/obs-list/ObsList.js +106 -87
- package/dist/cjs/components/obs-list/ObsToolbar.js +2 -3
- package/dist/cjs/components/obsm-list/ObsmList.js +47 -32
- package/dist/cjs/components/offcanvas/index.js +61 -31
- package/dist/cjs/components/pseudospatial/Pseudospatial.js +46 -36
- package/dist/cjs/components/pseudospatial/PseudospatialToolbar.js +98 -68
- package/dist/cjs/components/scatterplot/Scatterplot.js +87 -65
- package/dist/cjs/components/scatterplot/ScatterplotControls.js +35 -27
- package/dist/cjs/components/scatterplot/SpatialControls.js +134 -107
- package/dist/cjs/components/scatterplot/Toolbox.js +41 -30
- package/dist/cjs/components/search-bar/SearchBar.js +157 -110
- package/dist/cjs/components/search-bar/SearchInfo.js +73 -47
- package/dist/cjs/components/search-bar/SearchResults.js +93 -71
- package/dist/cjs/components/toolbar/Toolbar.js +43 -34
- package/dist/cjs/components/var-list/VarItem.js +106 -79
- package/dist/cjs/components/var-list/VarList.js +67 -53
- package/dist/cjs/components/var-list/VarListToolbar.js +56 -51
- package/dist/cjs/components/var-list/VarSet.js +115 -97
- package/dist/cjs/components/violin/Violin.js +77 -58
- package/dist/cjs/components/violin/ViolinControls.js +8 -5
- package/dist/cjs/context/DatasetContext.js +20 -13
- package/dist/cjs/context/FilterContext.js +9 -7
- package/dist/cjs/context/SettingsContext.js +11 -9
- package/dist/cjs/context/ZarrDataContext.js +6 -5
- package/dist/cjs/utils/Histogram.js +35 -33
- package/dist/cjs/utils/ImageViewer.js +9 -6
- package/dist/cjs/utils/Legend.js +36 -29
- package/dist/cjs/utils/LoadingIndicators.js +14 -12
- package/dist/cjs/utils/Skeleton.js +10 -10
- package/dist/cjs/utils/StyledTooltip.js +7 -2
- package/dist/cjs/utils/VirtualizedList.js +32 -25
- package/dist/cjs/utils/errors.js +1 -1
- package/dist/css/cherita.css +6 -1
- package/dist/css/cherita.css.map +1 -1
- package/dist/esm/components/controls/Controls.js +38 -30
- package/dist/esm/components/dotplot/Dotplot.js +40 -33
- package/dist/esm/components/dotplot/DotplotControls.js +103 -82
- package/dist/esm/components/full-page/FullPage.js +92 -69
- package/dist/esm/components/full-page/PlotAlert.js +25 -16
- package/dist/esm/components/full-page/PlotTypeSelector.js +43 -36
- package/dist/esm/components/heatmap/Heatmap.js +40 -33
- package/dist/esm/components/heatmap/HeatmapControls.js +6 -2
- package/dist/esm/components/icons/DotPlotIcon.js +16 -10
- package/dist/esm/components/icons/HeatmapIcon.js +17 -11
- package/dist/esm/components/icons/MatrixPlotIcon.1.js +22 -16
- package/dist/esm/components/icons/MatrixPlotIcon.js +22 -16
- package/dist/esm/components/icons/ScatterplotIcon.1.js +21 -15
- package/dist/esm/components/icons/ScatterplotIcon.js +21 -15
- package/dist/esm/components/icons/ViolinPlotIcon.js +22 -14
- package/dist/esm/components/matrixplot/Matrixplot.js +40 -33
- package/dist/esm/components/matrixplot/MatrixplotControls.js +8 -4
- package/dist/esm/components/obs-list/ObsItem.js +237 -186
- package/dist/esm/components/obs-list/ObsList.js +106 -86
- package/dist/esm/components/obs-list/ObsToolbar.js +2 -2
- package/dist/esm/components/obsm-list/ObsmList.js +47 -31
- package/dist/esm/components/offcanvas/index.js +61 -31
- package/dist/esm/components/pseudospatial/Pseudospatial.js +46 -36
- package/dist/esm/components/pseudospatial/PseudospatialToolbar.js +98 -68
- package/dist/esm/components/scatterplot/Scatterplot.js +87 -64
- package/dist/esm/components/scatterplot/ScatterplotControls.js +35 -26
- package/dist/esm/components/scatterplot/SpatialControls.js +134 -106
- package/dist/esm/components/scatterplot/Toolbox.js +41 -29
- package/dist/esm/components/search-bar/SearchBar.js +157 -109
- package/dist/esm/components/search-bar/SearchInfo.js +73 -46
- package/dist/esm/components/search-bar/SearchResults.js +93 -70
- package/dist/esm/components/toolbar/Toolbar.js +43 -33
- package/dist/esm/components/var-list/VarItem.js +106 -78
- package/dist/esm/components/var-list/VarList.js +67 -52
- package/dist/esm/components/var-list/VarListToolbar.js +56 -50
- package/dist/esm/components/var-list/VarSet.js +115 -96
- package/dist/esm/components/violin/Violin.js +77 -58
- package/dist/esm/components/violin/ViolinControls.js +8 -4
- package/dist/esm/context/DatasetContext.js +20 -12
- package/dist/esm/context/FilterContext.js +9 -6
- package/dist/esm/context/SettingsContext.js +11 -8
- package/dist/esm/context/ZarrDataContext.js +6 -4
- package/dist/esm/utils/Histogram.js +35 -33
- package/dist/esm/utils/ImageViewer.js +9 -5
- package/dist/esm/utils/Legend.js +36 -28
- package/dist/esm/utils/LoadingIndicators.js +14 -11
- package/dist/esm/utils/Skeleton.js +10 -9
- package/dist/esm/utils/StyledTooltip.js +7 -2
- package/dist/esm/utils/VirtualizedList.js +32 -24
- package/dist/esm/utils/errors.js +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState } from "react";
|
|
2
2
|
import { faChevronDown, faChevronUp, faCircleInfo, faDroplet, faPlus, faTrash } from "@fortawesome/free-solid-svg-icons";
|
|
3
3
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
4
4
|
import _ from "lodash";
|
|
@@ -9,7 +9,7 @@ import { useSettings, useSettingsDispatch } from "../../context/SettingsContext"
|
|
|
9
9
|
import { SearchModal } from "../search-bar/SearchBar";
|
|
10
10
|
|
|
11
11
|
// @TODO: add button to score genes and plot
|
|
12
|
-
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
const addVarToSet = (dispatch, set, v) => {
|
|
14
14
|
dispatch({
|
|
15
15
|
type: "add.varSet.var",
|
|
@@ -30,98 +30,117 @@ function SelectionSet(_ref) {
|
|
|
30
30
|
const [showModal, setShowModal] = useState(false);
|
|
31
31
|
const [searchText, setSearchText] = useState("");
|
|
32
32
|
const varList = set.vars.length ? _.map(set.vars, v => {
|
|
33
|
-
return /*#__PURE__*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
})
|
|
40
|
-
}) : /*#__PURE__*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
33
|
+
return /*#__PURE__*/_jsx(ListGroup.Item, {
|
|
34
|
+
children: /*#__PURE__*/_jsx(SelectionItem, {
|
|
35
|
+
item: v,
|
|
36
|
+
showSetColorEncoding: false,
|
|
37
|
+
removeVar: () => removeSetVar(v)
|
|
38
|
+
})
|
|
39
|
+
}, v.name);
|
|
40
|
+
}) : /*#__PURE__*/_jsx(ListGroup.Item, {
|
|
41
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
42
|
+
className: "text-muted",
|
|
43
|
+
children: "No features in this set"
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
47
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
48
|
+
className: "d-flex justify-content-between cursor-pointer",
|
|
49
|
+
onClick: () => {
|
|
50
|
+
setOpenSet(o => !o);
|
|
51
|
+
},
|
|
52
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
53
|
+
className: "d-flex justify-content-between align-items-center w-100",
|
|
54
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
55
|
+
className: "ellipsis-text",
|
|
56
|
+
title: set.name,
|
|
57
|
+
children: set.name
|
|
58
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
59
|
+
className: "d-flex align-items-center gap-1",
|
|
60
|
+
children: [/*#__PURE__*/_jsx(OverlayTrigger, {
|
|
61
|
+
placement: "top",
|
|
62
|
+
overlay: /*#__PURE__*/_jsx(Tooltip, {
|
|
63
|
+
children: "This set represents the mean value of its features"
|
|
64
|
+
}),
|
|
65
|
+
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
66
|
+
icon: faCircleInfo
|
|
67
|
+
})
|
|
68
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
69
|
+
type: "button",
|
|
70
|
+
variant: "outline-primary",
|
|
71
|
+
className: "m-0 p-0 px-1",
|
|
72
|
+
disabled: !set.vars.length,
|
|
73
|
+
title: "Open set",
|
|
74
|
+
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
75
|
+
icon: openSet ? faChevronUp : faChevronDown
|
|
76
|
+
})
|
|
77
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
78
|
+
type: "button",
|
|
79
|
+
variant: "outline-primary",
|
|
80
|
+
className: "m-0 p-0 px-1",
|
|
81
|
+
onClick: e => {
|
|
82
|
+
e.stopPropagation();
|
|
83
|
+
setShowModal(true);
|
|
84
|
+
},
|
|
85
|
+
title: "Add to set",
|
|
86
|
+
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
87
|
+
icon: faPlus
|
|
88
|
+
})
|
|
89
|
+
}), /*#__PURE__*/_jsxs(Button, {
|
|
90
|
+
type: "button",
|
|
91
|
+
variant: isActive ? "primary" : "outline-primary",
|
|
92
|
+
className: "m-0 p-0 px-1",
|
|
93
|
+
onClick: e => {
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
selectSet();
|
|
96
|
+
},
|
|
97
|
+
disabled: !set.vars.length,
|
|
98
|
+
title: "Set as color encoding",
|
|
99
|
+
children: [/*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
100
|
+
icon: faDroplet
|
|
101
|
+
}), isMultiple && /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
102
|
+
icon: faPlus,
|
|
103
|
+
size: "xs",
|
|
104
|
+
className: "ps-xs-1"
|
|
105
|
+
})]
|
|
106
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
107
|
+
type: "button",
|
|
108
|
+
className: "m-0 p-0 px-1",
|
|
109
|
+
variant: "outline-secondary",
|
|
110
|
+
title: "Remove from list",
|
|
111
|
+
onClick: e => {
|
|
112
|
+
e.stopPropagation();
|
|
113
|
+
removeSet();
|
|
114
|
+
},
|
|
115
|
+
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
116
|
+
icon: faTrash
|
|
117
|
+
})
|
|
118
|
+
})]
|
|
119
|
+
})]
|
|
120
|
+
})
|
|
121
|
+
}), /*#__PURE__*/_jsx(Collapse, {
|
|
122
|
+
in: openSet,
|
|
123
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
124
|
+
className: "mt-2",
|
|
125
|
+
children: /*#__PURE__*/_jsx(ListGroup, {
|
|
126
|
+
variant: "flush",
|
|
127
|
+
className: "cherita-list var-set-list",
|
|
128
|
+
children: varList
|
|
129
|
+
})
|
|
130
|
+
})
|
|
131
|
+
}), /*#__PURE__*/_jsx(SearchModal, {
|
|
132
|
+
show: showModal,
|
|
133
|
+
handleClose: () => setShowModal(false),
|
|
134
|
+
text: searchText,
|
|
135
|
+
setText: setSearchText,
|
|
136
|
+
displayText: "features",
|
|
137
|
+
handleSelect: (d, i) => {
|
|
138
|
+
addVarToSet(d, set, i);
|
|
139
|
+
},
|
|
140
|
+
searchVar: true,
|
|
141
|
+
searchDiseases: false
|
|
142
|
+
})]
|
|
143
|
+
});
|
|
125
144
|
}
|
|
126
145
|
export function VarSet(_ref2) {
|
|
127
146
|
let {
|
|
@@ -182,7 +201,7 @@ export function VarSet(_ref2) {
|
|
|
182
201
|
});
|
|
183
202
|
};
|
|
184
203
|
if (set && mode === SELECTION_MODES.SINGLE) {
|
|
185
|
-
return /*#__PURE__*/
|
|
204
|
+
return /*#__PURE__*/_jsx(SelectionSet, {
|
|
186
205
|
set: set,
|
|
187
206
|
isActive: settings.colorEncoding === COLOR_ENCODINGS.VAR && active === set.name,
|
|
188
207
|
selectSet: selectSet,
|
|
@@ -190,7 +209,7 @@ export function VarSet(_ref2) {
|
|
|
190
209
|
removeSetVar: v => removeSetVar(v)
|
|
191
210
|
});
|
|
192
211
|
} else if (mode === SELECTION_MODES.MULTIPLE) {
|
|
193
|
-
return /*#__PURE__*/
|
|
212
|
+
return /*#__PURE__*/_jsx(SelectionSet, {
|
|
194
213
|
set: set,
|
|
195
214
|
isActive: _.includes(active, set.name),
|
|
196
215
|
selectSet: toggleSet,
|
|
@@ -19,6 +19,7 @@ import { useSelectedMultiVar, useSelectedObs, useSelectedVar } from "../../utils
|
|
|
19
19
|
import { StyledTooltip } from "../../utils/StyledTooltip";
|
|
20
20
|
import { PlotAlert } from "../full-page/PlotAlert";
|
|
21
21
|
import { ControlsPlotlyToolbar, ObsPlotlyToolbar, VarPlotlyToolbar } from "../toolbar/Toolbar";
|
|
22
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
23
|
export function Violin(_ref) {
|
|
23
24
|
let {
|
|
24
25
|
mode = VIOLIN_MODES.MULTIKEY,
|
|
@@ -134,69 +135,87 @@ export function Violin(_ref) {
|
|
|
134
135
|
const modeBarButtons = customModeBarButtons.length ? [customModeBarButtons, PLOTLY_MODEBAR_BUTTONS] : [PLOTLY_MODEBAR_BUTTONS];
|
|
135
136
|
if (!serverError) {
|
|
136
137
|
if (hasSelections) {
|
|
137
|
-
return /*#__PURE__*/
|
|
138
|
-
className: "cherita-plot cherita-violin"
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
138
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
139
|
+
className: "cherita-plot cherita-violin",
|
|
140
|
+
children: [isPending && /*#__PURE__*/_jsx(LoadingSpinner, {}), /*#__PURE__*/_jsxs("div", {
|
|
141
|
+
className: "d-flex flex-column h-100",
|
|
142
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
143
|
+
className: "flex-grow-1 position-relative",
|
|
144
|
+
style: {
|
|
145
|
+
minHeight: "0"
|
|
146
|
+
},
|
|
147
|
+
children: /*#__PURE__*/_jsx(Plot, {
|
|
148
|
+
data: data,
|
|
149
|
+
layout: layout,
|
|
150
|
+
useResizeHandler: true,
|
|
151
|
+
style: {
|
|
152
|
+
width: "100%",
|
|
153
|
+
height: "100%"
|
|
154
|
+
},
|
|
155
|
+
config: {
|
|
156
|
+
displaylogo: false,
|
|
157
|
+
modeBarButtons: modeBarButtons
|
|
158
|
+
}
|
|
159
|
+
})
|
|
160
|
+
}), (fetchedData === null || fetchedData === void 0 ? void 0 : fetchedData.resampled) && /*#__PURE__*/_jsx("div", {
|
|
161
|
+
className: "resampled-tooltip-container",
|
|
162
|
+
children: /*#__PURE__*/_jsx(StyledTooltip, {
|
|
163
|
+
title: /*#__PURE__*/_jsxs(_Fragment, {
|
|
164
|
+
children: [/*#__PURE__*/_jsx("strong", {
|
|
165
|
+
children: "Note:"
|
|
166
|
+
}), " This plot uses resampled data to improve performance, so values may differ slightly from the full dataset. The data were resampled to exactly 100,000 values using a Monte Carlo\u2013style approach to provide a representative view of the full distribution while reducing processing time."]
|
|
167
|
+
}),
|
|
168
|
+
placement: "bottom",
|
|
169
|
+
children: /*#__PURE__*/_jsxs(Badge, {
|
|
170
|
+
bg: "info",
|
|
171
|
+
children: [/*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
172
|
+
className: "fs-6",
|
|
173
|
+
icon: faCircleInfo
|
|
174
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
175
|
+
className: "d-none d-lg-inline ms-2 fs-6 text-uppercase",
|
|
176
|
+
children: "Resampled"
|
|
177
|
+
})]
|
|
178
|
+
})
|
|
179
|
+
})
|
|
180
|
+
})]
|
|
181
|
+
})]
|
|
182
|
+
});
|
|
171
183
|
}
|
|
172
|
-
return /*#__PURE__*/
|
|
184
|
+
return /*#__PURE__*/_jsxs(PlotAlert, {
|
|
173
185
|
variant: "info",
|
|
174
|
-
heading: "
|
|
186
|
+
heading: "Set up your violin plot",
|
|
175
187
|
plotType: plotType,
|
|
176
|
-
setPlotType: setPlotType
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
188
|
+
setPlotType: setPlotType,
|
|
189
|
+
children: [mode === VIOLIN_MODES.MULTIKEY && /*#__PURE__*/_jsxs("p", {
|
|
190
|
+
className: "p-0 m-0",
|
|
191
|
+
children: ["Select one or more", " ", showVarsBtn ? /*#__PURE__*/_jsx(Button, {
|
|
192
|
+
variant: "link",
|
|
193
|
+
className: "border-0 p-0 align-baseline",
|
|
194
|
+
onClick: setShowVars,
|
|
195
|
+
children: "features"
|
|
196
|
+
}) : "features", " ", "to display their expression distributions across all observations."]
|
|
197
|
+
}), mode === VIOLIN_MODES.GROUPBY && /*#__PURE__*/_jsxs("p", {
|
|
198
|
+
className: "p-0 m-0",
|
|
199
|
+
children: ["Select a", " ", showObsBtn ? /*#__PURE__*/_jsx(Button, {
|
|
200
|
+
variant: "link",
|
|
201
|
+
className: "border-0 p-0 align-baseline",
|
|
202
|
+
onClick: setShowObs,
|
|
203
|
+
children: "category"
|
|
204
|
+
}) : "category", " ", "to group observations, and choose a", " ", showVarsBtn ? /*#__PURE__*/_jsx(Button, {
|
|
205
|
+
variant: "link",
|
|
206
|
+
className: "border-0 p-0 align-baseline",
|
|
207
|
+
onClick: setShowVars,
|
|
208
|
+
children: "feature"
|
|
209
|
+
}) : "feature", " ", "to view its distribution within each group."]
|
|
210
|
+
})]
|
|
211
|
+
});
|
|
194
212
|
} else {
|
|
195
|
-
return /*#__PURE__*/
|
|
213
|
+
return /*#__PURE__*/_jsx(PlotAlert, {
|
|
196
214
|
variant: "danger",
|
|
197
|
-
heading: "
|
|
215
|
+
heading: "Error displaying the violin plot",
|
|
198
216
|
plotType: plotType,
|
|
199
|
-
setPlotType: setPlotType
|
|
200
|
-
|
|
217
|
+
setPlotType: setPlotType,
|
|
218
|
+
children: serverError.message || "An unexpected error occurred while generating the plot."
|
|
219
|
+
});
|
|
201
220
|
}
|
|
202
221
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Form } from "react-bootstrap";
|
|
3
2
|
import { ScaleSelect } from "../controls/Controls";
|
|
3
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
4
|
export function ViolinControls() {
|
|
5
|
-
return /*#__PURE__*/
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
6
|
+
children: /*#__PURE__*/_jsx(Form, {
|
|
7
|
+
children: /*#__PURE__*/_jsx(ScaleSelect, {
|
|
8
|
+
plot: "violinplot"
|
|
9
|
+
})
|
|
10
|
+
})
|
|
11
|
+
});
|
|
8
12
|
}
|
|
@@ -6,7 +6,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
6
|
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); }
|
|
7
7
|
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; }
|
|
8
8
|
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; }
|
|
9
|
-
import
|
|
9
|
+
import { createContext, useContext } from "react";
|
|
10
10
|
import { createSyncStoragePersister } from "@tanstack/query-sync-storage-persister";
|
|
11
11
|
import { QueryClient, QueryCache } from "@tanstack/react-query";
|
|
12
12
|
import { PersistQueryClientProvider } from "@tanstack/react-query-persist-client";
|
|
@@ -14,6 +14,7 @@ import _ from "lodash";
|
|
|
14
14
|
import { FilterProvider } from "./FilterContext";
|
|
15
15
|
import { SettingsProvider } from "./SettingsContext";
|
|
16
16
|
import { ZarrDataProvider } from "./ZarrDataContext";
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
18
|
export const DatasetContext = /*#__PURE__*/createContext(null);
|
|
18
19
|
const queryClient = new QueryClient({
|
|
19
20
|
defaultOptions: {
|
|
@@ -50,7 +51,7 @@ const persistOptions = {
|
|
|
50
51
|
return false;
|
|
51
52
|
}
|
|
52
53
|
},
|
|
53
|
-
buster: "1.4.1-dev.2025-10-
|
|
54
|
+
buster: "1.4.1-dev.2025-10-23.3179e534" || "0.0.0"
|
|
54
55
|
// @TODO: add maxAge and api version numbers as buster
|
|
55
56
|
};
|
|
56
57
|
const initialDataset = {
|
|
@@ -73,16 +74,23 @@ export function DatasetProvider(_ref2) {
|
|
|
73
74
|
const dataset = _.assign(initialDataset, _objectSpread({
|
|
74
75
|
url: dataset_url
|
|
75
76
|
}, dataset_params));
|
|
76
|
-
return /*#__PURE__*/
|
|
77
|
-
value: dataset
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
return /*#__PURE__*/_jsx(DatasetContext.Provider, {
|
|
78
|
+
value: dataset,
|
|
79
|
+
children: /*#__PURE__*/_jsx(PersistQueryClientProvider, {
|
|
80
|
+
client: queryClient,
|
|
81
|
+
persistOptions: persistOptions,
|
|
82
|
+
children: /*#__PURE__*/_jsx(SettingsProvider, {
|
|
83
|
+
dataset_url: dataset.url,
|
|
84
|
+
defaultSettings: dataset.defaultSettings,
|
|
85
|
+
canOverrideSettings: dataset.canOverrideSettings,
|
|
86
|
+
children: /*#__PURE__*/_jsx(FilterProvider, {
|
|
87
|
+
children: /*#__PURE__*/_jsx(ZarrDataProvider, {
|
|
88
|
+
children: children
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
})
|
|
93
|
+
});
|
|
86
94
|
}
|
|
87
95
|
export function useDataset() {
|
|
88
96
|
return useContext(DatasetContext);
|
|
@@ -3,7 +3,8 @@ 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
|
|
6
|
+
import { useReducer, createContext, useContext } from "react";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
export const FilteredDataContext = /*#__PURE__*/createContext(null);
|
|
8
9
|
export const FilteredDataDispatchContext = /*#__PURE__*/createContext(null);
|
|
9
10
|
const initialFilterData = {
|
|
@@ -18,11 +19,13 @@ export function FilterProvider(_ref) {
|
|
|
18
19
|
children
|
|
19
20
|
} = _ref;
|
|
20
21
|
const [filteredData, dispatch] = useReducer(filterReducer, _objectSpread({}, initialFilterData));
|
|
21
|
-
return /*#__PURE__*/
|
|
22
|
-
value: filteredData
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
return /*#__PURE__*/_jsx(FilteredDataContext.Provider, {
|
|
23
|
+
value: filteredData,
|
|
24
|
+
children: /*#__PURE__*/_jsx(FilteredDataDispatchContext.Provider, {
|
|
25
|
+
value: dispatch,
|
|
26
|
+
children: children
|
|
27
|
+
})
|
|
28
|
+
});
|
|
26
29
|
}
|
|
27
30
|
export function useFilteredData() {
|
|
28
31
|
return useContext(FilteredDataContext);
|
|
@@ -6,10 +6,11 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
6
|
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); }
|
|
7
7
|
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; }
|
|
8
8
|
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; }
|
|
9
|
-
import
|
|
9
|
+
import { createContext, useContext, useEffect, useReducer, useRef } from "react";
|
|
10
10
|
import _ from "lodash";
|
|
11
11
|
import { COLOR_ENCODINGS, DOTPLOT_SCALES, LOCAL_STORAGE_KEY, MATRIXPLOT_SCALES, OBS_TYPES, PSEUDOSPATIAL_CATEGORICAL_MODES, VAR_SORT, VAR_SORT_ORDER, VIOLINPLOT_SCALES } from "../constants/constants";
|
|
12
12
|
import { useResolver } from "../utils/Resolver";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
export const SettingsContext = /*#__PURE__*/createContext(null);
|
|
14
15
|
export const SettingsDispatchContext = /*#__PURE__*/createContext(null);
|
|
15
16
|
const initialSettings = {
|
|
@@ -162,7 +163,7 @@ export function SettingsProvider(_ref2) {
|
|
|
162
163
|
|
|
163
164
|
// If the buster is not set or does not match the current package version,
|
|
164
165
|
// reset localSettings to avoid stale data
|
|
165
|
-
if (!buster || buster !== "1.4.1-dev.2025-10-
|
|
166
|
+
if (!buster || buster !== "1.4.1-dev.2025-10-23.3179e534") {
|
|
166
167
|
localSettings = {};
|
|
167
168
|
}
|
|
168
169
|
const initSettings = useRef(initializer({
|
|
@@ -187,7 +188,7 @@ export function SettingsProvider(_ref2) {
|
|
|
187
188
|
if (canOverrideSettings && settings) {
|
|
188
189
|
try {
|
|
189
190
|
localStorage.setItem(DATASET_STORAGE_KEY, JSON.stringify(_objectSpread({
|
|
190
|
-
buster: "1.4.1-dev.2025-10-
|
|
191
|
+
buster: "1.4.1-dev.2025-10-23.3179e534" || "0.0.0",
|
|
191
192
|
timestamp: Date.now()
|
|
192
193
|
}, _.omit(settings, "data"))));
|
|
193
194
|
} catch (err) {
|
|
@@ -199,11 +200,13 @@ export function SettingsProvider(_ref2) {
|
|
|
199
200
|
}
|
|
200
201
|
}
|
|
201
202
|
}, [DATASET_STORAGE_KEY, canOverrideSettings, settings]);
|
|
202
|
-
return /*#__PURE__*/
|
|
203
|
-
value: settings
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
203
|
+
return /*#__PURE__*/_jsx(SettingsContext.Provider, {
|
|
204
|
+
value: settings,
|
|
205
|
+
children: /*#__PURE__*/_jsx(SettingsDispatchContext.Provider, {
|
|
206
|
+
value: dispatch,
|
|
207
|
+
children: settings && children
|
|
208
|
+
})
|
|
209
|
+
});
|
|
207
210
|
}
|
|
208
211
|
export function useSettings() {
|
|
209
212
|
return useContext(SettingsContext);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
2
|
import { useFilter } from "../utils/Filter";
|
|
3
3
|
import { useObsData, useObsmData, useXData } from "../utils/zarrData";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
const ZarrDataContext = /*#__PURE__*/createContext(null);
|
|
5
6
|
export function ZarrDataProvider(_ref) {
|
|
6
7
|
let {
|
|
@@ -17,9 +18,10 @@ export function ZarrDataProvider(_ref) {
|
|
|
17
18
|
serverError: obsmData.serverError || obsData.serverError || xData.serverError
|
|
18
19
|
};
|
|
19
20
|
useFilter(data);
|
|
20
|
-
return /*#__PURE__*/
|
|
21
|
-
value: data
|
|
22
|
-
|
|
21
|
+
return /*#__PURE__*/_jsx(ZarrDataContext.Provider, {
|
|
22
|
+
value: data,
|
|
23
|
+
children: children
|
|
24
|
+
});
|
|
23
25
|
}
|
|
24
26
|
export function useZarrData() {
|
|
25
27
|
return useContext(ZarrDataContext);
|