@haniffalab/cherita-react 1.4.1 → 1.4.2-dev.2025-10-29.e8bbb191
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 +38 -30
- package/dist/cjs/components/dotplot/Dotplot.js +67 -69
- package/dist/cjs/components/dotplot/DotplotControls.js +103 -83
- package/dist/cjs/components/full-page/FullPage.js +100 -74
- package/dist/cjs/components/full-page/PlotAlert.js +45 -0
- package/dist/cjs/components/full-page/PlotTypeSelector.js +89 -44
- package/dist/cjs/components/heatmap/Heatmap.js +65 -65
- package/dist/cjs/components/heatmap/HeatmapControls.js +6 -3
- package/dist/cjs/components/icons/DotPlotIcon.js +64 -0
- package/dist/cjs/components/icons/HeatmapIcon.js +45 -0
- package/dist/cjs/components/icons/MatrixPlotIcon.1.js +57 -0
- package/dist/cjs/components/icons/MatrixPlotIcon.js +59 -0
- package/dist/cjs/components/icons/ScatterplotIcon.1.js +164 -0
- package/dist/cjs/components/icons/ScatterplotIcon.js +144 -0
- package/dist/cjs/components/icons/ViolinPlotIcon.js +42 -0
- package/dist/cjs/components/matrixplot/Matrixplot.js +65 -66
- package/dist/cjs/components/matrixplot/MatrixplotControls.js +8 -5
- package/dist/cjs/components/obs-list/ObsItem.js +258 -210
- package/dist/cjs/components/obs-list/ObsList.js +161 -133
- package/dist/cjs/components/obs-list/ObsToolbar.js +2 -3
- package/dist/cjs/components/obsm-list/ObsmList.js +53 -38
- package/dist/cjs/components/offcanvas/index.js +61 -31
- package/dist/cjs/components/pseudospatial/Pseudospatial.js +132 -76
- package/dist/cjs/components/pseudospatial/PseudospatialToolbar.js +122 -74
- package/dist/cjs/components/scatterplot/Scatterplot.js +127 -99
- package/dist/cjs/components/scatterplot/ScatterplotControls.js +45 -31
- package/dist/cjs/components/scatterplot/SpatialControls.js +140 -113
- package/dist/cjs/components/scatterplot/Toolbox.js +41 -30
- package/dist/cjs/components/search-bar/SearchBar.js +168 -121
- package/dist/cjs/components/search-bar/SearchInfo.js +76 -50
- package/dist/cjs/components/search-bar/SearchResults.js +93 -71
- package/dist/cjs/components/toolbar/Toolbar.js +46 -37
- package/dist/cjs/components/var-list/VarItem.js +115 -88
- package/dist/cjs/components/var-list/VarList.js +85 -69
- package/dist/cjs/components/var-list/VarListToolbar.js +59 -54
- package/dist/cjs/components/var-list/VarSet.js +126 -108
- package/dist/cjs/components/violin/Violin.js +109 -107
- package/dist/cjs/components/violin/ViolinControls.js +8 -5
- package/dist/cjs/constants/colorscales.js +19 -19
- package/dist/cjs/constants/constants.js +47 -47
- package/dist/cjs/context/DatasetContext.js +24 -16
- package/dist/cjs/context/FilterContext.js +11 -9
- package/dist/cjs/context/SettingsContext.js +255 -89
- package/dist/cjs/context/ZarrDataContext.js +6 -5
- package/dist/cjs/helpers/color-helper.js +2 -2
- package/dist/cjs/helpers/zarr-helper.js +3 -3
- package/dist/cjs/utils/Filter.js +16 -11
- package/dist/cjs/utils/Histogram.js +35 -33
- package/dist/cjs/utils/ImageViewer.js +11 -8
- package/dist/cjs/utils/Legend.js +37 -30
- package/dist/cjs/utils/LoadingIndicators.js +15 -13
- package/dist/cjs/utils/Resolver.js +213 -0
- package/dist/cjs/utils/Skeleton.js +10 -10
- package/dist/cjs/utils/StyledTooltip.js +44 -0
- package/dist/cjs/utils/VirtualizedList.js +34 -27
- package/dist/cjs/utils/errors.js +15 -15
- package/dist/cjs/utils/requests.js +21 -9
- package/dist/cjs/utils/search.js +4 -4
- package/dist/cjs/utils/string.js +6 -6
- package/dist/cjs/utils/zarrData.js +20 -21
- package/dist/css/cherita.css +64 -42
- package/dist/css/cherita.css.map +1 -1
- package/dist/esm/components/controls/Controls.js +43 -35
- package/dist/esm/components/dotplot/Dotplot.js +77 -78
- package/dist/esm/components/dotplot/DotplotControls.js +106 -85
- package/dist/esm/components/full-page/FullPage.js +120 -93
- package/dist/esm/components/full-page/PlotAlert.js +39 -0
- package/dist/esm/components/full-page/PlotTypeSelector.js +90 -45
- package/dist/esm/components/heatmap/Heatmap.js +75 -74
- package/dist/esm/components/heatmap/HeatmapControls.js +8 -4
- package/dist/esm/components/icons/DotPlotIcon.js +58 -0
- package/dist/esm/components/icons/HeatmapIcon.js +39 -0
- package/dist/esm/components/icons/MatrixPlotIcon.1.js +51 -0
- package/dist/esm/components/icons/MatrixPlotIcon.js +53 -0
- package/dist/esm/components/icons/ScatterplotIcon.1.js +158 -0
- package/dist/esm/components/icons/ScatterplotIcon.js +138 -0
- package/dist/esm/components/icons/ViolinPlotIcon.js +36 -0
- package/dist/esm/components/matrixplot/Matrixplot.js +75 -75
- package/dist/esm/components/matrixplot/MatrixplotControls.js +10 -6
- package/dist/esm/components/obs-list/ObsItem.js +273 -222
- package/dist/esm/components/obs-list/ObsList.js +176 -147
- package/dist/esm/components/obs-list/ObsToolbar.js +3 -3
- package/dist/esm/components/obsm-list/ObsmList.js +60 -44
- package/dist/esm/components/offcanvas/index.js +67 -37
- package/dist/esm/components/pseudospatial/Pseudospatial.js +145 -88
- package/dist/esm/components/pseudospatial/PseudospatialToolbar.js +127 -78
- package/dist/esm/components/scatterplot/Scatterplot.js +148 -119
- package/dist/esm/components/scatterplot/ScatterplotControls.js +50 -35
- package/dist/esm/components/scatterplot/SpatialControls.js +153 -125
- package/dist/esm/components/scatterplot/Toolbox.js +44 -32
- package/dist/esm/components/search-bar/SearchBar.js +180 -132
- package/dist/esm/components/search-bar/SearchInfo.js +86 -59
- package/dist/esm/components/search-bar/SearchResults.js +100 -77
- package/dist/esm/components/toolbar/Toolbar.js +49 -39
- package/dist/esm/components/var-list/VarItem.js +126 -98
- package/dist/esm/components/var-list/VarList.js +99 -82
- package/dist/esm/components/var-list/VarListToolbar.js +64 -58
- package/dist/esm/components/var-list/VarSet.js +134 -115
- package/dist/esm/components/violin/Violin.js +121 -118
- package/dist/esm/components/violin/ViolinControls.js +10 -6
- package/dist/esm/constants/colorscales.js +19 -19
- package/dist/esm/constants/constants.js +47 -47
- package/dist/esm/context/DatasetContext.js +31 -22
- package/dist/esm/context/FilterContext.js +11 -8
- package/dist/esm/context/SettingsContext.js +257 -90
- package/dist/esm/context/ZarrDataContext.js +8 -6
- 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 +22 -17
- package/dist/esm/utils/Histogram.js +39 -37
- package/dist/esm/utils/ImageViewer.js +12 -8
- package/dist/esm/utils/Legend.js +44 -36
- package/dist/esm/utils/LoadingIndicators.js +16 -13
- package/dist/esm/utils/Resolver.js +201 -0
- package/dist/esm/utils/Skeleton.js +11 -10
- package/dist/esm/utils/StyledTooltip.js +38 -0
- package/dist/esm/utils/VirtualizedList.js +35 -27
- package/dist/esm/utils/errors.js +15 -15
- package/dist/esm/utils/requests.js +24 -12
- package/dist/esm/utils/search.js +7 -7
- package/dist/esm/utils/string.js +7 -7
- package/dist/esm/utils/zarrData.js +27 -28
- package/package.json +21 -9
- package/scss/cherita-bootstrap.scss +2 -2
- package/scss/cherita.scss +43 -17
- package/scss/components/accordions.scss +4 -1
- package/scss/components/layouts.scss +15 -33
- package/scss/components/lists.scss +8 -4
- package/scss/components/plotly.scss +38 -26
- package/scss/components/plots.scss +14 -1
- package/dist/assets/images/plots/dotplot.svg +0 -152
- package/dist/assets/images/plots/heatmap.svg +0 -193
- package/dist/assets/images/plots/matrixplot.svg +0 -275
- package/dist/assets/images/plots/scatterplot.svg +0 -198
- package/dist/assets/images/plots/violin.svg +0 -50
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import
|
|
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
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
16
|
export function SpatialControls(_ref) {
|
|
16
17
|
var _features$features;
|
|
17
18
|
let {
|
|
@@ -38,19 +39,19 @@ export function SpatialControls(_ref) {
|
|
|
38
39
|
const showVarsBtn = isFullscreen ? XlBreakpoint : true;
|
|
39
40
|
const onSelect = (eventKey, event) => {
|
|
40
41
|
switch (eventKey) {
|
|
41
|
-
case
|
|
42
|
+
case 'DrawPolygonMode':
|
|
42
43
|
setMode(() => DrawPolygonMode);
|
|
43
44
|
break;
|
|
44
|
-
case
|
|
45
|
+
case 'DrawLineStringMode':
|
|
45
46
|
setMode(() => DrawLineStringMode);
|
|
46
47
|
break;
|
|
47
|
-
case
|
|
48
|
+
case 'DrawPolygonByDraggingMode':
|
|
48
49
|
setMode(() => DrawPolygonByDraggingMode);
|
|
49
50
|
break;
|
|
50
|
-
case
|
|
51
|
+
case 'DrawRectangleMode':
|
|
51
52
|
setMode(() => DrawRectangleMode);
|
|
52
53
|
break;
|
|
53
|
-
case
|
|
54
|
+
case 'ModifyMode':
|
|
54
55
|
setMode(() => ModifyMode);
|
|
55
56
|
break;
|
|
56
57
|
default:
|
|
@@ -59,113 +60,140 @@ export function SpatialControls(_ref) {
|
|
|
59
60
|
};
|
|
60
61
|
const deleteFeatures = (_eventKey, _event) => {
|
|
61
62
|
setFeatures({
|
|
62
|
-
type:
|
|
63
|
+
type: 'FeatureCollection',
|
|
63
64
|
features: []
|
|
64
65
|
});
|
|
65
66
|
};
|
|
66
|
-
const polygonControls = /*#__PURE__*/
|
|
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
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
|
|
67
|
+
const polygonControls = /*#__PURE__*/_jsxs(_Fragment, {
|
|
68
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
69
|
+
active: settings.sliceBy.polygons,
|
|
70
|
+
title: "Filter data with polygons",
|
|
71
|
+
onClick: () => {
|
|
72
|
+
setMode(() => ViewMode);
|
|
73
|
+
dispatch({
|
|
74
|
+
type: 'toggle.slice.polygons'
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
children: /*#__PURE__*/_jsx(JoinInner, {})
|
|
78
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
79
|
+
title: "Delete selected polygons",
|
|
80
|
+
onClick: () => {
|
|
81
|
+
const newFeatures = features.features.filter((_f, i) => !selectedFeatureIndexes.includes(i));
|
|
82
|
+
setFeatures({
|
|
83
|
+
type: 'FeatureCollection',
|
|
84
|
+
features: newFeatures
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
disabled: !selectedFeatureIndexes.length,
|
|
88
|
+
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
89
|
+
icon: faTrash
|
|
90
|
+
})
|
|
91
|
+
})]
|
|
92
|
+
});
|
|
93
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
94
|
+
className: "cherita-spatial-controls",
|
|
95
|
+
children: [(showObsBtn || showVarsBtn) && /*#__PURE__*/_jsxs(ButtonGroup, {
|
|
96
|
+
vertical: true,
|
|
97
|
+
className: "w-100 mb-1",
|
|
98
|
+
children: [showObsBtn && /*#__PURE__*/_jsx(OverlayTrigger, {
|
|
99
|
+
placement: "right",
|
|
100
|
+
overlay: /*#__PURE__*/_jsx(Tooltip, {
|
|
101
|
+
id: "tooltip-obs",
|
|
102
|
+
children: "Browse categories"
|
|
103
|
+
}),
|
|
104
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
105
|
+
onClick: () => setShowObs(true),
|
|
106
|
+
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
107
|
+
icon: faList
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
}), showVarsBtn && /*#__PURE__*/_jsx(OverlayTrigger, {
|
|
111
|
+
placement: "right",
|
|
112
|
+
overlay: /*#__PURE__*/_jsx(Tooltip, {
|
|
113
|
+
id: "tooltip-vars",
|
|
114
|
+
children: "Search features"
|
|
115
|
+
}),
|
|
116
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
117
|
+
onClick: () => setShowVars(true),
|
|
118
|
+
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
119
|
+
icon: faSearch
|
|
120
|
+
})
|
|
121
|
+
})
|
|
122
|
+
})]
|
|
123
|
+
}), /*#__PURE__*/_jsxs(ButtonGroup, {
|
|
124
|
+
vertical: true,
|
|
125
|
+
className: "w-100",
|
|
126
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
127
|
+
onClick: () => setMode(() => ViewMode),
|
|
128
|
+
title: "Set dragging mode",
|
|
129
|
+
active: mode === ViewMode,
|
|
130
|
+
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
131
|
+
icon: faHand
|
|
132
|
+
})
|
|
133
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
134
|
+
onClick: increaseZoom,
|
|
135
|
+
title: "Increase zoom",
|
|
136
|
+
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
137
|
+
icon: faPlus
|
|
138
|
+
})
|
|
139
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
140
|
+
onClick: decreaseZoom,
|
|
141
|
+
title: "Decrease zoom",
|
|
142
|
+
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
143
|
+
icon: faMinus
|
|
144
|
+
})
|
|
145
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
146
|
+
className: "border-bottom"
|
|
147
|
+
}), " ", /*#__PURE__*/_jsx(Button, {
|
|
148
|
+
onClick: resetBounds,
|
|
149
|
+
title: "Reset zoom and center",
|
|
150
|
+
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
151
|
+
icon: faCrosshairs
|
|
152
|
+
})
|
|
153
|
+
}), /*#__PURE__*/_jsxs(Dropdown, {
|
|
154
|
+
as: ButtonGroup,
|
|
155
|
+
className: "caret-off",
|
|
156
|
+
drop: "end",
|
|
157
|
+
onSelect: onSelect,
|
|
158
|
+
children: [/*#__PURE__*/_jsx(Dropdown.Toggle, {
|
|
159
|
+
id: "dropdown-autoclose-outside",
|
|
160
|
+
className: "caret-off ".concat(mode === DrawPolygonByDraggingMode || mode === ModifyMode ? 'active' : ''),
|
|
161
|
+
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
162
|
+
icon: faDrawPolygon
|
|
163
|
+
})
|
|
164
|
+
}), /*#__PURE__*/_jsxs(Dropdown.Menu, {
|
|
165
|
+
children: [/*#__PURE__*/_jsx(Dropdown.Header, {
|
|
166
|
+
children: "Polygon tools"
|
|
167
|
+
}), /*#__PURE__*/_jsxs(Dropdown.Item, {
|
|
168
|
+
eventKey: "DrawPolygonByDraggingMode",
|
|
169
|
+
children: [/*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
170
|
+
icon: faDrawPolygon,
|
|
171
|
+
className: "nav-icon"
|
|
172
|
+
}), "Draw a polygon"]
|
|
173
|
+
}), /*#__PURE__*/_jsxs(Dropdown.Item, {
|
|
174
|
+
eventKey: "ModifyMode",
|
|
175
|
+
children: [/*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
176
|
+
icon: faPen,
|
|
177
|
+
className: "nav-icon"
|
|
178
|
+
}), "Modify polygons"]
|
|
179
|
+
}), /*#__PURE__*/_jsxs(Dropdown.Item, {
|
|
180
|
+
onClick: deleteFeatures,
|
|
181
|
+
children: [/*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
182
|
+
icon: faTrash,
|
|
183
|
+
className: "nav-icon"
|
|
184
|
+
}), "Delete polygons"]
|
|
185
|
+
})]
|
|
186
|
+
})]
|
|
187
|
+
}), !!(features !== null && features !== void 0 && (_features$features = features.features) !== null && _features$features !== void 0 && _features$features.length) && polygonControls, /*#__PURE__*/_jsx(Button, {
|
|
188
|
+
onClick: handleShowControls,
|
|
189
|
+
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
190
|
+
icon: faSliders
|
|
191
|
+
})
|
|
192
|
+
})]
|
|
193
|
+
}), /*#__PURE__*/_jsx(OffcanvasControls, {
|
|
194
|
+
show: showControls,
|
|
195
|
+
handleClose: handleCloseControls,
|
|
196
|
+
Controls: ScatterplotControls
|
|
197
|
+
})]
|
|
198
|
+
});
|
|
171
199
|
}
|
|
@@ -1,38 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { Button, ButtonGroup, OverlayTrigger, Tooltip } from 'react-bootstrap';
|
|
2
|
+
import { formatNumerical } from '../../utils/string';
|
|
3
|
+
import { ObsmKeysList } from '../obsm-list/ObsmList';
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
export function Toolbox(_ref) {
|
|
6
6
|
let {
|
|
7
7
|
mode,
|
|
8
8
|
obsLength,
|
|
9
|
-
slicedLength
|
|
9
|
+
slicedLength,
|
|
10
|
+
setHasObsm
|
|
10
11
|
} = _ref;
|
|
11
|
-
return /*#__PURE__*/
|
|
12
|
-
className: "cherita-toolbox"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
12
|
+
return /*#__PURE__*/_jsx("div", {
|
|
13
|
+
className: "cherita-toolbox",
|
|
14
|
+
children: /*#__PURE__*/_jsxs(ButtonGroup, {
|
|
15
|
+
children: [/*#__PURE__*/_jsx(ObsmKeysList, {
|
|
16
|
+
setHasObsm: setHasObsm
|
|
17
|
+
}), (mode || !isNaN(obsLength)) && (mode !== null && !isNaN(slicedLength) && slicedLength !== obsLength ? /*#__PURE__*/_jsx(OverlayTrigger, {
|
|
18
|
+
placement: "top",
|
|
19
|
+
overlay: /*#__PURE__*/_jsxs(Tooltip, {
|
|
20
|
+
id: "tooltip-dropped-mode",
|
|
21
|
+
children: ["You have selected ", formatNumerical(slicedLength), " out of", ' ', formatNumerical(obsLength), " cells"]
|
|
22
|
+
}),
|
|
23
|
+
children: /*#__PURE__*/_jsxs(Button, {
|
|
24
|
+
size: "sm",
|
|
25
|
+
variant: "primary",
|
|
26
|
+
style: {
|
|
27
|
+
cursor: 'default'
|
|
28
|
+
},
|
|
29
|
+
"aria-disabled": "true",
|
|
30
|
+
children: [formatNumerical(slicedLength), " of ", formatNumerical(obsLength), ' ', "cells"]
|
|
31
|
+
})
|
|
32
|
+
}) : /*#__PURE__*/_jsx(OverlayTrigger, {
|
|
33
|
+
placement: "top",
|
|
34
|
+
overlay: /*#__PURE__*/_jsxs(Tooltip, {
|
|
35
|
+
id: "tooltip-dropped-mode",
|
|
36
|
+
children: ["You are viewing ", formatNumerical(obsLength), " cells"]
|
|
37
|
+
}),
|
|
38
|
+
children: /*#__PURE__*/_jsxs(Button, {
|
|
39
|
+
size: "sm",
|
|
40
|
+
variant: "primary",
|
|
41
|
+
style: {
|
|
42
|
+
cursor: 'default'
|
|
43
|
+
},
|
|
44
|
+
"aria-disabled": "true",
|
|
45
|
+
children: [formatNumerical(obsLength), " cells"]
|
|
46
|
+
})
|
|
47
|
+
}))]
|
|
48
|
+
})
|
|
49
|
+
});
|
|
38
50
|
}
|