@haniffalab/cherita-react 1.0.0-dev.2025-03-27.d22a5d51 → 1.0.0-dev.2025-04-01.e61c9d78
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/full-page/FullPage.js +26 -17
- package/dist/cjs/components/obs-list/ObsItem.js +38 -31
- package/dist/cjs/components/obs-list/ObsList.js +41 -14
- package/dist/cjs/components/obs-list/ObsToolbar.js +3 -44
- package/dist/cjs/components/obsm-list/ObsmList.js +7 -4
- package/dist/cjs/components/scatterplot/Scatterplot.js +2 -2
- package/dist/cjs/components/scatterplot/SpatialControls.js +32 -32
- package/dist/cjs/components/scatterplot/Toolbox.js +40 -10
- package/dist/cjs/components/search-bar/SearchBar.js +18 -2
- package/dist/cjs/components/var-list/VarList.js +36 -17
- package/dist/cjs/components/var-list/VarListToolbar.js +14 -11
- package/dist/cjs/components/var-list/VarSet.js +3 -2
- package/dist/cjs/utils/Skeleton.js +19 -0
- package/dist/css/cherita.css +144 -168
- package/dist/css/cherita.css.map +1 -1
- package/dist/esm/components/full-page/FullPage.js +27 -18
- package/dist/esm/components/obs-list/ObsItem.js +40 -33
- package/dist/esm/components/obs-list/ObsList.js +42 -15
- package/dist/esm/components/obs-list/ObsToolbar.js +4 -45
- package/dist/esm/components/obsm-list/ObsmList.js +8 -5
- package/dist/esm/components/scatterplot/Scatterplot.js +3 -3
- package/dist/esm/components/scatterplot/SpatialControls.js +34 -34
- package/dist/esm/components/scatterplot/Toolbox.js +40 -10
- package/dist/esm/components/search-bar/SearchBar.js +20 -4
- package/dist/esm/components/var-list/VarList.js +37 -18
- package/dist/esm/components/var-list/VarListToolbar.js +13 -10
- package/dist/esm/components/var-list/VarSet.js +5 -4
- package/dist/esm/utils/Skeleton.js +12 -0
- package/package.json +2 -2
- package/scss/cherita.scss +15 -70
- package/scss/components/accordions.scss +32 -0
- package/scss/components/layouts.scss +1 -1
- package/scss/components/lists.scss +14 -0
|
@@ -1,58 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
4
|
-
import _ from "lodash";
|
|
5
|
-
import { Button, ButtonGroup, Form } from "react-bootstrap";
|
|
6
|
-
import { COLOR_ENCODINGS } from "../../constants/constants";
|
|
7
|
-
import { useDataset } from "../../context/DatasetContext";
|
|
2
|
+
import { Form } from "react-bootstrap";
|
|
8
3
|
export function ObsToolbar(_ref) {
|
|
9
4
|
let {
|
|
10
5
|
item,
|
|
11
6
|
showToggleAllObs = true,
|
|
12
|
-
|
|
13
|
-
showSlice = true,
|
|
14
|
-
showColor = true,
|
|
15
|
-
onToggleAllObs,
|
|
16
|
-
onToggleLabel,
|
|
17
|
-
onToggleSlice,
|
|
18
|
-
onToggleColor
|
|
7
|
+
onToggleAllObs
|
|
19
8
|
} = _ref;
|
|
20
|
-
const dataset = useDataset();
|
|
21
9
|
const allToggledOn = !item.omit.length;
|
|
22
|
-
|
|
23
|
-
const inSliceObs = dataset.sliceBy.obs && dataset.selectedObs?.name === item.name;
|
|
24
|
-
const isColorEncoding = dataset.colorEncoding === COLOR_ENCODINGS.OBS && dataset.selectedObs?.name === item.name;
|
|
25
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
-
className: "d-flex align-items-center"
|
|
27
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
28
|
-
className: "flex-grow-1"
|
|
29
|
-
}, showToggleAllObs && /*#__PURE__*/React.createElement(Form.Check, {
|
|
30
|
-
// prettier-ignore
|
|
10
|
+
return showToggleAllObs && /*#__PURE__*/React.createElement(Form.Check, {
|
|
31
11
|
type: "switch",
|
|
32
12
|
id: "custom-switch",
|
|
33
13
|
label: "Toggle all",
|
|
34
14
|
checked: allToggledOn,
|
|
35
15
|
onChange: onToggleAllObs
|
|
36
|
-
})
|
|
37
|
-
variant: inLabelObs ? "primary" : "outline-primary",
|
|
38
|
-
size: "sm",
|
|
39
|
-
onClick: onToggleLabel,
|
|
40
|
-
title: "Add to tooltip"
|
|
41
|
-
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
42
|
-
icon: faListOl
|
|
43
|
-
})), showSlice && /*#__PURE__*/React.createElement(Button, {
|
|
44
|
-
variant: inSliceObs ? "primary" : "outline-primary",
|
|
45
|
-
size: "sm",
|
|
46
|
-
onClick: onToggleSlice,
|
|
47
|
-
title: "Filter to selected"
|
|
48
|
-
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
49
|
-
icon: faScissors
|
|
50
|
-
})), showColor && /*#__PURE__*/React.createElement(Button, {
|
|
51
|
-
variant: isColorEncoding ? "primary" : "outline-primary",
|
|
52
|
-
size: "sm",
|
|
53
|
-
onClick: onToggleColor,
|
|
54
|
-
title: "Set as color encoding"
|
|
55
|
-
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
56
|
-
icon: faDroplet
|
|
57
|
-
})))));
|
|
16
|
+
});
|
|
58
17
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Button, ButtonGroup, Dropdown, DropdownButton, OverlayTrigger, Tooltip } from "react-bootstrap";
|
|
3
3
|
import { useDataset, useDatasetDispatch } from "../../context/DatasetContext";
|
|
4
|
-
import { LoadingSpinner } from "../../utils/LoadingIndicators";
|
|
5
4
|
import { useFetch } from "../../utils/requests";
|
|
5
|
+
import { ObsmKeysListBtn } from "../../utils/Skeleton";
|
|
6
6
|
export function ObsmKeysList() {
|
|
7
7
|
const ENDPOINT = "obsm/keys";
|
|
8
8
|
const dataset = useDataset();
|
|
@@ -50,13 +50,16 @@ export function ObsmKeysList() {
|
|
|
50
50
|
}, item);
|
|
51
51
|
});
|
|
52
52
|
if (!serverError) {
|
|
53
|
-
|
|
53
|
+
if (isPending) {
|
|
54
|
+
return /*#__PURE__*/React.createElement(ObsmKeysListBtn, null);
|
|
55
|
+
}
|
|
56
|
+
return /*#__PURE__*/React.createElement(DropdownButton, {
|
|
54
57
|
as: ButtonGroup,
|
|
55
58
|
title: dataset.selectedObsm || "Select an embedding",
|
|
56
|
-
variant: dataset.selectedObsm ? "primary" : "
|
|
59
|
+
variant: dataset.selectedObsm ? "primary" : "warning",
|
|
57
60
|
id: "bg-nested-dropdown",
|
|
58
61
|
size: "sm"
|
|
59
|
-
}, obsmList)
|
|
62
|
+
}, /*#__PURE__*/React.createElement(Dropdown.Header, null, "Embeddings"), obsmList);
|
|
60
63
|
} else {
|
|
61
64
|
return /*#__PURE__*/React.createElement(OverlayTrigger, {
|
|
62
65
|
placement: "top",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useCallback, useDeferredValue, useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { ScatterplotLayer } from "@deck.gl/layers";
|
|
3
3
|
import { DeckGL } from "@deck.gl/react";
|
|
4
4
|
import { faTriangleExclamation } from "@fortawesome/free-solid-svg-icons";
|
|
@@ -7,8 +7,6 @@ import { ViewMode } from "@nebula.gl/edit-modes";
|
|
|
7
7
|
import { EditableGeoJsonLayer } from "@nebula.gl/layers";
|
|
8
8
|
import _ from "lodash";
|
|
9
9
|
import { Alert } from "react-bootstrap";
|
|
10
|
-
import { SpatialControls } from "./SpatialControls";
|
|
11
|
-
import { Toolbox } from "./Toolbox";
|
|
12
10
|
import { COLOR_ENCODINGS, OBS_TYPES, SELECTED_POLYGON_FILLCOLOR, UNSELECTED_POLYGON_FILLCOLOR } from "../../constants/constants";
|
|
13
11
|
import { useDataset, useDatasetDispatch } from "../../context/DatasetContext";
|
|
14
12
|
import { useFilteredData } from "../../context/FilterContext";
|
|
@@ -19,6 +17,8 @@ import { Legend } from "../../utils/Legend";
|
|
|
19
17
|
import { LoadingLinear, LoadingSpinner } from "../../utils/LoadingIndicators";
|
|
20
18
|
import { formatNumerical } from "../../utils/string";
|
|
21
19
|
import { useLabelObsData } from "../../utils/zarrData";
|
|
20
|
+
import { SpatialControls } from "./SpatialControls";
|
|
21
|
+
import { Toolbox } from "./Toolbox";
|
|
22
22
|
window.deck.log.level = 1;
|
|
23
23
|
const INITIAL_VIEW_STATE = {
|
|
24
24
|
longitude: 0,
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { faCrosshairs, faDrawPolygon, faHand, faMinus, faPen, faPlus, faSliders, faTrash } from "@fortawesome/free-solid-svg-icons";
|
|
3
3
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
4
4
|
import { JoinInner } from "@mui/icons-material";
|
|
5
|
-
import {
|
|
5
|
+
import { DrawLineStringMode, DrawPolygonByDraggingMode, DrawPolygonMode, DrawRectangleMode, ModifyMode, ViewMode } from "@nebula.gl/edit-modes";
|
|
6
6
|
import Button from "react-bootstrap/Button";
|
|
7
7
|
import ButtonGroup from "react-bootstrap/ButtonGroup";
|
|
8
8
|
import Dropdown from "react-bootstrap/Dropdown";
|
|
9
|
-
import DropdownButton from "react-bootstrap/DropdownButton";
|
|
10
|
-
import { ScatterplotControls } from "./ScatterplotControls";
|
|
11
9
|
import { useDataset, useDatasetDispatch } from "../../context/DatasetContext";
|
|
12
10
|
import { OffcanvasControls } from "../offcanvas";
|
|
11
|
+
import { ScatterplotControls } from "./ScatterplotControls";
|
|
13
12
|
export function SpatialControls(_ref) {
|
|
14
13
|
let {
|
|
15
14
|
mode,
|
|
@@ -53,13 +52,8 @@ export function SpatialControls(_ref) {
|
|
|
53
52
|
features: []
|
|
54
53
|
});
|
|
55
54
|
};
|
|
56
|
-
const polygonControls = /*#__PURE__*/React.createElement(
|
|
57
|
-
|
|
58
|
-
}, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
59
|
-
vertical: true,
|
|
60
|
-
className: "w-100"
|
|
61
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
62
|
-
variant: dataset.sliceBy.polygons ? "primary" : "outline-primary",
|
|
55
|
+
const polygonControls = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
56
|
+
active: dataset.sliceBy.polygons,
|
|
63
57
|
title: "Filter data with polygons",
|
|
64
58
|
onClick: () => {
|
|
65
59
|
setMode(() => ViewMode);
|
|
@@ -68,7 +62,6 @@ export function SpatialControls(_ref) {
|
|
|
68
62
|
});
|
|
69
63
|
}
|
|
70
64
|
}, /*#__PURE__*/React.createElement(JoinInner, null)), /*#__PURE__*/React.createElement(Button, {
|
|
71
|
-
variant: "outline-primary",
|
|
72
65
|
title: "Delete selected polygons",
|
|
73
66
|
onClick: () => {
|
|
74
67
|
const newFeatures = features.features.filter((_f, i) => !selectedFeatureIndexes.includes(i));
|
|
@@ -80,12 +73,12 @@ export function SpatialControls(_ref) {
|
|
|
80
73
|
disabled: !selectedFeatureIndexes.length
|
|
81
74
|
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
82
75
|
icon: faTrash
|
|
83
|
-
})))
|
|
76
|
+
})));
|
|
84
77
|
return /*#__PURE__*/React.createElement("div", {
|
|
85
78
|
className: "cherita-spatial-controls"
|
|
86
79
|
}, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
87
80
|
vertical: true,
|
|
88
|
-
className: "w-100"
|
|
81
|
+
className: "w-100 mb-1"
|
|
89
82
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
90
83
|
onClick: increaseZoom,
|
|
91
84
|
title: "Increase zoom"
|
|
@@ -102,37 +95,44 @@ export function SpatialControls(_ref) {
|
|
|
102
95
|
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
103
96
|
icon: faCrosshairs
|
|
104
97
|
})), /*#__PURE__*/React.createElement(Button, {
|
|
98
|
+
onClick: handleShowControls
|
|
99
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
100
|
+
icon: faSliders
|
|
101
|
+
}))), /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
102
|
+
vertical: true,
|
|
103
|
+
className: "w-100"
|
|
104
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
105
105
|
onClick: () => setMode(() => ViewMode),
|
|
106
106
|
title: "Set dragging mode",
|
|
107
|
-
|
|
107
|
+
active: mode === ViewMode
|
|
108
108
|
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
109
109
|
icon: faHand
|
|
110
|
-
})), /*#__PURE__*/React.createElement(
|
|
110
|
+
})), /*#__PURE__*/React.createElement(Dropdown, {
|
|
111
111
|
as: ButtonGroup,
|
|
112
|
-
title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
113
|
-
icon: faDrawPolygon
|
|
114
|
-
})),
|
|
115
|
-
drop: "end",
|
|
116
|
-
id: "bg-vertical-dropdown-1",
|
|
117
112
|
className: "caret-off",
|
|
113
|
+
drop: "end",
|
|
118
114
|
onSelect: onSelect
|
|
119
|
-
}, /*#__PURE__*/React.createElement(Dropdown.
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
}, /*#__PURE__*/React.createElement(Dropdown.Toggle, {
|
|
116
|
+
id: "dropdown-autoclose-outside",
|
|
117
|
+
className: `caret-off ${mode === DrawPolygonByDraggingMode || mode === ModifyMode ? "active" : ""}`
|
|
118
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
119
|
+
icon: faDrawPolygon
|
|
120
|
+
})), /*#__PURE__*/React.createElement(Dropdown.Menu, null, /*#__PURE__*/React.createElement(Dropdown.Header, null, "Polygon tools"), /*#__PURE__*/React.createElement(Dropdown.Item, {
|
|
122
121
|
eventKey: "DrawPolygonByDraggingMode"
|
|
123
|
-
},
|
|
122
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
123
|
+
icon: faDrawPolygon,
|
|
124
|
+
className: "nav-icon"
|
|
125
|
+
}), "Draw a polygon"), /*#__PURE__*/React.createElement(Dropdown.Item, {
|
|
124
126
|
eventKey: "ModifyMode"
|
|
125
|
-
}, "Modify polygons"), /*#__PURE__*/React.createElement(Dropdown.Item, {
|
|
126
|
-
eventKey: "ViewMode"
|
|
127
|
-
}, "Viewing mode"), /*#__PURE__*/React.createElement(Dropdown.Item, {
|
|
128
|
-
onClick: deleteFeatures
|
|
129
127
|
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
130
|
-
icon:
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
icon: faPen,
|
|
129
|
+
className: "nav-icon"
|
|
130
|
+
}), "Modify polygons"), /*#__PURE__*/React.createElement(Dropdown.Item, {
|
|
131
|
+
onClick: deleteFeatures
|
|
133
132
|
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
134
|
-
icon:
|
|
135
|
-
|
|
133
|
+
icon: faTrash,
|
|
134
|
+
className: "nav-icon"
|
|
135
|
+
}), "Delete polygons"))), !!features?.features?.length && polygonControls), /*#__PURE__*/React.createElement(OffcanvasControls, {
|
|
136
136
|
show: showControls,
|
|
137
137
|
handleClose: handleCloseControls,
|
|
138
138
|
Controls: ScatterplotControls
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { faDroplet } from "@fortawesome/free-solid-svg-icons";
|
|
3
3
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
4
|
-
import Button from "react-bootstrap
|
|
5
|
-
import ButtonGroup from "react-bootstrap/ButtonGroup";
|
|
4
|
+
import { Button, ButtonGroup, OverlayTrigger, Tooltip } from "react-bootstrap";
|
|
6
5
|
import { formatNumerical } from "../../utils/string";
|
|
7
6
|
import { ObsmKeysList } from "../obsm-list/ObsmList";
|
|
8
7
|
export function Toolbox(_ref) {
|
|
@@ -13,13 +12,44 @@ export function Toolbox(_ref) {
|
|
|
13
12
|
} = _ref;
|
|
14
13
|
return /*#__PURE__*/React.createElement("div", {
|
|
15
14
|
className: "cherita-toolbox"
|
|
16
|
-
}, /*#__PURE__*/React.createElement(ButtonGroup, null, /*#__PURE__*/React.createElement(ObsmKeysList, null), /*#__PURE__*/React.createElement(
|
|
17
|
-
|
|
15
|
+
}, /*#__PURE__*/React.createElement(ButtonGroup, null, /*#__PURE__*/React.createElement(ObsmKeysList, null), mode && /*#__PURE__*/React.createElement(OverlayTrigger, {
|
|
16
|
+
placement: "top",
|
|
17
|
+
overlay: /*#__PURE__*/React.createElement(Tooltip, {
|
|
18
|
+
id: "tooltip-dropped-mode"
|
|
19
|
+
}, "The color scale is currently set to ", mode)
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
21
|
+
size: "sm",
|
|
22
|
+
variant: "primary",
|
|
23
|
+
style: {
|
|
24
|
+
cursor: "default"
|
|
25
|
+
},
|
|
26
|
+
"aria-disabled": "true"
|
|
18
27
|
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
19
|
-
icon: faDroplet
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
icon: faDroplet,
|
|
29
|
+
className: "me-1"
|
|
30
|
+
}), " ", mode)), (mode || !isNaN(obsLength)) && (mode !== null && !isNaN(slicedLength) && slicedLength !== obsLength ? /*#__PURE__*/React.createElement(OverlayTrigger, {
|
|
31
|
+
placement: "top",
|
|
32
|
+
overlay: /*#__PURE__*/React.createElement(Tooltip, {
|
|
33
|
+
id: "tooltip-dropped-mode"
|
|
34
|
+
}, "You have selected ", formatNumerical(slicedLength), " out of", " ", formatNumerical(obsLength), " cells")
|
|
35
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
36
|
+
size: "sm",
|
|
37
|
+
variant: "primary",
|
|
38
|
+
style: {
|
|
39
|
+
cursor: "default"
|
|
40
|
+
},
|
|
41
|
+
"aria-disabled": "true"
|
|
42
|
+
}, formatNumerical(slicedLength), " of ", formatNumerical(obsLength), " ", "cells")) : /*#__PURE__*/React.createElement(OverlayTrigger, {
|
|
43
|
+
placement: "top",
|
|
44
|
+
overlay: /*#__PURE__*/React.createElement(Tooltip, {
|
|
45
|
+
id: "tooltip-dropped-mode"
|
|
46
|
+
}, "You are viewing ", formatNumerical(obsLength), " cells")
|
|
47
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
48
|
+
size: "sm",
|
|
49
|
+
variant: "primary",
|
|
50
|
+
style: {
|
|
51
|
+
cursor: "default"
|
|
52
|
+
},
|
|
53
|
+
"aria-disabled": "true"
|
|
54
|
+
}, formatNumerical(obsLength), " cells")))));
|
|
25
55
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React, { useEffect,
|
|
1
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
2
|
+
import SearchIcon from "@mui/icons-material/Search";
|
|
2
3
|
import _ from "lodash";
|
|
3
|
-
import { Form, FormGroup,
|
|
4
|
+
import { Dropdown, Form, FormGroup, InputGroup } from "react-bootstrap";
|
|
4
5
|
import { DiseasesSearchResults, VarSearchResults } from "./SearchResults";
|
|
5
6
|
function onVarSelect(dispatch, item) {
|
|
6
7
|
dispatch({
|
|
@@ -31,11 +32,13 @@ export function SearchBar(_ref) {
|
|
|
31
32
|
setShowSuggestions(true);
|
|
32
33
|
}
|
|
33
34
|
}, [text]);
|
|
35
|
+
|
|
36
|
+
//@TODO: Abstract styles
|
|
34
37
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form, {
|
|
35
38
|
onSubmit: e => {
|
|
36
39
|
e.preventDefault();
|
|
37
40
|
}
|
|
38
|
-
}, /*#__PURE__*/React.createElement(FormGroup, null, /*#__PURE__*/React.createElement(Form.Control, {
|
|
41
|
+
}, /*#__PURE__*/React.createElement(FormGroup, null, /*#__PURE__*/React.createElement(InputGroup, null, /*#__PURE__*/React.createElement(Form.Control, {
|
|
39
42
|
ref: inputRef,
|
|
40
43
|
onFocus: () => {
|
|
41
44
|
setShowSuggestions(text.length > 0);
|
|
@@ -50,8 +53,21 @@ export function SearchBar(_ref) {
|
|
|
50
53
|
value: text,
|
|
51
54
|
onChange: e => {
|
|
52
55
|
setText(e.target.value);
|
|
56
|
+
},
|
|
57
|
+
style: {
|
|
58
|
+
paddingLeft: "2.5rem",
|
|
59
|
+
borderRadius: "5px"
|
|
60
|
+
}
|
|
61
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
style: {
|
|
63
|
+
position: "absolute",
|
|
64
|
+
left: "10px",
|
|
65
|
+
top: "50%",
|
|
66
|
+
transform: "translateY(-50%)",
|
|
67
|
+
pointerEvents: "none",
|
|
68
|
+
zIndex: 10
|
|
53
69
|
}
|
|
54
|
-
}), /*#__PURE__*/React.createElement(Dropdown, {
|
|
70
|
+
}, /*#__PURE__*/React.createElement(SearchIcon, null))), /*#__PURE__*/React.createElement(Dropdown, {
|
|
55
71
|
show: showSuggestions,
|
|
56
72
|
onMouseDown: e => {
|
|
57
73
|
e.preventDefault();
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { faTimes } from "@fortawesome/free-solid-svg-icons";
|
|
3
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
3
4
|
import _ from "lodash";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { VarListToolbar } from "./VarListToolbar";
|
|
7
|
-
import { VarSet } from "./VarSet";
|
|
5
|
+
import { Alert, Button, ListGroup } from "react-bootstrap";
|
|
6
|
+
import ButtonGroup from "react-bootstrap/ButtonGroup";
|
|
8
7
|
import { SELECTION_MODES, VAR_SORT } from "../../constants/constants";
|
|
9
8
|
import { useDataset, useDatasetDispatch } from "../../context/DatasetContext";
|
|
10
9
|
import { LoadingSpinner } from "../../utils/LoadingIndicators";
|
|
11
10
|
import { useFetch } from "../../utils/requests";
|
|
11
|
+
import { VarItem } from "./VarItem";
|
|
12
|
+
import { VarListToolbar } from "./VarListToolbar";
|
|
13
|
+
import { VarSet } from "./VarSet";
|
|
12
14
|
const useVarMean = function (varKeys) {
|
|
13
15
|
let enabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
14
16
|
const ENDPOINT = "matrix/mean";
|
|
@@ -101,19 +103,28 @@ function DiseaseVarList(_ref) {
|
|
|
101
103
|
}, /*#__PURE__*/React.createElement("h5", null, "Disease genes")), /*#__PURE__*/React.createElement(Alert, {
|
|
102
104
|
variant: "light"
|
|
103
105
|
}, "No disease genes found.")) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
104
|
-
className: "d-flex justify-content-between
|
|
105
|
-
}, /*#__PURE__*/React.createElement("h5", null, "Disease genes"), /*#__PURE__*/React.createElement(
|
|
106
|
-
|
|
106
|
+
className: "d-flex justify-content-between my-2"
|
|
107
|
+
}, /*#__PURE__*/React.createElement("h5", null, "Disease genes"), /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
108
|
+
"aria-label": "Feature options",
|
|
109
|
+
size: "sm"
|
|
110
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
111
|
+
variant: "info",
|
|
107
112
|
onClick: () => {
|
|
108
113
|
dispatch({
|
|
109
114
|
type: "reset.disease"
|
|
110
115
|
});
|
|
111
116
|
}
|
|
112
|
-
},
|
|
117
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
118
|
+
icon: faTimes,
|
|
119
|
+
className: "me-1"
|
|
120
|
+
}), "Clear"))), /*#__PURE__*/React.createElement("p", null, dataset.selectedDisease?.name), /*#__PURE__*/React.createElement(VarListToolbar, {
|
|
113
121
|
varType: "disease"
|
|
114
122
|
}), /*#__PURE__*/React.createElement("div", {
|
|
115
123
|
className: "position-relative"
|
|
116
|
-
}, isPending && /*#__PURE__*/React.createElement(LoadingSpinner, null), /*#__PURE__*/React.createElement(ListGroup,
|
|
124
|
+
}, isPending && /*#__PURE__*/React.createElement(LoadingSpinner, null), /*#__PURE__*/React.createElement(ListGroup, {
|
|
125
|
+
variant: "flush",
|
|
126
|
+
className: "cherita-list"
|
|
127
|
+
}, diseaseVarList)))));
|
|
117
128
|
}
|
|
118
129
|
export function VarNamesList(_ref2) {
|
|
119
130
|
let {
|
|
@@ -237,10 +248,12 @@ export function VarNamesList(_ref2) {
|
|
|
237
248
|
}, /*#__PURE__*/React.createElement("div", {
|
|
238
249
|
className: "overflow-auto mt-3"
|
|
239
250
|
}, /*#__PURE__*/React.createElement("div", {
|
|
240
|
-
className: "d-flex justify-content-between"
|
|
241
|
-
}, /*#__PURE__*/React.createElement("h5", null, _.capitalize(displayName)), /*#__PURE__*/React.createElement(
|
|
242
|
-
|
|
243
|
-
|
|
251
|
+
className: "d-flex justify-content-between mb-2"
|
|
252
|
+
}, /*#__PURE__*/React.createElement("h5", null, _.capitalize(displayName)), /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
253
|
+
"aria-label": "Feature options",
|
|
254
|
+
size: "sm"
|
|
255
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
256
|
+
variant: "info",
|
|
244
257
|
onClick: () => {
|
|
245
258
|
dispatch({
|
|
246
259
|
type: "add.varSet",
|
|
@@ -251,8 +264,8 @@ export function VarNamesList(_ref2) {
|
|
|
251
264
|
}
|
|
252
265
|
});
|
|
253
266
|
}
|
|
254
|
-
},
|
|
255
|
-
variant: "
|
|
267
|
+
}, "New set"), /*#__PURE__*/React.createElement(Button, {
|
|
268
|
+
variant: "info",
|
|
256
269
|
onClick: () => {
|
|
257
270
|
setVarButtons([]);
|
|
258
271
|
dispatch({
|
|
@@ -262,11 +275,17 @@ export function VarNamesList(_ref2) {
|
|
|
262
275
|
type: "reset.varSets"
|
|
263
276
|
});
|
|
264
277
|
}
|
|
265
|
-
},
|
|
278
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
279
|
+
icon: faTimes,
|
|
280
|
+
className: "me-1"
|
|
281
|
+
}), "Clear"))), /*#__PURE__*/React.createElement(React.Fragment, null, !varList.length ? /*#__PURE__*/React.createElement(Alert, {
|
|
266
282
|
variant: "light"
|
|
267
283
|
}, "Search for a feature.") : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(VarListToolbar, null), /*#__PURE__*/React.createElement("div", {
|
|
268
284
|
className: "position-relative"
|
|
269
|
-
}, isPending && /*#__PURE__*/React.createElement(LoadingSpinner, null), /*#__PURE__*/React.createElement(ListGroup,
|
|
285
|
+
}, isPending && /*#__PURE__*/React.createElement(LoadingSpinner, null), /*#__PURE__*/React.createElement(ListGroup, {
|
|
286
|
+
variant: "flush",
|
|
287
|
+
className: "cherita-list"
|
|
288
|
+
}, varList)))), /*#__PURE__*/React.createElement(React.Fragment, null, showDiseaseVarList && /*#__PURE__*/React.createElement(DiseaseVarList, {
|
|
270
289
|
makeListItem: makeListItem
|
|
271
290
|
}))));
|
|
272
291
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { faArrowDown19, faArrowDownAZ, faArrowUp91, faArrowUpZA, faXmark } from "@fortawesome/free-solid-svg-icons";
|
|
3
3
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
4
|
-
import { ToggleButton, ToggleButtonGroup } from "
|
|
5
|
-
import { Navbar, InputGroup } from "react-bootstrap";
|
|
4
|
+
import { ToggleButton, ToggleButtonGroup } from "react-bootstrap";
|
|
6
5
|
import { VAR_SORT, VAR_SORT_ORDER } from "../../constants/constants";
|
|
7
6
|
import { useDataset, useDatasetDispatch } from "../../context/DatasetContext";
|
|
8
7
|
|
|
@@ -36,13 +35,15 @@ export function VarListToolbar(_ref) {
|
|
|
36
35
|
});
|
|
37
36
|
}
|
|
38
37
|
};
|
|
39
|
-
return /*#__PURE__*/React.createElement(
|
|
40
|
-
className: "
|
|
41
|
-
}, /*#__PURE__*/React.createElement(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
className: "d-flex justify-content-end align-items-center mb-2"
|
|
40
|
+
}, /*#__PURE__*/React.createElement(ToggleButtonGroup, {
|
|
41
|
+
name: "sortfeatures",
|
|
42
|
+
"aria-label": "Sort features by",
|
|
43
|
+
size: "sm",
|
|
44
|
+
type: "radio"
|
|
45
45
|
}, /*#__PURE__*/React.createElement(ToggleButton, {
|
|
46
|
+
id: VAR_SORT.NAME,
|
|
46
47
|
value: VAR_SORT.NAME,
|
|
47
48
|
"aria-label": "alphabetical",
|
|
48
49
|
title: "Sort alphabetically",
|
|
@@ -55,6 +56,7 @@ export function VarListToolbar(_ref) {
|
|
|
55
56
|
}) : /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
56
57
|
icon: faArrowUpZA
|
|
57
58
|
})), /*#__PURE__*/React.createElement(ToggleButton, {
|
|
59
|
+
id: VAR_SORT.MATRIX,
|
|
58
60
|
value: VAR_SORT.MATRIX,
|
|
59
61
|
"aria-label": "matrix value",
|
|
60
62
|
title: "Sort by matrix value",
|
|
@@ -67,6 +69,7 @@ export function VarListToolbar(_ref) {
|
|
|
67
69
|
}) : /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
68
70
|
icon: faArrowUp91
|
|
69
71
|
})), /*#__PURE__*/React.createElement(ToggleButton, {
|
|
72
|
+
id: "none",
|
|
70
73
|
value: "none",
|
|
71
74
|
"aria-label": "none",
|
|
72
75
|
title: "No sorting",
|
|
@@ -80,5 +83,5 @@ export function VarListToolbar(_ref) {
|
|
|
80
83
|
}
|
|
81
84
|
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
82
85
|
icon: faXmark
|
|
83
|
-
}))))
|
|
86
|
+
}))));
|
|
84
87
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { faDroplet, faTrash
|
|
2
|
+
import { faCircleInfo, faDroplet, faTrash } from "@fortawesome/free-solid-svg-icons";
|
|
3
3
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
4
4
|
import { List } from "@mui/icons-material";
|
|
5
5
|
import _ from "lodash";
|
|
6
|
-
import {
|
|
7
|
-
import { SingleSelectionItem } from "./VarItem";
|
|
6
|
+
import { Button, Collapse, ListGroup, OverlayTrigger, Tooltip } from "react-bootstrap";
|
|
8
7
|
import { COLOR_ENCODINGS, SELECTION_MODES } from "../../constants/constants";
|
|
9
8
|
import { useDataset, useDatasetDispatch } from "../../context/DatasetContext";
|
|
10
9
|
import { SearchBar } from "../search-bar/SearchBar";
|
|
10
|
+
import { SingleSelectionItem } from "./VarItem";
|
|
11
11
|
|
|
12
12
|
// @TODO: add button to score genes and plot
|
|
13
13
|
|
|
@@ -89,7 +89,8 @@ function SingleSelectionSet(_ref) {
|
|
|
89
89
|
}), /*#__PURE__*/React.createElement("div", {
|
|
90
90
|
className: "mx-2"
|
|
91
91
|
}, /*#__PURE__*/React.createElement(ListGroup, {
|
|
92
|
-
variant: "flush"
|
|
92
|
+
variant: "flush",
|
|
93
|
+
className: "cherita-list"
|
|
93
94
|
}, varList)))));
|
|
94
95
|
}
|
|
95
96
|
function MultipleSelectionSet(_ref2) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Button, Placeholder } from "react-bootstrap";
|
|
2
|
+
export const ObsmKeysListBtn = () => {
|
|
3
|
+
return /*#__PURE__*/React.createElement(Placeholder, {
|
|
4
|
+
as: Button,
|
|
5
|
+
animation: "glow"
|
|
6
|
+
}, /*#__PURE__*/React.createElement(Placeholder, {
|
|
7
|
+
xs: 6,
|
|
8
|
+
style: {
|
|
9
|
+
width: "40px"
|
|
10
|
+
}
|
|
11
|
+
}));
|
|
12
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haniffalab/cherita-react",
|
|
3
|
-
"version": "1.0.0-dev.2025-
|
|
3
|
+
"version": "1.0.0-dev.2025-04-01.e61c9d78",
|
|
4
4
|
"author": "Haniffa Lab",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
"url": "https://github.com/haniffalab/cherita-react/issues"
|
|
125
125
|
},
|
|
126
126
|
"homepage": "https://github.com/haniffalab/cherita-react#readme",
|
|
127
|
-
"prereleaseSha": "
|
|
127
|
+
"prereleaseSha": "e61c9d78a509eca23cf7cc26b186ab973fc6e20e"
|
|
128
128
|
}
|