@weng-lab/genomebrowser 1.6.2 → 1.7.0-beta

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.
@@ -1,5 +1,9 @@
1
1
  import { DataStoreInstance } from '../store/dataStore';
2
2
  import { ApolloError } from '@apollo/client';
3
+ /**
4
+ * Hook to inject custom data into the data store
5
+ * This allows using external data sources instead of the default fetching
6
+ */
3
7
  export default function useCustomData(trackId: string, response: {
4
8
  data: any;
5
9
  error: ApolloError | undefined;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Unified data fetcher hook that orchestrates fetching for all tracks
3
+ * This replaces the DataFetcher component with a cleaner hook-based approach
4
+ */
5
+ export declare function useDataFetcher(): void;
@@ -1,11 +1,18 @@
1
- import { ApolloError } from '@apollo/client';
1
+ export type TrackDataState<T = any> = {
2
+ data: T | null;
3
+ error: string | null;
4
+ };
2
5
  export interface DataStore {
3
- data: Map<string, any>;
4
- loading: boolean;
5
- fetching: boolean;
6
- setDataById: (id: string, data: any, error: ApolloError | undefined) => void;
7
- setLoading: (loading: boolean) => void;
8
- setFetching: (fetching: boolean) => void;
6
+ trackData: Map<string, TrackDataState>;
7
+ isFetching: boolean;
8
+ setTrackData: (id: string, state: TrackDataState) => void;
9
+ setMultipleTrackData: (updates: Array<{
10
+ id: string;
11
+ state: TrackDataState;
12
+ }>) => void;
13
+ setFetching: (isFetching: boolean) => void;
14
+ reset: () => void;
15
+ getTrackData: (id: string) => TrackDataState | undefined;
9
16
  }
10
17
  export type DataStoreInstance = ReturnType<typeof createDataStoreInternal>;
11
18
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weng-lab/genomebrowser",
3
3
  "private": false,
4
- "version": "1.6.2",
4
+ "version": "1.7.0-beta",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "files": [
@@ -11,6 +11,8 @@
11
11
  "types": "dist/lib.d.ts",
12
12
  "dependencies": {
13
13
  "@apollo/client": "^3.14.0",
14
+ "axios": "0.18.1",
15
+ "bigwig-reader": "^1.3.1",
14
16
  "graphql": "^16.11.0",
15
17
  "logo-test": "^0.0.5",
16
18
  "react-colorful": "^5.6.1",
@@ -33,6 +35,7 @@
33
35
  "@vitejs/plugin-react": "^4.7.0",
34
36
  "@vitest/browser": "^3.2.4",
35
37
  "@vitest/coverage-v8": "^3.2.4",
38
+ "buffer": "^6.0.3",
36
39
  "eslint": "^9.34.0",
37
40
  "eslint-plugin-react-hooks": "^5.2.0",
38
41
  "eslint-plugin-react-refresh": "^0.4.20",
@@ -1,2 +0,0 @@
1
- declare function DataFetcher(): null;
2
- export default DataFetcher;
File without changes
File without changes
File without changes
File without changes