@weng-lab/genomebrowser-ui 0.1.9 → 0.1.11

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 (35) hide show
  1. package/dist/TrackSelect/Data/{modifiedHumanTracks.json.d.ts → humanBiosamples.json.d.ts} +40705 -20804
  2. package/dist/TrackSelect/Data/mouseBiosamples.json.d.ts +10346 -0
  3. package/dist/TrackSelect/DataGrid/GroupingCell.d.ts +2 -0
  4. package/dist/TrackSelect/DataGrid/dataGridHelpers.d.ts +25 -6
  5. package/dist/TrackSelect/TrackSelect.d.ts +4 -1
  6. package/dist/TrackSelect/TreeView/treeViewHelpers.d.ts +1 -1
  7. package/dist/TrackSelect/consts.d.ts +6 -17
  8. package/dist/TrackSelect/store.d.ts +2 -1
  9. package/dist/TrackSelect/types.d.ts +5 -0
  10. package/dist/genomebrowser-ui.es.js +1173 -951
  11. package/dist/genomebrowser-ui.es.js.map +1 -1
  12. package/dist/lib.d.ts +0 -2
  13. package/package.json +2 -2
  14. package/src/TrackSelect/Data/formatBiosamples.go +254 -0
  15. package/src/TrackSelect/Data/{modifiedHumanTracks.json → humanBiosamples.json} +40704 -20804
  16. package/src/TrackSelect/Data/mouseBiosamples.json +10343 -0
  17. package/src/TrackSelect/DataGrid/DataGridWrapper.tsx +13 -6
  18. package/src/TrackSelect/DataGrid/GroupingCell.tsx +144 -0
  19. package/src/TrackSelect/DataGrid/columns.tsx +7 -0
  20. package/src/TrackSelect/DataGrid/dataGridHelpers.tsx +64 -19
  21. package/src/TrackSelect/TrackSelect.tsx +86 -27
  22. package/src/TrackSelect/TreeView/TreeViewWrapper.tsx +1 -1
  23. package/src/TrackSelect/TreeView/treeViewHelpers.tsx +65 -17
  24. package/src/TrackSelect/consts.ts +30 -30
  25. package/src/TrackSelect/issues.md +404 -0
  26. package/src/TrackSelect/store.ts +16 -6
  27. package/src/TrackSelect/types.ts +8 -0
  28. package/src/lib.ts +0 -3
  29. package/test/main.tsx +399 -17
  30. package/dist/TrackSelect/treeViewHelpers.d.ts +0 -1
  31. package/src/TrackSelect/.claude/settings.local.json +0 -7
  32. package/src/TrackSelect/Data/humanTracks.json +0 -35711
  33. package/src/TrackSelect/Data/human_chromhmm_biosamples_with_all_urls.json +0 -35716
  34. package/src/TrackSelect/bug.md +0 -4
  35. package/src/TrackSelect/treeViewHelpers.tsx +0 -0
@@ -0,0 +1,2 @@
1
+ import { GridRenderCellParams } from '@mui/x-data-grid-premium';
2
+ export default function GroupingCell(params: GridRenderCellParams): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,28 @@
1
1
  import { FuseResult } from 'fuse.js';
2
2
  import { RowInfo, SearchTracksProps, TrackInfo } from '../types';
3
- export declare function getTracksByAssayAndOntology(assay: string, ontology: string): TrackInfo[];
4
- /** Flatten TrackInfo or FuseResult into RowInfo for DataGrid display.
5
- * @param track TrackInfo object or FuseResult containing information from JSON file
6
- * @returns Flattened RowInfo object
3
+ import { Assembly } from '../consts';
4
+ export declare function getTracksData(assembly: Assembly): {
5
+ tracks: {
6
+ name: string;
7
+ ontology: string;
8
+ lifeStage: string;
9
+ sampleType: string;
10
+ displayname: string;
11
+ assays: {
12
+ id: string;
13
+ assay: string;
14
+ url: string;
15
+ experimentAccession: string;
16
+ fileAccession: string;
17
+ }[];
18
+ }[];
19
+ };
20
+ export declare function getTracksByAssayAndOntology(assay: string, ontology: string, tracksData: ReturnType<typeof getTracksData>): TrackInfo[];
21
+ /** Flatten TrackInfo into RowInfo objects for DataGrid display.
22
+ * @param track TrackInfo object containing information from JSON file
23
+ * @returns Array of flattened RowInfo objects, one per assay
7
24
  */
8
- export declare function flattenIntoRow(track: TrackInfo): RowInfo;
25
+ export declare function flattenIntoRows(track: TrackInfo): RowInfo[];
9
26
  /**
10
27
  * Fuzzy search in tracks stored in a JSON file.
11
28
  *
@@ -27,4 +44,6 @@ export declare function flattenIntoRow(track: TrackInfo): RowInfo;
27
44
  * @param limit - (Optional) Maximum number of results to return (default is 10).
28
45
  * @returns FuseResult object containing the search results.
29
46
  */
30
- export declare function searchTracks({ jsonStructure, query, keyWeightMap, threshold, }: SearchTracksProps): FuseResult<TrackInfo>[];
47
+ export declare function searchTracks({ jsonStructure, query, keyWeightMap, threshold, tracksData, }: SearchTracksProps & {
48
+ tracksData: ReturnType<typeof getTracksData>;
49
+ }): FuseResult<TrackInfo>[];
@@ -1,5 +1,8 @@
1
1
  import { SelectionStoreInstance } from './store';
2
2
  export interface TrackSelectProps {
3
3
  store: SelectionStoreInstance;
4
+ onSubmit?: (trackIds: Set<string>) => void;
5
+ onCancel?: () => void;
6
+ onReset?: () => void;
4
7
  }
5
- export default function TrackSelect({ store }: TrackSelectProps): import("react/jsx-runtime").JSX.Element;
8
+ export default function TrackSelect({ store, onSubmit, onCancel, onReset, }: TrackSelectProps): import("react/jsx-runtime").JSX.Element;
@@ -39,7 +39,7 @@ export declare function buildTreeView(selectedIds: string[], root: TreeViewBaseI
39
39
  * @param limit - (Optional) Maximum number of results to return (default is 10).
40
40
  * @returns FuseResult object containing the search results.
41
41
  */
42
- export declare function searchTreeItems({ treeItems, query, keyWeightMap, threshold, limit }: SearchTracksProps): FuseResult<RowInfo>[];
42
+ export declare function searchTreeItems({ treeItems, query, keyWeightMap, threshold, limit, }: SearchTracksProps): FuseResult<RowInfo>[];
43
43
  /**
44
44
  * Creates the assay icon for DataGrid and RichTreeView
45
45
  * @param type: assay type
@@ -1,22 +1,11 @@
1
1
  import { RowInfo } from './types';
2
+ export type Assembly = "GRCh38" | "mm10";
2
3
  export declare const assayTypes: string[];
3
4
  export declare const ontologyTypes: string[];
4
- export declare const rows: {
5
- assay: string;
6
- ontology: string;
7
- lifeStage: string;
8
- sampleType: string;
9
- displayname: string;
10
- experimentAccession: string;
11
- fileAccession: string;
12
- url: string;
13
- }[];
14
- export declare const rowById: Map<string, RowInfo>;
15
5
  /**
16
- * Check if an ID is a real track (exists in rowById) vs an auto-generated group ID
6
+ * Build rows and rowById for a specific assembly
17
7
  */
18
- export declare const isTrackId: (id: string) => boolean;
19
- /**
20
- * Filter a set of IDs to return only real track IDs (no auto-generated group IDs)
21
- */
22
- export declare const getActiveTracks: (selectedIds: Set<string>) => Set<string>;
8
+ export declare function buildRowsForAssembly(assembly: Assembly): {
9
+ rows: RowInfo[];
10
+ rowById: Map<string, RowInfo>;
11
+ };
@@ -1,4 +1,5 @@
1
1
  import { StoreApi, UseBoundStore } from 'zustand';
2
+ import { Assembly } from './consts';
2
3
  import { SelectionAction, SelectionState } from './types';
3
4
  export type SelectionStoreInstance = UseBoundStore<StoreApi<SelectionState & SelectionAction>>;
4
- export declare function createSelectionStore(initialIds?: Set<string>): UseBoundStore<StoreApi<SelectionState & SelectionAction>>;
5
+ export declare function createSelectionStore(assembly: Assembly, initialIds?: Set<string>): UseBoundStore<StoreApi<SelectionState & SelectionAction>>;
@@ -17,6 +17,7 @@ export interface SearchTracksProps {
17
17
  * Types for the JSON-formatted tracks fomr modifiedHumanTracks.json
18
18
  */
19
19
  export type AssayInfo = {
20
+ id: string;
20
21
  assay: string;
21
22
  url: string;
22
23
  experimentAccession: string;
@@ -34,6 +35,7 @@ export type TrackInfo = {
34
35
  * Row format for DataGrid
35
36
  */
36
37
  export type RowInfo = {
38
+ id: string;
37
39
  ontology: string;
38
40
  lifeStage: string;
39
41
  sampleType: string;
@@ -83,6 +85,9 @@ export interface CustomTreeItemProps extends Omit<UseTreeItemParameters, "rootRe
83
85
  */
84
86
  export type SelectionState = {
85
87
  maxTracks: number;
88
+ assembly: string;
89
+ rows: RowInfo[];
90
+ rowById: Map<string, RowInfo>;
86
91
  selectedIds: Set<string>;
87
92
  };
88
93
  export type SelectionAction = {