@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
|
@@ -3,30 +3,30 @@ 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, useDeferredValue, useEffect, useMemo, useRef, useState } from
|
|
7
|
-
import { ScatterplotLayer } from
|
|
8
|
-
import { DeckGL } from
|
|
9
|
-
import { faTriangleExclamation } from
|
|
10
|
-
import { FontAwesomeIcon } from
|
|
11
|
-
import { ViewMode } from
|
|
12
|
-
import { EditableGeoJsonLayer } from
|
|
13
|
-
import _ from
|
|
14
|
-
import { Alert } from
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
6
|
+
import { useCallback, useDeferredValue, useEffect, useMemo, useRef, useState } from 'react';
|
|
7
|
+
import { ScatterplotLayer } from '@deck.gl/layers';
|
|
8
|
+
import { DeckGL } from '@deck.gl/react';
|
|
9
|
+
import { faTriangleExclamation } from '@fortawesome/free-solid-svg-icons';
|
|
10
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
11
|
+
import { ViewMode } from '@nebula.gl/edit-modes';
|
|
12
|
+
import { EditableGeoJsonLayer } from '@nebula.gl/layers';
|
|
13
|
+
import _ from 'lodash';
|
|
14
|
+
import { Alert } from 'react-bootstrap';
|
|
15
|
+
import { SpatialControls } from './SpatialControls';
|
|
16
|
+
import { Toolbox } from './Toolbox';
|
|
17
|
+
import { COLOR_ENCODINGS, OBS_TYPES, SELECTED_POLYGON_FILLCOLOR, UNSELECTED_POLYGON_FILLCOLOR } from '../../constants/constants';
|
|
18
|
+
import { useDataset } from '../../context/DatasetContext';
|
|
19
|
+
import { useFilteredData } from '../../context/FilterContext';
|
|
20
|
+
import { useSettings, useSettingsDispatch } from '../../context/SettingsContext';
|
|
21
|
+
import { useZarrData } from '../../context/ZarrDataContext';
|
|
22
|
+
import { rgbToHex, useColor } from '../../helpers/color-helper';
|
|
23
|
+
import { MapHelper } from '../../helpers/map-helper';
|
|
24
|
+
import { Legend } from '../../utils/Legend';
|
|
25
|
+
import { LoadingLinear, LoadingSpinner } from '../../utils/LoadingIndicators';
|
|
26
|
+
import { useSelectedObs } from '../../utils/Resolver';
|
|
27
|
+
import { formatNumerical } from '../../utils/string';
|
|
28
|
+
import { useLabelObsData } from '../../utils/zarrData';
|
|
29
|
+
import { PlotAlert } from '../full-page/PlotAlert';
|
|
30
30
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
31
31
|
window.deck.log.level = 1;
|
|
32
32
|
const INITIAL_VIEW_STATE = {
|
|
@@ -78,7 +78,7 @@ export function Scatterplot(_ref) {
|
|
|
78
78
|
// EditableGeoJsonLayer
|
|
79
79
|
const [mode, setMode] = useState(() => ViewMode);
|
|
80
80
|
const [features, setFeatures] = useState({
|
|
81
|
-
type:
|
|
81
|
+
type: 'FeatureCollection',
|
|
82
82
|
features: settings.polygons[settings.selectedObsm] || []
|
|
83
83
|
});
|
|
84
84
|
const [selectedFeatureIndexes, setSelectedFeatureIndexes] = useState([]);
|
|
@@ -125,7 +125,7 @@ export function Scatterplot(_ref) {
|
|
|
125
125
|
}
|
|
126
126
|
if (!obsmData.serverError && obsmData.data) {
|
|
127
127
|
if (obsmData.data[0].length !== 2) {
|
|
128
|
-
setCoordsError(
|
|
128
|
+
setCoordsError('Invalid coordinates. Expected 2D coordinates');
|
|
129
129
|
return {
|
|
130
130
|
positions: [],
|
|
131
131
|
values: []
|
|
@@ -253,7 +253,7 @@ export function Scatterplot(_ref) {
|
|
|
253
253
|
}, [sortedObsIndices]);
|
|
254
254
|
const memoizedLayers = useMemo(() => {
|
|
255
255
|
return [new ScatterplotLayer({
|
|
256
|
-
id:
|
|
256
|
+
id: 'cherita-layer-scatterplot',
|
|
257
257
|
pickable: true,
|
|
258
258
|
data: sortedData.positions,
|
|
259
259
|
radiusScale: radiusScale,
|
|
@@ -266,7 +266,7 @@ export function Scatterplot(_ref) {
|
|
|
266
266
|
getRadius: getRadius
|
|
267
267
|
}
|
|
268
268
|
}), new EditableGeoJsonLayer({
|
|
269
|
-
id:
|
|
269
|
+
id: 'cherita-layer-draw',
|
|
270
270
|
data: features,
|
|
271
271
|
mode: mode,
|
|
272
272
|
selectedFeatureIndexes,
|
|
@@ -278,7 +278,7 @@ export function Scatterplot(_ref) {
|
|
|
278
278
|
} = _ref4;
|
|
279
279
|
setFeatures(updatedData);
|
|
280
280
|
let updatedSelectedFeatureIndexes = selectedFeatureIndexes;
|
|
281
|
-
if (editType ===
|
|
281
|
+
if (editType === 'addFeature') {
|
|
282
282
|
const {
|
|
283
283
|
featureIndexes
|
|
284
284
|
} = editContext;
|
|
@@ -306,13 +306,13 @@ export function Scatterplot(_ref) {
|
|
|
306
306
|
var _features$features;
|
|
307
307
|
if (!(features !== null && features !== void 0 && (_features$features = features.features) !== null && _features$features !== void 0 && _features$features.length)) {
|
|
308
308
|
dispatch({
|
|
309
|
-
type:
|
|
309
|
+
type: 'disable.slice.polygons'
|
|
310
310
|
});
|
|
311
311
|
}
|
|
312
312
|
}, [dispatch, features === null || features === void 0 || (_features$features2 = features.features) === null || _features$features2 === void 0 ? void 0 : _features$features2.length]);
|
|
313
313
|
useEffect(() => {
|
|
314
314
|
dispatch({
|
|
315
|
-
type:
|
|
315
|
+
type: 'set.polygons',
|
|
316
316
|
obsm: settings.selectedObsm,
|
|
317
317
|
polygons: (features === null || features === void 0 ? void 0 : features.features) || []
|
|
318
318
|
});
|
|
@@ -322,7 +322,7 @@ export function Scatterplot(_ref) {
|
|
|
322
322
|
// don't change selection while editing
|
|
323
323
|
return;
|
|
324
324
|
}
|
|
325
|
-
setSelectedFeatureIndexes(f => info.object ? info.layer.id ===
|
|
325
|
+
setSelectedFeatureIndexes(f => info.object ? info.layer.id === 'cherita-layer-draw' ? [info.index] : f : []);
|
|
326
326
|
}
|
|
327
327
|
const getLabel = function (o, v) {
|
|
328
328
|
let isVar = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
@@ -337,7 +337,7 @@ export function Scatterplot(_ref) {
|
|
|
337
337
|
object,
|
|
338
338
|
index
|
|
339
339
|
} = _ref5;
|
|
340
|
-
if (!object || (object === null || object === void 0 ? void 0 : object.type) ===
|
|
340
|
+
if (!object || (object === null || object === void 0 ? void 0 : object.type) === 'Feature') return;
|
|
341
341
|
const text = [];
|
|
342
342
|
if (settings.colorEncoding === COLOR_ENCODINGS.OBS && selectedObs && !_.includes(settings.labelObs, selectedObs.name)) {
|
|
343
343
|
var _data$values;
|
|
@@ -356,14 +356,14 @@ export function Scatterplot(_ref) {
|
|
|
356
356
|
if (!text.length) return;
|
|
357
357
|
const grayOut = sortedObsIndices && !sortedObsIndices.has(index);
|
|
358
358
|
return {
|
|
359
|
-
text: text.length ? _.compact(text).join(
|
|
360
|
-
className: grayOut ?
|
|
359
|
+
text: text.length ? _.compact(text).join('\n') : null,
|
|
360
|
+
className: grayOut ? 'tooltip-grayout' : 'deck-tooltip',
|
|
361
361
|
style: !grayOut ? {
|
|
362
|
-
|
|
362
|
+
'border-left': "3px solid ".concat(rgbToHex(getFillColor(null, {
|
|
363
363
|
index
|
|
364
364
|
})))
|
|
365
365
|
} : {
|
|
366
|
-
|
|
366
|
+
'border-left': 'none'
|
|
367
367
|
}
|
|
368
368
|
};
|
|
369
369
|
};
|
|
@@ -400,7 +400,7 @@ export function Scatterplot(_ref) {
|
|
|
400
400
|
let {
|
|
401
401
|
isDragging
|
|
402
402
|
} = _ref6;
|
|
403
|
-
return mode !== ViewMode ?
|
|
403
|
+
return mode !== ViewMode ? 'crosshair' : isDragging ? 'grabbing' : 'grab';
|
|
404
404
|
},
|
|
405
405
|
ref: deckRef
|
|
406
406
|
}), /*#__PURE__*/_jsx(SpatialControls, {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useState, useEffect } from
|
|
2
|
-
import { Box, Slider, Typography } from
|
|
3
|
-
import { Form } from
|
|
4
|
-
import { COLOR_ENCODINGS, OBS_TYPES } from
|
|
5
|
-
import { useFilteredData } from
|
|
6
|
-
import { useSettings, useSettingsDispatch } from
|
|
7
|
-
import { useSelectedObs } from
|
|
8
|
-
import { ColorscaleSelect } from
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { Box, Slider, Typography } from '@mui/material';
|
|
3
|
+
import { Form } from 'react-bootstrap';
|
|
4
|
+
import { COLOR_ENCODINGS, OBS_TYPES } from '../../constants/constants';
|
|
5
|
+
import { useFilteredData } from '../../context/FilterContext';
|
|
6
|
+
import { useSettings, useSettingsDispatch } from '../../context/SettingsContext';
|
|
7
|
+
import { useSelectedObs } from '../../utils/Resolver';
|
|
8
|
+
import { ColorscaleSelect } from '../controls/Controls';
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
10
|
export const ScatterplotControls = () => {
|
|
11
11
|
const settings = useSettings();
|
|
@@ -33,7 +33,7 @@ export const ScatterplotControls = () => {
|
|
|
33
33
|
const updateRange = (_e, value) => {
|
|
34
34
|
setSliderValue(value);
|
|
35
35
|
dispatch({
|
|
36
|
-
type:
|
|
36
|
+
type: 'set.controls.range',
|
|
37
37
|
range: sliderValue
|
|
38
38
|
});
|
|
39
39
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { useState } from
|
|
2
|
-
import { faCrosshairs, faDrawPolygon, faHand, faList, faMinus, faPen, faPlus, faSearch, faSliders, faTrash } from
|
|
3
|
-
import { FontAwesomeIcon } from
|
|
4
|
-
import { JoinInner } from
|
|
5
|
-
import useMediaQuery from
|
|
6
|
-
import { DrawLineStringMode, DrawPolygonByDraggingMode, DrawPolygonMode, DrawRectangleMode, ModifyMode, ViewMode } from
|
|
7
|
-
import { OverlayTrigger, Tooltip } from
|
|
8
|
-
import Button from
|
|
9
|
-
import ButtonGroup from
|
|
10
|
-
import Dropdown from
|
|
11
|
-
import { OffcanvasControls } from
|
|
12
|
-
import { ScatterplotControls } from
|
|
13
|
-
import { BREAKPOINTS } from
|
|
14
|
-
import { useSettings, useSettingsDispatch } from
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { faCrosshairs, faDrawPolygon, faHand, faList, faMinus, faPen, faPlus, faSearch, faSliders, faTrash } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
+
import { JoinInner } from '@mui/icons-material';
|
|
5
|
+
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
6
|
+
import { DrawLineStringMode, DrawPolygonByDraggingMode, DrawPolygonMode, DrawRectangleMode, ModifyMode, ViewMode } from '@nebula.gl/edit-modes';
|
|
7
|
+
import { OverlayTrigger, Tooltip } from 'react-bootstrap';
|
|
8
|
+
import Button from 'react-bootstrap/Button';
|
|
9
|
+
import ButtonGroup from 'react-bootstrap/ButtonGroup';
|
|
10
|
+
import Dropdown from 'react-bootstrap/Dropdown';
|
|
11
|
+
import { OffcanvasControls } from '../offcanvas';
|
|
12
|
+
import { ScatterplotControls } from './ScatterplotControls';
|
|
13
|
+
import { BREAKPOINTS } from '../../constants/constants';
|
|
14
|
+
import { useSettings, useSettingsDispatch } from '../../context/SettingsContext';
|
|
15
15
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
export function SpatialControls(_ref) {
|
|
17
17
|
var _features$features;
|
|
@@ -39,19 +39,19 @@ export function SpatialControls(_ref) {
|
|
|
39
39
|
const showVarsBtn = isFullscreen ? XlBreakpoint : true;
|
|
40
40
|
const onSelect = (eventKey, event) => {
|
|
41
41
|
switch (eventKey) {
|
|
42
|
-
case
|
|
42
|
+
case 'DrawPolygonMode':
|
|
43
43
|
setMode(() => DrawPolygonMode);
|
|
44
44
|
break;
|
|
45
|
-
case
|
|
45
|
+
case 'DrawLineStringMode':
|
|
46
46
|
setMode(() => DrawLineStringMode);
|
|
47
47
|
break;
|
|
48
|
-
case
|
|
48
|
+
case 'DrawPolygonByDraggingMode':
|
|
49
49
|
setMode(() => DrawPolygonByDraggingMode);
|
|
50
50
|
break;
|
|
51
|
-
case
|
|
51
|
+
case 'DrawRectangleMode':
|
|
52
52
|
setMode(() => DrawRectangleMode);
|
|
53
53
|
break;
|
|
54
|
-
case
|
|
54
|
+
case 'ModifyMode':
|
|
55
55
|
setMode(() => ModifyMode);
|
|
56
56
|
break;
|
|
57
57
|
default:
|
|
@@ -60,7 +60,7 @@ export function SpatialControls(_ref) {
|
|
|
60
60
|
};
|
|
61
61
|
const deleteFeatures = (_eventKey, _event) => {
|
|
62
62
|
setFeatures({
|
|
63
|
-
type:
|
|
63
|
+
type: 'FeatureCollection',
|
|
64
64
|
features: []
|
|
65
65
|
});
|
|
66
66
|
};
|
|
@@ -71,7 +71,7 @@ export function SpatialControls(_ref) {
|
|
|
71
71
|
onClick: () => {
|
|
72
72
|
setMode(() => ViewMode);
|
|
73
73
|
dispatch({
|
|
74
|
-
type:
|
|
74
|
+
type: 'toggle.slice.polygons'
|
|
75
75
|
});
|
|
76
76
|
},
|
|
77
77
|
children: /*#__PURE__*/_jsx(JoinInner, {})
|
|
@@ -80,7 +80,7 @@ export function SpatialControls(_ref) {
|
|
|
80
80
|
onClick: () => {
|
|
81
81
|
const newFeatures = features.features.filter((_f, i) => !selectedFeatureIndexes.includes(i));
|
|
82
82
|
setFeatures({
|
|
83
|
-
type:
|
|
83
|
+
type: 'FeatureCollection',
|
|
84
84
|
features: newFeatures
|
|
85
85
|
});
|
|
86
86
|
},
|
|
@@ -157,7 +157,7 @@ export function SpatialControls(_ref) {
|
|
|
157
157
|
onSelect: onSelect,
|
|
158
158
|
children: [/*#__PURE__*/_jsx(Dropdown.Toggle, {
|
|
159
159
|
id: "dropdown-autoclose-outside",
|
|
160
|
-
className: "caret-off ".concat(mode === DrawPolygonByDraggingMode || mode === ModifyMode ?
|
|
160
|
+
className: "caret-off ".concat(mode === DrawPolygonByDraggingMode || mode === ModifyMode ? 'active' : ''),
|
|
161
161
|
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
162
162
|
icon: faDrawPolygon
|
|
163
163
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Button, ButtonGroup, OverlayTrigger, Tooltip } from
|
|
2
|
-
import { formatNumerical } from
|
|
3
|
-
import { ObsmKeysList } from
|
|
1
|
+
import { Button, ButtonGroup, OverlayTrigger, Tooltip } from 'react-bootstrap';
|
|
2
|
+
import { formatNumerical } from '../../utils/string';
|
|
3
|
+
import { ObsmKeysList } from '../obsm-list/ObsmList';
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
export function Toolbox(_ref) {
|
|
6
6
|
let {
|
|
@@ -18,16 +18,16 @@ export function Toolbox(_ref) {
|
|
|
18
18
|
placement: "top",
|
|
19
19
|
overlay: /*#__PURE__*/_jsxs(Tooltip, {
|
|
20
20
|
id: "tooltip-dropped-mode",
|
|
21
|
-
children: ["You have selected ", formatNumerical(slicedLength), " out of",
|
|
21
|
+
children: ["You have selected ", formatNumerical(slicedLength), " out of", ' ', formatNumerical(obsLength), " cells"]
|
|
22
22
|
}),
|
|
23
23
|
children: /*#__PURE__*/_jsxs(Button, {
|
|
24
24
|
size: "sm",
|
|
25
25
|
variant: "primary",
|
|
26
26
|
style: {
|
|
27
|
-
cursor:
|
|
27
|
+
cursor: 'default'
|
|
28
28
|
},
|
|
29
29
|
"aria-disabled": "true",
|
|
30
|
-
children: [formatNumerical(slicedLength), " of ", formatNumerical(obsLength),
|
|
30
|
+
children: [formatNumerical(slicedLength), " of ", formatNumerical(obsLength), ' ', "cells"]
|
|
31
31
|
})
|
|
32
32
|
}) : /*#__PURE__*/_jsx(OverlayTrigger, {
|
|
33
33
|
placement: "top",
|
|
@@ -39,7 +39,7 @@ export function Toolbox(_ref) {
|
|
|
39
39
|
size: "sm",
|
|
40
40
|
variant: "primary",
|
|
41
41
|
style: {
|
|
42
|
-
cursor:
|
|
42
|
+
cursor: 'default'
|
|
43
43
|
},
|
|
44
44
|
"aria-disabled": "true",
|
|
45
45
|
children: [formatNumerical(obsLength), " cells"]
|
|
@@ -3,38 +3,38 @@ 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 { useState } from
|
|
7
|
-
import CloseIcon from
|
|
8
|
-
import SearchIcon from
|
|
9
|
-
import _ from
|
|
10
|
-
import { Button, Form, FormGroup, InputGroup, Modal } from
|
|
11
|
-
import Col from
|
|
12
|
-
import Container from
|
|
13
|
-
import Nav from
|
|
14
|
-
import Row from
|
|
15
|
-
import Tab from
|
|
16
|
-
import { DiseaseInfo, VarInfo } from
|
|
17
|
-
import { DiseasesSearchResults, VarSearchResults } from
|
|
18
|
-
import { COLOR_ENCODINGS } from
|
|
6
|
+
import { useState } from 'react';
|
|
7
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
8
|
+
import SearchIcon from '@mui/icons-material/Search';
|
|
9
|
+
import _ from 'lodash';
|
|
10
|
+
import { Button, Form, FormGroup, InputGroup, Modal } from 'react-bootstrap';
|
|
11
|
+
import Col from 'react-bootstrap/Col';
|
|
12
|
+
import Container from 'react-bootstrap/Container';
|
|
13
|
+
import Nav from 'react-bootstrap/Nav';
|
|
14
|
+
import Row from 'react-bootstrap/Row';
|
|
15
|
+
import Tab from 'react-bootstrap/Tab';
|
|
16
|
+
import { DiseaseInfo, VarInfo } from './SearchInfo';
|
|
17
|
+
import { DiseasesSearchResults, VarSearchResults } from './SearchResults';
|
|
18
|
+
import { COLOR_ENCODINGS } from '../../constants/constants';
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
const select = (dispatch, item) => {
|
|
21
21
|
dispatch({
|
|
22
|
-
type:
|
|
22
|
+
type: 'select.var',
|
|
23
23
|
var: item
|
|
24
24
|
});
|
|
25
25
|
dispatch({
|
|
26
|
-
type:
|
|
26
|
+
type: 'select.multivar',
|
|
27
27
|
var: item
|
|
28
28
|
});
|
|
29
29
|
dispatch({
|
|
30
|
-
type:
|
|
30
|
+
type: 'set.colorEncoding',
|
|
31
31
|
value: COLOR_ENCODINGS.VAR
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
const debounceSelect = _.debounce(select, 500);
|
|
35
35
|
function onVarSelect(dispatch, item) {
|
|
36
36
|
dispatch({
|
|
37
|
-
type:
|
|
37
|
+
type: 'add.var',
|
|
38
38
|
var: item
|
|
39
39
|
});
|
|
40
40
|
debounceSelect(dispatch, item);
|
|
@@ -45,7 +45,7 @@ function addVarSet(dispatch, _ref) {
|
|
|
45
45
|
vars
|
|
46
46
|
} = _ref;
|
|
47
47
|
dispatch({
|
|
48
|
-
type:
|
|
48
|
+
type: 'add.var',
|
|
49
49
|
var: {
|
|
50
50
|
name: name,
|
|
51
51
|
vars: vars,
|
|
@@ -54,8 +54,8 @@ function addVarSet(dispatch, _ref) {
|
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
const FEATURE_TYPE = {
|
|
57
|
-
VAR:
|
|
58
|
-
DISEASE:
|
|
57
|
+
VAR: 'var',
|
|
58
|
+
DISEASE: 'disease'
|
|
59
59
|
};
|
|
60
60
|
export function SearchModal(_ref2) {
|
|
61
61
|
let {
|
|
@@ -68,7 +68,7 @@ export function SearchModal(_ref2) {
|
|
|
68
68
|
searchVar,
|
|
69
69
|
searchDiseases
|
|
70
70
|
} = _ref2;
|
|
71
|
-
const [tab, setTab] = useState(
|
|
71
|
+
const [tab, setTab] = useState('var');
|
|
72
72
|
const [selectedResult, setSelectedResult] = useState({
|
|
73
73
|
var: null,
|
|
74
74
|
disease: null
|
|
@@ -99,7 +99,7 @@ export function SearchModal(_ref2) {
|
|
|
99
99
|
}), /*#__PURE__*/_jsx(Form.Control, {
|
|
100
100
|
autoFocus: true,
|
|
101
101
|
type: "text",
|
|
102
|
-
placeholder:
|
|
102
|
+
placeholder: 'Search ' + displayText,
|
|
103
103
|
value: text,
|
|
104
104
|
onChange: e => {
|
|
105
105
|
setText(e.target.value);
|
|
@@ -143,12 +143,12 @@ export function SearchModal(_ref2) {
|
|
|
143
143
|
children: [searchVar && /*#__PURE__*/_jsx(Nav.Item, {
|
|
144
144
|
children: /*#__PURE__*/_jsxs(Nav.Link, {
|
|
145
145
|
eventKey: FEATURE_TYPE.VAR,
|
|
146
|
-
children: ["Genes",
|
|
146
|
+
children: ["Genes", ' ', !!varResultsLength && "(".concat(varResultsLength, ")")]
|
|
147
147
|
})
|
|
148
148
|
}), searchDiseases && /*#__PURE__*/_jsx(Nav.Item, {
|
|
149
149
|
children: /*#__PURE__*/_jsxs(Nav.Link, {
|
|
150
150
|
eventKey: FEATURE_TYPE.DISEASE,
|
|
151
|
-
children: ["Diseases",
|
|
151
|
+
children: ["Diseases", ' ', !!diseaseResultsLength && "(".concat(diseaseResultsLength, ")")]
|
|
152
152
|
})
|
|
153
153
|
})]
|
|
154
154
|
})
|
|
@@ -211,8 +211,8 @@ export function SearchBar(_ref3) {
|
|
|
211
211
|
searchVar = true,
|
|
212
212
|
searchDiseases = false
|
|
213
213
|
} = _ref3;
|
|
214
|
-
const [text, setText] = useState(
|
|
215
|
-
const displayText = [...(searchVar ? [
|
|
214
|
+
const [text, setText] = useState('');
|
|
215
|
+
const displayText = [...(searchVar ? ['features'] : []), ...(searchDiseases ? ['diseases'] : [])].join(' and ');
|
|
216
216
|
const [showModal, setShowModal] = useState(false);
|
|
217
217
|
return /*#__PURE__*/_jsxs("div", {
|
|
218
218
|
children: [/*#__PURE__*/_jsx(Form, {
|
|
@@ -226,7 +226,7 @@ export function SearchBar(_ref3) {
|
|
|
226
226
|
}), /*#__PURE__*/_jsx(Form.Control, {
|
|
227
227
|
onClick: () => setShowModal(true),
|
|
228
228
|
type: "text",
|
|
229
|
-
placeholder:
|
|
229
|
+
placeholder: 'Search ' + displayText,
|
|
230
230
|
defaultValue: text
|
|
231
231
|
})]
|
|
232
232
|
})
|
|
@@ -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 { useState, useEffect } from
|
|
7
|
-
import { faPlus } from
|
|
8
|
-
import { FontAwesomeIcon } from
|
|
9
|
-
import _ from
|
|
10
|
-
import { Button, ListGroup } from
|
|
11
|
-
import { VAR_SORT } from
|
|
12
|
-
import { useDataset } from
|
|
13
|
-
import { useSettings, useSettingsDispatch } from
|
|
14
|
-
import { useFetch } from
|
|
15
|
-
import { VarDiseaseInfo } from
|
|
16
|
-
import { sortMeans, useVarMean } from
|
|
6
|
+
import { useState, useEffect } from 'react';
|
|
7
|
+
import { faPlus } from '@fortawesome/free-solid-svg-icons';
|
|
8
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
9
|
+
import _ from 'lodash';
|
|
10
|
+
import { Button, ListGroup } from 'react-bootstrap';
|
|
11
|
+
import { VAR_SORT } from '../../constants/constants';
|
|
12
|
+
import { useDataset } from '../../context/DatasetContext';
|
|
13
|
+
import { useSettings, useSettingsDispatch } from '../../context/SettingsContext';
|
|
14
|
+
import { useFetch } from '../../utils/requests';
|
|
15
|
+
import { VarDiseaseInfo } from '../var-list/VarItem';
|
|
16
|
+
import { sortMeans, useVarMean } from '../var-list/VarList';
|
|
17
17
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
18
|
export function VarInfo(_ref) {
|
|
19
19
|
let {
|
|
20
20
|
varItem
|
|
21
21
|
} = _ref;
|
|
22
|
-
const ENDPOINT =
|
|
22
|
+
const ENDPOINT = 'disease/gene';
|
|
23
23
|
const dataset = useDataset();
|
|
24
24
|
const [params, setParams] = useState({
|
|
25
25
|
geneName: varItem.name,
|
|
@@ -61,7 +61,7 @@ export function DiseaseInfo(_ref2) {
|
|
|
61
61
|
handleSelect,
|
|
62
62
|
addVarSet
|
|
63
63
|
} = _ref2;
|
|
64
|
-
const ENDPOINT =
|
|
64
|
+
const ENDPOINT = 'disease/genes';
|
|
65
65
|
const dataset = useDataset();
|
|
66
66
|
const settings = useSettings();
|
|
67
67
|
const dispatch = useSettingsDispatch();
|
|
@@ -98,7 +98,7 @@ export function DiseaseInfo(_ref2) {
|
|
|
98
98
|
}, settings.varSort.disease.sortOrder));
|
|
99
99
|
}
|
|
100
100
|
} else if (settings.varSort.disease.sort === VAR_SORT.NAME) {
|
|
101
|
-
setSortedDiseaseVars(_.orderBy(diseaseVars,
|
|
101
|
+
setSortedDiseaseVars(_.orderBy(diseaseVars, 'name', settings.varSort.disease.sortOrder));
|
|
102
102
|
} else {
|
|
103
103
|
setSortedDiseaseVars(diseaseVars);
|
|
104
104
|
}
|
|
@@ -3,14 +3,14 @@ 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 { useDeferredValue, useEffect, useMemo, useState } from
|
|
7
|
-
import { faPlus } from
|
|
8
|
-
import { FontAwesomeIcon } from
|
|
9
|
-
import _ from
|
|
10
|
-
import { Button, ListGroup } from
|
|
11
|
-
import { useSettingsDispatch } from
|
|
12
|
-
import { useDiseaseSearch, useVarSearch } from
|
|
13
|
-
import { VirtualizedList } from
|
|
6
|
+
import { useDeferredValue, useEffect, useMemo, useState } from 'react';
|
|
7
|
+
import { faPlus } from '@fortawesome/free-solid-svg-icons';
|
|
8
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
9
|
+
import _ from 'lodash';
|
|
10
|
+
import { Button, ListGroup } from 'react-bootstrap';
|
|
11
|
+
import { useSettingsDispatch } from '../../context/SettingsContext';
|
|
12
|
+
import { useDiseaseSearch, useVarSearch } from '../../utils/search';
|
|
13
|
+
import { VirtualizedList } from '../../utils/VirtualizedList';
|
|
14
14
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
15
|
export function VarSearchResults(_ref) {
|
|
16
16
|
let {
|
|
@@ -104,7 +104,7 @@ export function VarSearchResults(_ref) {
|
|
|
104
104
|
}) : /*#__PURE__*/_jsx(ListGroup.Item, {
|
|
105
105
|
as: "button",
|
|
106
106
|
disabled: true,
|
|
107
|
-
children: !text.length ?
|
|
107
|
+
children: !text.length ? 'Search features' : !serverError ? isStale || isPending ? 'Loading...' : 'No items found' : 'Failed to fetch data'
|
|
108
108
|
}, "empty")
|
|
109
109
|
})
|
|
110
110
|
})
|
|
@@ -185,7 +185,7 @@ export function DiseasesSearchResults(_ref2) {
|
|
|
185
185
|
}) : /*#__PURE__*/_jsx(ListGroup.Item, {
|
|
186
186
|
as: "button",
|
|
187
187
|
disabled: true,
|
|
188
|
-
children: !text.length ?
|
|
188
|
+
children: !text.length ? 'Search diseases' : !serverError ? isStale || isPending ? 'Loading...' : 'No items found' : 'Failed to fetch data'
|
|
189
189
|
}, "empty")
|
|
190
190
|
})
|
|
191
191
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { faList, faSearch, faSliders } from
|
|
2
|
-
import { FontAwesomeIcon } from
|
|
3
|
-
import { Container, Nav, Navbar } from
|
|
1
|
+
import { faList, faSearch, faSliders } from '@fortawesome/free-solid-svg-icons';
|
|
2
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
3
|
+
import { Container, Nav, Navbar } from 'react-bootstrap';
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
export const Toolbar = _ref => {
|
|
6
6
|
let {
|
|
@@ -62,7 +62,7 @@ export const ObsPlotlyToolbar = _ref2 => {
|
|
|
62
62
|
onClick
|
|
63
63
|
} = _ref2;
|
|
64
64
|
return {
|
|
65
|
-
name:
|
|
65
|
+
name: 'Categories',
|
|
66
66
|
icon: {
|
|
67
67
|
width: 512,
|
|
68
68
|
height: 512,
|
|
@@ -76,7 +76,7 @@ export const VarPlotlyToolbar = _ref3 => {
|
|
|
76
76
|
onClick
|
|
77
77
|
} = _ref3;
|
|
78
78
|
return {
|
|
79
|
-
name:
|
|
79
|
+
name: 'Features',
|
|
80
80
|
icon: {
|
|
81
81
|
width: 512,
|
|
82
82
|
height: 512,
|
|
@@ -90,7 +90,7 @@ export const ControlsPlotlyToolbar = _ref4 => {
|
|
|
90
90
|
onClick
|
|
91
91
|
} = _ref4;
|
|
92
92
|
return {
|
|
93
|
-
name:
|
|
93
|
+
name: 'Controls',
|
|
94
94
|
icon: {
|
|
95
95
|
width: 512,
|
|
96
96
|
height: 512,
|