@weng-lab/genomebrowser-ui 0.2.2 → 0.2.3

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.
Files changed (54) hide show
  1. package/.env.local +1 -1
  2. package/dist/TrackSelect/Folders/biosamples/data/human.json.d.ts +57141 -57141
  3. package/dist/TrackSelect/Folders/biosamples/data/mouse.json.d.ts +10394 -10394
  4. package/dist/TrackSelect/Folders/genes/data/human.json.d.ts +7 -7
  5. package/dist/TrackSelect/Folders/genes/data/mouse.json.d.ts +7 -7
  6. package/dist/genomebrowser-ui.es.js +9 -5
  7. package/dist/genomebrowser-ui.es.js.map +1 -1
  8. package/eslint.config.js +30 -30
  9. package/index.html +14 -14
  10. package/package.json +1 -1
  11. package/src/TrackSelect/DataGrid/DataGridWrapper.tsx +137 -137
  12. package/src/TrackSelect/DataGrid/DefaultGroupingCell.tsx +64 -64
  13. package/src/TrackSelect/Dialogs/ClearDialog.tsx +63 -63
  14. package/src/TrackSelect/Dialogs/LimitDialog.tsx +33 -33
  15. package/src/TrackSelect/Dialogs/ResetDialog.tsx +43 -43
  16. package/src/TrackSelect/FolderList/Breadcrumb.tsx +38 -38
  17. package/src/TrackSelect/FolderList/FolderCard.tsx +51 -51
  18. package/src/TrackSelect/FolderList/FolderList.tsx +47 -47
  19. package/src/TrackSelect/Folders/NEW.md +929 -929
  20. package/src/TrackSelect/Folders/biosamples/data/formatBiosamples.go +254 -254
  21. package/src/TrackSelect/Folders/biosamples/data/human.json +57141 -57141
  22. package/src/TrackSelect/Folders/biosamples/data/mouse.json +10394 -10394
  23. package/src/TrackSelect/Folders/biosamples/human.ts +17 -17
  24. package/src/TrackSelect/Folders/biosamples/mouse.ts +17 -17
  25. package/src/TrackSelect/Folders/biosamples/shared/AssayToggle.tsx +78 -78
  26. package/src/TrackSelect/Folders/biosamples/shared/BiosampleGroupingCell.tsx +146 -146
  27. package/src/TrackSelect/Folders/biosamples/shared/BiosampleTreeItem.tsx +15 -15
  28. package/src/TrackSelect/Folders/biosamples/shared/columns.tsx +165 -165
  29. package/src/TrackSelect/Folders/biosamples/shared/constants.tsx +116 -116
  30. package/src/TrackSelect/Folders/biosamples/shared/createFolder.ts +116 -116
  31. package/src/TrackSelect/Folders/biosamples/shared/treeBuilder.ts +224 -224
  32. package/src/TrackSelect/Folders/biosamples/shared/types.ts +48 -48
  33. package/src/TrackSelect/Folders/genes/data/human.json +7 -7
  34. package/src/TrackSelect/Folders/genes/data/mouse.json +7 -7
  35. package/src/TrackSelect/Folders/genes/human.ts +16 -16
  36. package/src/TrackSelect/Folders/genes/mouse.ts +16 -16
  37. package/src/TrackSelect/Folders/genes/shared/columns.tsx +42 -42
  38. package/src/TrackSelect/Folders/genes/shared/createFolder.ts +68 -68
  39. package/src/TrackSelect/Folders/genes/shared/treeBuilder.ts +45 -45
  40. package/src/TrackSelect/Folders/genes/shared/types.ts +29 -29
  41. package/src/TrackSelect/Folders/index.ts +30 -30
  42. package/src/TrackSelect/Folders/types.ts +106 -106
  43. package/src/TrackSelect/TrackSelect.tsx +11 -7
  44. package/src/TrackSelect/TreeView/CustomTreeItem.tsx +214 -214
  45. package/src/TrackSelect/TreeView/TreeViewWrapper.tsx +145 -145
  46. package/src/TrackSelect/store.ts +117 -117
  47. package/src/TrackSelect/types.ts +121 -121
  48. package/src/lib.ts +13 -13
  49. package/src/vite-env.d.ts +1 -1
  50. package/test/main.tsx +369 -369
  51. package/tsconfig.app.json +25 -25
  52. package/tsconfig.json +7 -7
  53. package/tsconfig.node.json +25 -25
  54. package/vite.config.ts +66 -66
@@ -1,33 +1,33 @@
1
- import {
2
- Button,
3
- Dialog,
4
- DialogActions,
5
- DialogContent,
6
- DialogContentText,
7
- DialogTitle,
8
- } from "@mui/material";
9
-
10
- interface LimitDialogProps {
11
- open: boolean;
12
- onClose: () => void;
13
- maxTracks: number;
14
- }
15
-
16
- export function LimitDialog({ open, onClose, maxTracks }: LimitDialogProps) {
17
- return (
18
- <Dialog open={open} onClose={onClose}>
19
- <DialogTitle>Track Limit Reached</DialogTitle>
20
- <DialogContent>
21
- <DialogContentText>
22
- You can select up to {maxTracks} tracks at a time. Please remove a
23
- track before adding another.
24
- </DialogContentText>
25
- </DialogContent>
26
- <DialogActions>
27
- <Button onClick={onClose} autoFocus>
28
- OK
29
- </Button>
30
- </DialogActions>
31
- </Dialog>
32
- );
33
- }
1
+ import {
2
+ Button,
3
+ Dialog,
4
+ DialogActions,
5
+ DialogContent,
6
+ DialogContentText,
7
+ DialogTitle,
8
+ } from "@mui/material";
9
+
10
+ interface LimitDialogProps {
11
+ open: boolean;
12
+ onClose: () => void;
13
+ maxTracks: number;
14
+ }
15
+
16
+ export function LimitDialog({ open, onClose, maxTracks }: LimitDialogProps) {
17
+ return (
18
+ <Dialog open={open} onClose={onClose}>
19
+ <DialogTitle>Track Limit Reached</DialogTitle>
20
+ <DialogContent>
21
+ <DialogContentText>
22
+ You can select up to {maxTracks} tracks at a time. Please remove a
23
+ track before adding another.
24
+ </DialogContentText>
25
+ </DialogContent>
26
+ <DialogActions>
27
+ <Button onClick={onClose} autoFocus>
28
+ OK
29
+ </Button>
30
+ </DialogActions>
31
+ </Dialog>
32
+ );
33
+ }
@@ -1,43 +1,43 @@
1
- import {
2
- Button,
3
- Dialog,
4
- DialogActions,
5
- DialogContent,
6
- DialogContentText,
7
- DialogTitle,
8
- } from "@mui/material";
9
-
10
- interface ResetDialogProps {
11
- open: boolean;
12
- onClose: () => void;
13
- onConfirm: () => void;
14
- }
15
-
16
- export function ResetDialog({ open, onClose, onConfirm }: ResetDialogProps) {
17
- return (
18
- <Dialog open={open} onClose={onClose}>
19
- <DialogTitle
20
- sx={{
21
- bgcolor: "#0c184a",
22
- color: "white",
23
- fontWeight: "bold",
24
- }}
25
- >
26
- Reset to Default
27
- </DialogTitle>
28
- <DialogContent sx={{ mt: 2 }}>
29
- <DialogContentText>
30
- Are you sure you want to reset all selections to the default?
31
- </DialogContentText>
32
- </DialogContent>
33
- <DialogActions sx={{ justifyContent: "center", gap: 2, pb: 2 }}>
34
- <Button variant="contained" color="primary" onClick={onClose} autoFocus>
35
- Cancel
36
- </Button>
37
- <Button variant="outlined" color="secondary" onClick={onConfirm}>
38
- Reset
39
- </Button>
40
- </DialogActions>
41
- </Dialog>
42
- );
43
- }
1
+ import {
2
+ Button,
3
+ Dialog,
4
+ DialogActions,
5
+ DialogContent,
6
+ DialogContentText,
7
+ DialogTitle,
8
+ } from "@mui/material";
9
+
10
+ interface ResetDialogProps {
11
+ open: boolean;
12
+ onClose: () => void;
13
+ onConfirm: () => void;
14
+ }
15
+
16
+ export function ResetDialog({ open, onClose, onConfirm }: ResetDialogProps) {
17
+ return (
18
+ <Dialog open={open} onClose={onClose}>
19
+ <DialogTitle
20
+ sx={{
21
+ bgcolor: "#0c184a",
22
+ color: "white",
23
+ fontWeight: "bold",
24
+ }}
25
+ >
26
+ Reset to Default
27
+ </DialogTitle>
28
+ <DialogContent sx={{ mt: 2 }}>
29
+ <DialogContentText>
30
+ Are you sure you want to reset all selections to the default?
31
+ </DialogContentText>
32
+ </DialogContent>
33
+ <DialogActions sx={{ justifyContent: "center", gap: 2, pb: 2 }}>
34
+ <Button variant="contained" color="primary" onClick={onClose} autoFocus>
35
+ Cancel
36
+ </Button>
37
+ <Button variant="outlined" color="secondary" onClick={onConfirm}>
38
+ Reset
39
+ </Button>
40
+ </DialogActions>
41
+ </Dialog>
42
+ );
43
+ }
@@ -1,38 +1,38 @@
1
- import { Breadcrumbs, Link, Typography } from "@mui/material";
2
- import NavigateNextIcon from "@mui/icons-material/NavigateNext";
3
- import { FolderDefinition } from "../Folders/types";
4
-
5
- export interface BreadcrumbProps {
6
- currentFolder: FolderDefinition | null;
7
- onNavigateToRoot: () => void;
8
- }
9
-
10
- export function Breadcrumb({
11
- currentFolder,
12
- onNavigateToRoot,
13
- }: BreadcrumbProps) {
14
- return (
15
- <Breadcrumbs separator={<NavigateNextIcon fontSize="small" />}>
16
- {currentFolder ? (
17
- <Link
18
- component="button"
19
- variant="body1"
20
- onClick={onNavigateToRoot}
21
- underline="hover"
22
- sx={{ cursor: "pointer" }}
23
- >
24
- All Folders
25
- </Link>
26
- ) : (
27
- <Typography variant="body1" color="text.primary">
28
- All Folders
29
- </Typography>
30
- )}
31
- {currentFolder && (
32
- <Typography variant="body1" color="text.primary">
33
- {currentFolder.label}
34
- </Typography>
35
- )}
36
- </Breadcrumbs>
37
- );
38
- }
1
+ import { Breadcrumbs, Link, Typography } from "@mui/material";
2
+ import NavigateNextIcon from "@mui/icons-material/NavigateNext";
3
+ import { FolderDefinition } from "../Folders/types";
4
+
5
+ export interface BreadcrumbProps {
6
+ currentFolder: FolderDefinition | null;
7
+ onNavigateToRoot: () => void;
8
+ }
9
+
10
+ export function Breadcrumb({
11
+ currentFolder,
12
+ onNavigateToRoot,
13
+ }: BreadcrumbProps) {
14
+ return (
15
+ <Breadcrumbs separator={<NavigateNextIcon fontSize="small" />}>
16
+ {currentFolder ? (
17
+ <Link
18
+ component="button"
19
+ variant="body1"
20
+ onClick={onNavigateToRoot}
21
+ underline="hover"
22
+ sx={{ cursor: "pointer" }}
23
+ >
24
+ All Folders
25
+ </Link>
26
+ ) : (
27
+ <Typography variant="body1" color="text.primary">
28
+ All Folders
29
+ </Typography>
30
+ )}
31
+ {currentFolder && (
32
+ <Typography variant="body1" color="text.primary">
33
+ {currentFolder.label}
34
+ </Typography>
35
+ )}
36
+ </Breadcrumbs>
37
+ );
38
+ }
@@ -1,51 +1,51 @@
1
- import { Paper, Typography } from "@mui/material";
2
- import { FolderDefinition } from "../Folders/types";
3
-
4
- export interface FolderCardProps {
5
- folder: FolderDefinition;
6
- onClick: () => void;
7
- }
8
-
9
- export function FolderCard({ folder, onClick }: FolderCardProps) {
10
- return (
11
- <Paper
12
- elevation={1}
13
- onClick={onClick}
14
- onKeyDown={(e) => {
15
- if (e.key === "Enter" || e.key === " ") {
16
- e.preventDefault();
17
- onClick();
18
- }
19
- }}
20
- role="button"
21
- tabIndex={0}
22
- sx={{
23
- p: 3,
24
- cursor: "pointer",
25
- transition: "all 0.2s ease-in-out",
26
- "&:hover": {
27
- elevation: 3,
28
- boxShadow: 3,
29
- bgcolor: "action.hover",
30
- },
31
- "&:focus": {
32
- outline: "2px solid",
33
- outlineColor: "primary.main",
34
- outlineOffset: 2,
35
- },
36
- }}
37
- >
38
- <Typography variant="h6" gutterBottom>
39
- {folder.label}
40
- </Typography>
41
- {folder.description && (
42
- <Typography variant="body2" color="text.secondary" gutterBottom>
43
- {folder.description}
44
- </Typography>
45
- )}
46
- <Typography variant="caption" color="text.secondary">
47
- {folder.rowById.size.toLocaleString()} tracks available
48
- </Typography>
49
- </Paper>
50
- );
51
- }
1
+ import { Paper, Typography } from "@mui/material";
2
+ import { FolderDefinition } from "../Folders/types";
3
+
4
+ export interface FolderCardProps {
5
+ folder: FolderDefinition;
6
+ onClick: () => void;
7
+ }
8
+
9
+ export function FolderCard({ folder, onClick }: FolderCardProps) {
10
+ return (
11
+ <Paper
12
+ elevation={1}
13
+ onClick={onClick}
14
+ onKeyDown={(e) => {
15
+ if (e.key === "Enter" || e.key === " ") {
16
+ e.preventDefault();
17
+ onClick();
18
+ }
19
+ }}
20
+ role="button"
21
+ tabIndex={0}
22
+ sx={{
23
+ p: 3,
24
+ cursor: "pointer",
25
+ transition: "all 0.2s ease-in-out",
26
+ "&:hover": {
27
+ elevation: 3,
28
+ boxShadow: 3,
29
+ bgcolor: "action.hover",
30
+ },
31
+ "&:focus": {
32
+ outline: "2px solid",
33
+ outlineColor: "primary.main",
34
+ outlineOffset: 2,
35
+ },
36
+ }}
37
+ >
38
+ <Typography variant="h6" gutterBottom>
39
+ {folder.label}
40
+ </Typography>
41
+ {folder.description && (
42
+ <Typography variant="body2" color="text.secondary" gutterBottom>
43
+ {folder.description}
44
+ </Typography>
45
+ )}
46
+ <Typography variant="caption" color="text.secondary">
47
+ {folder.rowById.size.toLocaleString()} tracks available
48
+ </Typography>
49
+ </Paper>
50
+ );
51
+ }
@@ -1,47 +1,47 @@
1
- import { Paper, Stack, Typography } from "@mui/material";
2
- import { FolderDefinition } from "../Folders/types";
3
- import { FolderCard } from "./FolderCard";
4
-
5
- export interface FolderListProps {
6
- folders: FolderDefinition[];
7
- onFolderSelect: (folderId: string) => void;
8
- }
9
-
10
- export function FolderList({ folders, onFolderSelect }: FolderListProps) {
11
- if (folders.length === 0) {
12
- return (
13
- <Paper
14
- variant="outlined"
15
- sx={{
16
- height: 500,
17
- borderWidth: 2,
18
- }}
19
- >
20
- <Typography color="text.secondary" sx={{ p: 3 }}>
21
- No folders available
22
- </Typography>
23
- </Paper>
24
- );
25
- }
26
-
27
- return (
28
- <Paper
29
- variant="outlined"
30
- sx={{
31
- height: 500,
32
- overflow: "auto",
33
- borderWidth: 2,
34
- }}
35
- >
36
- <Stack spacing={2} sx={{ p: 2 }}>
37
- {folders.map((folder) => (
38
- <FolderCard
39
- key={folder.id}
40
- folder={folder}
41
- onClick={() => onFolderSelect(folder.id)}
42
- />
43
- ))}
44
- </Stack>
45
- </Paper>
46
- );
47
- }
1
+ import { Paper, Stack, Typography } from "@mui/material";
2
+ import { FolderDefinition } from "../Folders/types";
3
+ import { FolderCard } from "./FolderCard";
4
+
5
+ export interface FolderListProps {
6
+ folders: FolderDefinition[];
7
+ onFolderSelect: (folderId: string) => void;
8
+ }
9
+
10
+ export function FolderList({ folders, onFolderSelect }: FolderListProps) {
11
+ if (folders.length === 0) {
12
+ return (
13
+ <Paper
14
+ variant="outlined"
15
+ sx={{
16
+ height: 500,
17
+ borderWidth: 2,
18
+ }}
19
+ >
20
+ <Typography color="text.secondary" sx={{ p: 3 }}>
21
+ No folders available
22
+ </Typography>
23
+ </Paper>
24
+ );
25
+ }
26
+
27
+ return (
28
+ <Paper
29
+ variant="outlined"
30
+ sx={{
31
+ height: 500,
32
+ overflow: "auto",
33
+ borderWidth: 2,
34
+ }}
35
+ >
36
+ <Stack spacing={2} sx={{ p: 2 }}>
37
+ {folders.map((folder) => (
38
+ <FolderCard
39
+ key={folder.id}
40
+ folder={folder}
41
+ onClick={() => onFolderSelect(folder.id)}
42
+ />
43
+ ))}
44
+ </Stack>
45
+ </Paper>
46
+ );
47
+ }