loom-browser 0.0.5 → 0.0.7
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/loom-data-worker.js +10458 -0
- package/dist/loom-data-worker.min.js +2 -0
- package/dist/loom-data-worker.min.js.map +1 -0
- package/dist/loom-react.esm.js +1276 -318
- package/dist/loom-react.esm.min.js +1 -1
- package/dist/loom-react.esm.min.js.map +1 -1
- package/dist/loom-worker.js +10591 -0
- package/dist/loom-worker.min.js +2 -0
- package/dist/loom-worker.min.js.map +1 -0
- package/dist/loom.esm.js +8513 -7651
- package/dist/loom.esm.min.js +1 -1
- package/dist/loom.esm.min.js.map +1 -1
- package/dist/loom.js +8516 -7651
- package/dist/loom.min.js +1 -1
- package/dist/loom.min.js.map +1 -1
- package/dist/tsconfig.src.tsbuildinfo +1 -1
- package/dist/types/bigwig/index.d.ts +2 -5
- package/dist/types/dataSourceWorkerProvider.d.ts +79 -0
- package/dist/types/dataSources/bigWigDataSource.d.ts +1 -3
- package/dist/types/dataSources/featureSourceFactory.d.ts +1 -2
- package/dist/types/dataSources/gtxDataSource.d.ts +1 -3
- package/dist/types/dataSources/memoryDataSource.d.ts +32 -0
- package/dist/types/dataSources/textFeatureSource.d.ts +0 -4
- package/dist/types/genomeBrowser.d.ts +56 -1
- package/dist/types/gtx/index.d.ts +1 -4
- package/dist/types/headlessGenomeBrowser.d.ts +72 -3
- package/dist/types/index.d.ts +11 -4
- package/dist/types/mainThreadDataSourceProvider.d.ts +19 -0
- package/dist/types/react/GenomeBrowserContext.d.ts +3 -0
- package/dist/types/react/LoomBrowser.d.ts +15 -1
- package/dist/types/react/tracks/BedTrack.d.ts +8 -3
- package/dist/types/react/tracks/WigTrack.d.ts +6 -3
- package/dist/types/react/ui/Navbar.d.ts +4 -1
- package/dist/types/session.d.ts +0 -3
- package/dist/types/svgFeatureOverlay.d.ts +27 -0
- package/dist/types/tabix/index.d.ts +0 -3
- package/dist/types/trackRegistry.d.ts +1 -4
- package/dist/types/tracks/annotation/annotationRenderer.d.ts +4 -1
- package/dist/types/tracks/annotation/annotationTrackCanvas.d.ts +9 -6
- package/dist/types/tracks/axis/axisRenderer.d.ts +2 -8
- package/dist/types/tracks/axis/index.d.ts +1 -1
- package/dist/types/tracks/baseTrackCanvas.d.ts +7 -1
- package/dist/types/tracks/interaction/interactionRenderer.d.ts +4 -1
- package/dist/types/tracks/trackLabel.d.ts +22 -0
- package/dist/types/tracks/wig/wigTrackCanvas.d.ts +2 -0
- package/dist/types/types.d.ts +22 -1
- package/dist/types/worker/dataSourceRegistry.d.ts +33 -0
- package/dist/types/worker/dataSourceWorkerScript.d.ts +13 -0
- package/dist/types/worker/unifiedWorkerScript.d.ts +17 -0
- package/dist/types/worker/webDataSourceWorkerProvider.d.ts +59 -0
- package/dist/types/worker/webUnifiedWorkerProvider.d.ts +64 -0
- package/dist/types/worker/webWorkerPool.d.ts +64 -0
- package/dist/types/worker/workerPoolScript.d.ts +17 -0
- package/dist/types/workerDataSource.d.ts +32 -0
- package/dist/types/workerProvider.d.ts +10 -3
- package/package.json +3 -1
|
@@ -6,15 +6,12 @@
|
|
|
6
6
|
* by @gmod/bbi internally.
|
|
7
7
|
*/
|
|
8
8
|
import type { WigFeature, WindowFunction, Locus } from '../types';
|
|
9
|
-
import type { WorkerProvider } from '../workerProvider';
|
|
10
9
|
export { BinaryParser } from '../io/binaryParser';
|
|
11
10
|
export interface FetchBigWigOptions {
|
|
12
11
|
/** Resolution in base pairs per pixel. Used to select an appropriate zoom level. */
|
|
13
12
|
bpPerPixel?: number;
|
|
14
13
|
/** Aggregation function for zoom-level data. Default: 'mean'. */
|
|
15
14
|
windowFunction?: WindowFunction;
|
|
16
|
-
/** @deprecated Worker dispatch is handled internally by @gmod/bbi. */
|
|
17
|
-
workerProvider?: WorkerProvider;
|
|
18
15
|
/** AbortSignal for cancelling in-flight HTTP requests. */
|
|
19
16
|
signal?: AbortSignal;
|
|
20
17
|
}
|
|
@@ -47,7 +44,7 @@ export interface BigWigTotalSummary {
|
|
|
47
44
|
*/
|
|
48
45
|
export declare class BigWigReader {
|
|
49
46
|
private readonly bw;
|
|
50
|
-
constructor(url: string
|
|
47
|
+
constructor(url: string);
|
|
51
48
|
loadHeader(signal?: AbortSignal): Promise<BigWigHeader>;
|
|
52
49
|
getTotalSummary(signal?: AbortSignal): Promise<BigWigTotalSummary | undefined>;
|
|
53
50
|
readFeatures(chr: string, bpStart: number, bpEnd: number, bpPerPixel?: number, windowFunction?: WindowFunction, signal?: AbortSignal): Promise<WigFeature[]>;
|
|
@@ -61,6 +58,6 @@ export declare function fetchBigWigFeatures(url: string, locus: Locus, options?:
|
|
|
61
58
|
* Fetch BigWig features across all specified chromosomes for whole genome view.
|
|
62
59
|
* Returns features with per-chromosome coordinates (caller transforms to genome-wide).
|
|
63
60
|
*/
|
|
64
|
-
export declare function fetchBigWigWGFeatures(url: string, chromNames: string[], bpPerPixel: number, options?: Pick<FetchBigWigOptions, 'windowFunction' | '
|
|
61
|
+
export declare function fetchBigWigWGFeatures(url: string, chromNames: string[], bpPerPixel: number, options?: Pick<FetchBigWigOptions, 'windowFunction' | 'signal'>): Promise<WigFeature[]>;
|
|
65
62
|
/** Clear the BigWig reader cache (useful for testing or memory management). */
|
|
66
63
|
export declare function clearBigWigCache(): void;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataSourceWorkerProvider — manages long-lived DataSource instances inside workers.
|
|
3
|
+
*
|
|
4
|
+
* Unlike the stateless WorkerProvider (fire-and-forget tasks), this provider
|
|
5
|
+
* creates persistent DataSource instances in workers that cache parsed headers,
|
|
6
|
+
* indices, and reader state across fetch calls.
|
|
7
|
+
*
|
|
8
|
+
* Inspired by JBrowse 2's RPC adapter system (GMOD/jbrowse-components).
|
|
9
|
+
*
|
|
10
|
+
* Layer 1 (Data + Layout): no DOM.
|
|
11
|
+
*/
|
|
12
|
+
import type { DataSourceConfig, Locus } from './types';
|
|
13
|
+
/** Main thread → Worker messages. */
|
|
14
|
+
export type DataSourceWorkerRequest = {
|
|
15
|
+
type: 'create';
|
|
16
|
+
instanceId: string;
|
|
17
|
+
config: DataSourceConfig;
|
|
18
|
+
} | {
|
|
19
|
+
type: 'fetch';
|
|
20
|
+
instanceId: string;
|
|
21
|
+
fetchId: number;
|
|
22
|
+
locus: Locus;
|
|
23
|
+
bpPerPixel: number;
|
|
24
|
+
} | {
|
|
25
|
+
type: 'configure';
|
|
26
|
+
instanceId: string;
|
|
27
|
+
method: string;
|
|
28
|
+
args: unknown[];
|
|
29
|
+
} | {
|
|
30
|
+
type: 'cancel';
|
|
31
|
+
fetchId: number;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'destroy';
|
|
34
|
+
instanceId: string;
|
|
35
|
+
};
|
|
36
|
+
/** Worker → Main thread messages. */
|
|
37
|
+
export type DataSourceWorkerResponse = {
|
|
38
|
+
type: 'ready';
|
|
39
|
+
} | {
|
|
40
|
+
type: 'fetchResult';
|
|
41
|
+
fetchId: number;
|
|
42
|
+
features: unknown[];
|
|
43
|
+
} | {
|
|
44
|
+
type: 'fetchError';
|
|
45
|
+
fetchId: number;
|
|
46
|
+
error: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Manages DataSource instances that live inside web workers.
|
|
50
|
+
*
|
|
51
|
+
* Each DataSource is identified by a unique `instanceId` (assigned by the caller).
|
|
52
|
+
* The provider routes messages to the correct worker using sticky routing
|
|
53
|
+
* (same URL → same worker) to preserve reader caches.
|
|
54
|
+
*/
|
|
55
|
+
export interface DataSourceWorkerProvider {
|
|
56
|
+
/**
|
|
57
|
+
* Create a DataSource instance inside a worker.
|
|
58
|
+
* The instance persists until `destroy()` is called.
|
|
59
|
+
*/
|
|
60
|
+
create(instanceId: string, config: DataSourceConfig): void;
|
|
61
|
+
/**
|
|
62
|
+
* Fetch features from a worker-resident DataSource.
|
|
63
|
+
* Supports cancellation via AbortSignal → cancel message.
|
|
64
|
+
*/
|
|
65
|
+
fetch<F>(instanceId: string, locus: Locus, bpPerPixel: number, signal: AbortSignal): Promise<F[]>;
|
|
66
|
+
/**
|
|
67
|
+
* Send a configuration update to a worker-resident DataSource.
|
|
68
|
+
* Used for serializable setter calls like setCumulativeOffsets, setWindowFunction.
|
|
69
|
+
*/
|
|
70
|
+
configure(instanceId: string, method: string, ...args: unknown[]): void;
|
|
71
|
+
/**
|
|
72
|
+
* Destroy a worker-resident DataSource instance.
|
|
73
|
+
*/
|
|
74
|
+
destroy(instanceId: string): void;
|
|
75
|
+
/**
|
|
76
|
+
* Shut down all workers and release resources.
|
|
77
|
+
*/
|
|
78
|
+
dispose(): void;
|
|
79
|
+
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import type { DataSource, Locus, WigFeature, WindowFunction } from '../types';
|
|
2
|
-
import type { WorkerProvider } from '../workerProvider';
|
|
3
2
|
import type { CumulativeOffsets } from '../genome/chromSizes';
|
|
4
3
|
export declare class BigWigDataSource implements DataSource<WigFeature> {
|
|
5
4
|
private url;
|
|
6
5
|
private _windowFunction;
|
|
7
|
-
private workerProvider?;
|
|
8
6
|
private _cumulativeOffsets?;
|
|
9
7
|
private _resolveChromName?;
|
|
10
|
-
constructor(url: string, windowFunction?: WindowFunction
|
|
8
|
+
constructor(url: string, windowFunction?: WindowFunction);
|
|
11
9
|
get windowFunction(): WindowFunction;
|
|
12
10
|
/** Update the window function for future fetches. */
|
|
13
11
|
setWindowFunction(wf: WindowFunction): void;
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
* Layer 1 (Data + Layout): no DOM.
|
|
11
11
|
*/
|
|
12
12
|
import type { DataSource } from '../types';
|
|
13
|
-
import type { WorkerProvider } from '../workerProvider';
|
|
14
13
|
export interface FeatureSourceConfig {
|
|
15
14
|
/** URL to the data file. */
|
|
16
15
|
url: string;
|
|
@@ -43,4 +42,4 @@ export interface FeatureSourceResult {
|
|
|
43
42
|
*
|
|
44
43
|
* Port of js/feature/featureSource.ts factory routing logic.
|
|
45
44
|
*/
|
|
46
|
-
export declare function createFeatureSource(config: FeatureSourceConfig
|
|
45
|
+
export declare function createFeatureSource(config: FeatureSourceConfig): FeatureSourceResult;
|
|
@@ -16,17 +16,15 @@
|
|
|
16
16
|
* Layer 1 (Data + Layout): no DOM, no canvas.
|
|
17
17
|
*/
|
|
18
18
|
import type { DataSource, Locus, WigFeature, WindowFunction } from '../types';
|
|
19
|
-
import type { WorkerProvider } from '../workerProvider';
|
|
20
19
|
import type { CumulativeOffsets } from '../genome/chromSizes';
|
|
21
20
|
export declare class GtxDataSource implements DataSource<WigFeature> {
|
|
22
21
|
private url;
|
|
23
22
|
private experimentId;
|
|
24
23
|
private _windowFunction;
|
|
25
|
-
private workerProvider?;
|
|
26
24
|
private _cumulativeOffsets?;
|
|
27
25
|
private _resolveChromName?;
|
|
28
26
|
private reader;
|
|
29
|
-
constructor(url: string, experimentId: string, windowFunction?: WindowFunction
|
|
27
|
+
constructor(url: string, experimentId: string, windowFunction?: WindowFunction);
|
|
30
28
|
get windowFunction(): WindowFunction;
|
|
31
29
|
/** Update the window function for future fetches. */
|
|
32
30
|
setWindowFunction(wf: WindowFunction): void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataSource backed by an in-memory feature array.
|
|
3
|
+
*
|
|
4
|
+
* Wraps a pre-loaded feature array in a FeatureCache for spatial queries,
|
|
5
|
+
* enabling inline features to flow through the same data lifecycle as
|
|
6
|
+
* URL-based data sources.
|
|
7
|
+
*
|
|
8
|
+
* Layer 1 (Data + Layout): no DOM, no canvas.
|
|
9
|
+
*/
|
|
10
|
+
import type { DataSource, Locus } from '../types';
|
|
11
|
+
import type { CacheableFeature } from '../featureCache';
|
|
12
|
+
import type { CumulativeOffsets } from '../genome/chromSizes';
|
|
13
|
+
/**
|
|
14
|
+
* DataSource that serves features from an in-memory array.
|
|
15
|
+
*
|
|
16
|
+
* Features are indexed in a FeatureCache on construction for efficient
|
|
17
|
+
* spatial queries. Calling `setFeatures()` replaces the cache entirely.
|
|
18
|
+
*/
|
|
19
|
+
export declare class MemoryDataSource<F extends CacheableFeature = CacheableFeature> implements DataSource<F> {
|
|
20
|
+
private cache;
|
|
21
|
+
private _resolveChromName?;
|
|
22
|
+
private _cumulativeOffsets?;
|
|
23
|
+
constructor(features: F[]);
|
|
24
|
+
/** Replace the in-memory features and rebuild the spatial index. */
|
|
25
|
+
setFeatures(features: F[]): void;
|
|
26
|
+
/** Set a chromosome name resolver for alias resolution. */
|
|
27
|
+
setChromNameResolver(resolver: (chr: string) => string): void;
|
|
28
|
+
/** Set cumulative offsets for whole genome view coordinate transformation. */
|
|
29
|
+
setCumulativeOffsets(offsets: CumulativeOffsets): void;
|
|
30
|
+
fetch(locus: Locus, _bpPerPixel: number, _signal: AbortSignal): Promise<F[]>;
|
|
31
|
+
private fetchWG;
|
|
32
|
+
}
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
import type { DataSource, Locus, TextFileFormat } from '../types';
|
|
14
14
|
import type { CacheableFeature } from '../featureCache';
|
|
15
15
|
import type { CumulativeOffsets } from '../genome/chromSizes';
|
|
16
|
-
import type { WorkerProvider } from '../workerProvider';
|
|
17
16
|
export interface TextFeatureSourceConfig {
|
|
18
17
|
/** URL to the data file. */
|
|
19
18
|
url: string;
|
|
@@ -25,8 +24,6 @@ export interface TextFeatureSourceConfig {
|
|
|
25
24
|
indexed?: boolean;
|
|
26
25
|
/** For GFF: whether to assemble transcript models. Default: true. */
|
|
27
26
|
assembleGFF?: boolean;
|
|
28
|
-
/** Worker provider for offloading CPU-intensive tasks. */
|
|
29
|
-
workerProvider?: WorkerProvider;
|
|
30
27
|
}
|
|
31
28
|
/**
|
|
32
29
|
* DataSource for text-based genomic feature files.
|
|
@@ -39,7 +36,6 @@ export declare class TextFeatureSource<F extends CacheableFeature = CacheableFea
|
|
|
39
36
|
private readonly format;
|
|
40
37
|
private readonly assembleGFF;
|
|
41
38
|
private readonly _indexed;
|
|
42
|
-
private readonly workerProvider?;
|
|
43
39
|
private _resolveChromName?;
|
|
44
40
|
private _cumulativeOffsets?;
|
|
45
41
|
private tabixReader?;
|
|
@@ -32,6 +32,48 @@ export interface GenomeBrowserOptions extends HeadlessGenomeBrowserOptions {
|
|
|
32
32
|
interactive?: boolean;
|
|
33
33
|
/** Enable trackpad pinch and scroll-wheel zoom. Default: true when interactive. */
|
|
34
34
|
wheelZoom?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Auto-create a unified web worker pool for off-main-thread tasks and data fetching.
|
|
37
|
+
* - `true`: create a pool with `navigator.hardwareConcurrency` workers (capped at 4)
|
|
38
|
+
* - `number`: create a pool with that many workers
|
|
39
|
+
* - `false` / `undefined`: no auto-created workers (main-thread fallback)
|
|
40
|
+
*
|
|
41
|
+
* Ignored when `workerProvider` is explicitly passed.
|
|
42
|
+
*
|
|
43
|
+
* Uses `import.meta.url` to resolve the worker script. If worker creation
|
|
44
|
+
* fails (e.g. due to CSP or bundler issues), falls back silently to
|
|
45
|
+
* main-thread execution.
|
|
46
|
+
*
|
|
47
|
+
* For bundler users who need custom worker instantiation, pass
|
|
48
|
+
* `workerFactory` instead (see example below).
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* // Simple — auto-detect pool size:
|
|
53
|
+
* new GenomeBrowser(container, { locus, workers: true })
|
|
54
|
+
*
|
|
55
|
+
* // Explicit pool size:
|
|
56
|
+
* new GenomeBrowser(container, { locus, workers: 2 })
|
|
57
|
+
*
|
|
58
|
+
* // Bundler users (webpack 5, Vite) — custom factory:
|
|
59
|
+
* new GenomeBrowser(container, {
|
|
60
|
+
* locus,
|
|
61
|
+
* workerFactory: () => new Worker(
|
|
62
|
+
* new URL('loom/dist/loom-worker.js', import.meta.url)
|
|
63
|
+
* ),
|
|
64
|
+
* })
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
workers?: boolean | number;
|
|
68
|
+
/**
|
|
69
|
+
* Factory function that creates Worker instances for the worker pool.
|
|
70
|
+
* Use this with bundlers (webpack 5, Vite) that require the
|
|
71
|
+
* `new Worker(new URL(...))` pattern.
|
|
72
|
+
*
|
|
73
|
+
* Ignored when `workerProvider` is explicitly passed.
|
|
74
|
+
* When set, `workers` defaults to `true` (pool size = hardwareConcurrency, capped at 4).
|
|
75
|
+
*/
|
|
76
|
+
workerFactory?: () => Worker;
|
|
35
77
|
}
|
|
36
78
|
export declare class GenomeBrowser extends HeadlessGenomeBrowser {
|
|
37
79
|
private container;
|
|
@@ -69,9 +111,16 @@ export declare class GenomeBrowser extends HeadlessGenomeBrowser {
|
|
|
69
111
|
private wheelRafId;
|
|
70
112
|
private roiOverlayContainer;
|
|
71
113
|
private roiElements;
|
|
114
|
+
private featureOverlays;
|
|
115
|
+
/** Worker provider auto-created by `workers` option. Disposed on cleanup. */
|
|
116
|
+
private ownedWorkerProvider;
|
|
72
117
|
constructor(container: HTMLElement, options: GenomeBrowserOptions);
|
|
118
|
+
/** Build a DOM row for a track (axis column + viewport wrapper). */
|
|
119
|
+
private _buildTrackRow;
|
|
120
|
+
/** Post-registration UI setup for a track row (axis content, cursors, drag handlers). */
|
|
121
|
+
private _setupTrackRowUI;
|
|
73
122
|
/** Add a track and attach its canvas to the container. */
|
|
74
|
-
addTrack<F>(track: Track, dataSource?: DataSource<F>, dataSourceConfig?: DataSourceConfig, maxTrackHeight?: number): string;
|
|
123
|
+
addTrack<F>(track: Track, dataSource?: DataSource<F>, dataSourceConfig?: DataSourceConfig, maxTrackHeight?: number, order?: number): string;
|
|
75
124
|
/** Remove a track and its row from the container. */
|
|
76
125
|
removeTrack(trackOrId: Track | string): void;
|
|
77
126
|
/** Move a track and reorder the DOM rows to match. */
|
|
@@ -121,6 +170,8 @@ export declare class GenomeBrowser extends HeadlessGenomeBrowser {
|
|
|
121
170
|
private teardownHoverHandlers;
|
|
122
171
|
private setupContextMenuHandler;
|
|
123
172
|
private teardownContextMenuHandler;
|
|
173
|
+
/** Sync DOM after any sort (addTrack, addGeneTrack, etc.). */
|
|
174
|
+
protected onTracksSorted(): void;
|
|
124
175
|
/** Reorder DOM rows to match managedTracks order. */
|
|
125
176
|
private syncDOMOrder;
|
|
126
177
|
/** Set up drag-to-reorder pointer handlers on an axis div. */
|
|
@@ -147,6 +198,10 @@ export declare class GenomeBrowser extends HeadlessGenomeBrowser {
|
|
|
147
198
|
* DOM-based (not canvas) for easy hover/click interaction without
|
|
148
199
|
* re-rendering track canvases.
|
|
149
200
|
*/
|
|
201
|
+
/** Update all feature overlays after render. */
|
|
202
|
+
private updateFeatureOverlays;
|
|
203
|
+
/** Update the feature overlay for a single track. */
|
|
204
|
+
private updateFeatureOverlay;
|
|
150
205
|
private renderROIOverlays;
|
|
151
206
|
/** Create a styled DOM element for an ROI region. */
|
|
152
207
|
private createROIElement;
|
|
@@ -11,14 +11,11 @@
|
|
|
11
11
|
export { GtxReader } from './gtxReader';
|
|
12
12
|
export type { GtxHeader, ChromEntry, ExperimentEntry } from './gtxReader';
|
|
13
13
|
import type { WigFeature, WindowFunction, Locus } from '../types';
|
|
14
|
-
import type { WorkerProvider } from '../workerProvider';
|
|
15
14
|
export interface FetchGtxOptions {
|
|
16
15
|
/** Resolution in base pairs per pixel. Used to select an appropriate zoom level. */
|
|
17
16
|
bpPerPixel?: number;
|
|
18
17
|
/** Aggregation function for zoom-level data. Default: 'mean'. */
|
|
19
18
|
windowFunction?: WindowFunction;
|
|
20
|
-
/** Worker provider for offloading decode work (reserved for future use). */
|
|
21
|
-
workerProvider?: WorkerProvider;
|
|
22
19
|
/** AbortSignal for cancelling in-flight HTTP requests. */
|
|
23
20
|
signal?: AbortSignal;
|
|
24
21
|
}
|
|
@@ -30,7 +27,7 @@ export declare function fetchGtxFeatures(url: string, experimentId: string, locu
|
|
|
30
27
|
* Fetch GTX features across all specified chromosomes for whole genome view.
|
|
31
28
|
* Returns features with per-chromosome coordinates (caller transforms to genome-wide).
|
|
32
29
|
*/
|
|
33
|
-
export declare function fetchGtxWGFeatures(url: string, experimentId: string, chromNames: string[], bpPerPixel: number, options?: Pick<FetchGtxOptions, 'windowFunction' | '
|
|
30
|
+
export declare function fetchGtxWGFeatures(url: string, experimentId: string, chromNames: string[], bpPerPixel: number, options?: Pick<FetchGtxOptions, 'windowFunction' | 'signal'>): Promise<WigFeature[]>;
|
|
34
31
|
/**
|
|
35
32
|
* Fetch GTX features for multiple experiments simultaneously.
|
|
36
33
|
* Optimizes network by merging byte ranges for experiments in the same tiles.
|
|
@@ -16,10 +16,11 @@
|
|
|
16
16
|
* browser.setLocus({ chr: 'chr17', start: 7670000, end: 7680000 })
|
|
17
17
|
* browser.dispose()
|
|
18
18
|
*/
|
|
19
|
-
import type { Locus, Track, DataSource, FeatureCacheEntry, SessionConfig, TrackSessionConfig, DataSourceConfig, TrackInteractionEvent, TrackContextMenuEvent, WindowFunction, WigRenderConfig, AnnotationRenderConfig, RulerRenderConfig, SequenceRenderConfig, InteractionRenderConfig, TextFileFormat, SequenceProvider, Genome, ROI, ROISetConfig, ROIInteractionEvent } from './types';
|
|
19
|
+
import type { Locus, Track, DataSource, FeatureCacheEntry, SessionConfig, TrackSessionConfig, DataSourceConfig, TrackInteractionEvent, TrackContextMenuEvent, WindowFunction, WigFeature, AnnotationFeature, WigRenderConfig, AnnotationRenderConfig, RulerRenderConfig, SequenceRenderConfig, InteractionRenderConfig, TextFileFormat, SequenceProvider, Genome, ROI, ROISetConfig, ROIInteractionEvent } from './types';
|
|
20
20
|
import { ROISet } from './roi/roiSet';
|
|
21
21
|
import type { CanvasProvider } from './canvasProvider';
|
|
22
22
|
import type { WorkerProvider } from './workerProvider';
|
|
23
|
+
import type { DataSourceWorkerProvider } from './dataSourceWorkerProvider';
|
|
23
24
|
import type { PopupProvider } from './popupProvider';
|
|
24
25
|
import type { ContextMenuProvider } from './contextMenuProvider';
|
|
25
26
|
import type { RenderTheme } from './themes/renderTheme';
|
|
@@ -122,7 +123,9 @@ export interface HeadlessGenomeBrowserOptions {
|
|
|
122
123
|
viewportWidth?: number;
|
|
123
124
|
/** Canvas provider for environment abstraction. Default: DOMCanvasProvider. */
|
|
124
125
|
canvasProvider?: CanvasProvider;
|
|
125
|
-
/** Worker provider for offloading CPU-intensive tasks. Default: main-thread execution.
|
|
126
|
+
/** Worker provider for offloading CPU-intensive tasks. Default: main-thread execution.
|
|
127
|
+
* If this also implements DataSourceWorkerProvider (e.g. WebWorkerPool),
|
|
128
|
+
* it will be used for data fetching automatically. */
|
|
126
129
|
workerProvider?: WorkerProvider;
|
|
127
130
|
/** Popup provider for rendering feature popups on click/hover. Default in GenomeBrowser: DefaultPopupProvider. Pass null to disable. */
|
|
128
131
|
popupProvider?: PopupProvider | null;
|
|
@@ -231,6 +234,32 @@ export interface AddAnnotationTrackOptions {
|
|
|
231
234
|
/** Arbitrary key-value metadata (e.g., assay, biosample, tissue). */
|
|
232
235
|
metadata?: Record<string, string>;
|
|
233
236
|
}
|
|
237
|
+
export interface AddWigTrackWithFeaturesOptions {
|
|
238
|
+
config?: Partial<WigRenderConfig>;
|
|
239
|
+
/** Fixed pixel height (overrides config.height). */
|
|
240
|
+
height?: number;
|
|
241
|
+
/** Background color. */
|
|
242
|
+
background?: string;
|
|
243
|
+
/** Max visible height — enables scrollable container in DOM browser. */
|
|
244
|
+
maxTrackHeight?: number;
|
|
245
|
+
/** Track name for axis label. */
|
|
246
|
+
name?: string;
|
|
247
|
+
/** Arbitrary key-value metadata (e.g., assay, biosample, tissue). */
|
|
248
|
+
metadata?: Record<string, string>;
|
|
249
|
+
}
|
|
250
|
+
export interface AddBedTrackWithFeaturesOptions {
|
|
251
|
+
config?: Partial<AnnotationRenderConfig>;
|
|
252
|
+
/** Fixed pixel height. */
|
|
253
|
+
height?: number;
|
|
254
|
+
/** Background color. */
|
|
255
|
+
background?: string;
|
|
256
|
+
/** Max visible height — enables scrollable container in DOM browser. */
|
|
257
|
+
maxTrackHeight?: number;
|
|
258
|
+
/** Track name for axis label. */
|
|
259
|
+
name?: string;
|
|
260
|
+
/** Arbitrary key-value metadata (e.g., assay, biosample, tissue). */
|
|
261
|
+
metadata?: Record<string, string>;
|
|
262
|
+
}
|
|
234
263
|
export declare class HeadlessGenomeBrowser {
|
|
235
264
|
protected _locus: Locus;
|
|
236
265
|
protected _viewportWidth: number;
|
|
@@ -238,10 +267,16 @@ export declare class HeadlessGenomeBrowser {
|
|
|
238
267
|
protected roiSets: ROISet[];
|
|
239
268
|
/** Inflight fetch promises keyed by (cacheKey + fetchRegion + bpPerPixel) for deduplication. */
|
|
240
269
|
private inflightFetches;
|
|
270
|
+
/** Timer for debouncing data loads during rapid zoom/pan. */
|
|
271
|
+
private loadDebounceTimer;
|
|
272
|
+
/** When true, sortTracks() is a no-op. Used for batch track additions (e.g. loadSession). */
|
|
273
|
+
private _deferSort;
|
|
241
274
|
/** Canvas provider for environment abstraction. Available for convenience API / future use. */
|
|
242
275
|
readonly canvasProvider: CanvasProvider;
|
|
243
276
|
/** Worker provider for offloading CPU-intensive tasks. */
|
|
244
277
|
readonly workerProvider?: WorkerProvider;
|
|
278
|
+
/** Data source worker provider for running DataSources in web workers. */
|
|
279
|
+
readonly dataSourceWorkerProvider?: DataSourceWorkerProvider;
|
|
245
280
|
/** Popup provider for rendering feature popups on click/hover. */
|
|
246
281
|
readonly popupProvider?: PopupProvider;
|
|
247
282
|
/** Context menu provider for right-click menus. */
|
|
@@ -267,6 +302,11 @@ export declare class HeadlessGenomeBrowser {
|
|
|
267
302
|
/** Agent-friendly state projection manager. Lazily created on first access. */
|
|
268
303
|
get state(): StateProjection;
|
|
269
304
|
constructor(options: HeadlessGenomeBrowserOptions);
|
|
305
|
+
/**
|
|
306
|
+
* Create a WorkerDataSource proxy for worker-eligible configs, or return null
|
|
307
|
+
* if dataSourceWorkerProvider is not set. Handles create + chrom alias + offsets wiring.
|
|
308
|
+
*/
|
|
309
|
+
private createWorkerDataSource;
|
|
270
310
|
/** Clamp a locus to valid chromosome bounds. No-op if chromSizes is not set. */
|
|
271
311
|
protected clamp(locus: Locus): Locus;
|
|
272
312
|
/** Subscribe to a browser event. Returns an unsubscribe function. */
|
|
@@ -280,7 +320,7 @@ export declare class HeadlessGenomeBrowser {
|
|
|
280
320
|
*/
|
|
281
321
|
setViewportWidth(width: number): void;
|
|
282
322
|
/** Add a track with an optional data source for automatic data management. */
|
|
283
|
-
addTrack<F>(track: Track, dataSource?: DataSource<F>, dataSourceConfig?: DataSourceConfig, maxTrackHeight?: number): string;
|
|
323
|
+
addTrack<F>(track: Track, dataSource?: DataSource<F>, dataSourceConfig?: DataSourceConfig, maxTrackHeight?: number, order?: number): string;
|
|
284
324
|
/** Remove a track by reference or by stable string ID. */
|
|
285
325
|
removeTrack(trackOrId: Track | string): void;
|
|
286
326
|
/**
|
|
@@ -288,6 +328,22 @@ export declare class HeadlessGenomeBrowser {
|
|
|
288
328
|
* Emits BrowserEvent.TrackOrderChanged with the new track order.
|
|
289
329
|
*/
|
|
290
330
|
moveTrack(track: Track, toIndex: number): void;
|
|
331
|
+
/**
|
|
332
|
+
* Sort tracks by priority (descending): positive = top, 0 = middle, negative = bottom.
|
|
333
|
+
* Priority comes from the track type default + per-track `order` override.
|
|
334
|
+
* Within the same effective priority, insertion order is preserved (stable sort).
|
|
335
|
+
*/
|
|
336
|
+
private sortTracks;
|
|
337
|
+
/** Hook for subclasses to react to track order changes (e.g., DOM reorder). */
|
|
338
|
+
protected onTracksSorted(): void;
|
|
339
|
+
/**
|
|
340
|
+
* Persist current array positions into mt.order so future sorts preserve
|
|
341
|
+
* manual reordering. Uses descending values (top track = highest) scaled
|
|
342
|
+
* above the type-priority range so explicit order dominates.
|
|
343
|
+
*/
|
|
344
|
+
protected _assignOrderFromPosition(): void;
|
|
345
|
+
/** Find the ManagedTrack entry for a given track canvas. */
|
|
346
|
+
private findMT;
|
|
291
347
|
/** Get the current track order. */
|
|
292
348
|
getTrackOrder(): Track[];
|
|
293
349
|
/** Find a managed track by its stable string ID. Returns undefined if not found. */
|
|
@@ -434,6 +490,12 @@ export declare class HeadlessGenomeBrowser {
|
|
|
434
490
|
addBedTrack(url: string, options?: AddBedTrackOptions): AnnotationTrackCanvas;
|
|
435
491
|
/** Add an interaction (arc/BEDPE) track from a URL. */
|
|
436
492
|
addInteractionTrack(url: string, options?: AddInteractionTrackOptions): InteractionTrackCanvas;
|
|
493
|
+
/** Add a BigWig-style signal track backed by in-memory features (no URL required). */
|
|
494
|
+
addWigTrackWithFeatures(features: WigFeature[], options?: AddWigTrackWithFeaturesOptions): WigTrackCanvas;
|
|
495
|
+
/** Add a BED/annotation track backed by in-memory features (no URL required). Features must include `chr`. */
|
|
496
|
+
addBedTrackWithFeatures(features: (AnnotationFeature & {
|
|
497
|
+
chr: string;
|
|
498
|
+
})[], options?: AddBedTrackWithFeaturesOptions): AnnotationTrackCanvas;
|
|
437
499
|
/** Add a DNA/RNA sequence track. Data fetching is handled automatically via the genome's sequence provider. */
|
|
438
500
|
addSequenceTrack(options?: AddSequenceTrackOptions): SequenceTrackCanvas;
|
|
439
501
|
/** Apply a new render theme to the browser and all existing tracks. */
|
|
@@ -446,6 +508,13 @@ export declare class HeadlessGenomeBrowser {
|
|
|
446
508
|
* Returns null if the track has no features at the given point.
|
|
447
509
|
*/
|
|
448
510
|
protected resolveInteraction(track: Track, x: number, y: number): TrackInteractionEvent | null;
|
|
511
|
+
/**
|
|
512
|
+
* Debounced wrapper around loadAllTracksIfNeeded.
|
|
513
|
+
* During rapid zoom/pan, this coalesces multiple setLocus() calls into a
|
|
514
|
+
* single data fetch cycle after the interaction settles (100ms quiet period).
|
|
515
|
+
* Abort in-flight requests immediately so they don't race with the eventual fetch.
|
|
516
|
+
*/
|
|
517
|
+
private debouncedLoad;
|
|
449
518
|
protected loadAllTracksIfNeeded(): void;
|
|
450
519
|
/**
|
|
451
520
|
* Load data for a single track, deduplicating against inflight fetches
|
package/dist/types/index.d.ts
CHANGED
|
@@ -10,7 +10,13 @@ export { MainThreadProvider, mainThreadProvider } from './workerProvider';
|
|
|
10
10
|
export { WebWorkerProvider } from './worker/webWorkerProvider';
|
|
11
11
|
export type { WebWorkerProviderOptions } from './worker/webWorkerProvider';
|
|
12
12
|
export { NodeWorkerProvider } from './worker/nodeWorkerProvider';
|
|
13
|
+
export type { DataSourceWorkerProvider, DataSourceWorkerRequest, DataSourceWorkerResponse } from './dataSourceWorkerProvider';
|
|
14
|
+
export { WorkerDataSource } from './workerDataSource';
|
|
15
|
+
export { WebWorkerPool } from './worker/webWorkerPool';
|
|
16
|
+
export type { WebWorkerPoolOptions } from './worker/webWorkerPool';
|
|
13
17
|
export { BaseTrackCanvas } from './tracks/baseTrackCanvas';
|
|
18
|
+
export { renderTrackNameLabel } from './tracks/trackLabel';
|
|
19
|
+
export type { TrackNameLabelOptions } from './tracks/trackLabel';
|
|
14
20
|
export type { AnnotationFeature, Exon, AnnotationRenderConfig, RenderContext, DisplayMode, Locus, Track, RulerRenderConfig, AxisInfo, TrackFeatureSummary, WigFeatureSummary, AnnotationFeatureSummary, InteractionFeatureSummary } from './types';
|
|
15
21
|
export type { WigFeature, WigRenderConfig, WigColorValue, WigGraphType, WindowFunction, WigGuideLine } from './types';
|
|
16
22
|
export type { SequenceRenderConfig, SequenceType, SequenceTrackSessionConfig, SequenceSessionOverrides } from './types';
|
|
@@ -18,8 +24,8 @@ export { defaultSequenceRenderConfig } from './types';
|
|
|
18
24
|
export type { InteractionFeature, InteractionRenderConfig, ArcOrientation, ArcDisplayMode, InteractionTrackSessionConfig, InteractionSessionOverrides } from './types';
|
|
19
25
|
export { defaultInteractionRenderConfig } from './types';
|
|
20
26
|
export type { DataSource, FeatureCacheEntry, DataDrivenTrack } from './types';
|
|
21
|
-
export type { PopupDataItem, HitTestResult, TrackInteractionEvent, ContextMenuItem, TrackContextMenuEvent, NumericState, ROI, ROISetConfig, ROIInteractionEvent } from './types';
|
|
22
|
-
export type { SessionConfig, TrackSessionConfig, WigTrackSessionConfig, AnnotationTrackSessionConfig, RulerTrackSessionConfig, WigSessionOverrides, AnnotationSessionOverrides, RulerSessionOverrides, DataSourceConfig, BigWigDataSourceConfig, GtxDataSourceConfig, UCSCDataSourceConfig, TextDataSourceConfig, SequenceProvider, IgvSessionObject, IgvReferenceConfig, IgvTrackConfig, Chromosome, Genome, GenomeConfig, ChromAliasRecord, Strand, TextFileFormat, BedFeature, PeakFeature, BedGraphFeature, GFFRecord, GFFFeature, TextFeature, } from './types';
|
|
27
|
+
export type { PopupDataItem, HitTestResult, TrackInteractionEvent, ContextMenuItem, TrackContextMenuEvent, NumericState, ROI, ROISetConfig, ROIInteractionEvent, FeatureRect } from './types';
|
|
28
|
+
export type { SessionConfig, TrackSessionConfig, WigTrackSessionConfig, AnnotationTrackSessionConfig, RulerTrackSessionConfig, WigSessionOverrides, AnnotationSessionOverrides, RulerSessionOverrides, DataSourceConfig, BigWigDataSourceConfig, GtxDataSourceConfig, UCSCDataSourceConfig, TextDataSourceConfig, MemoryDataSourceConfig, SequenceProvider, IgvSessionObject, IgvReferenceConfig, IgvTrackConfig, Chromosome, Genome, GenomeConfig, ChromAliasRecord, Strand, TextFileFormat, BedFeature, PeakFeature, BedGraphFeature, GFFRecord, GFFFeature, TextFeature, } from './types';
|
|
23
29
|
export { defaultAnnotationRenderConfig, defaultRulerRenderConfig, defaultWigRenderConfig } from './types';
|
|
24
30
|
export type { Packable } from './pack';
|
|
25
31
|
export { packFeatures } from './pack';
|
|
@@ -30,13 +36,13 @@ export { renderRulerTrack, renderWholeGenomeRuler } from './tracks/ruler/rulerRe
|
|
|
30
36
|
export type { WholeGenomeRulerContext } from './tracks/ruler/rulerRenderer';
|
|
31
37
|
export { RulerTrackCanvas } from './tracks/ruler/rulerTrackCanvas';
|
|
32
38
|
export type { RulerTrackCanvasOptions } from './tracks/ruler/rulerTrackCanvas';
|
|
33
|
-
export { renderQuantitativeAxis,
|
|
39
|
+
export { renderQuantitativeAxis, prettyPrintNumber } from './tracks/axis/axisRenderer';
|
|
34
40
|
export { renderWigTrack } from './tracks/wig/wigRenderer';
|
|
35
41
|
export { WigTrackCanvas } from './tracks/wig/wigTrackCanvas';
|
|
36
42
|
export type { WigTrackCanvasOptions } from './tracks/wig/wigTrackCanvas';
|
|
37
43
|
export { summarizeWigData, computeWigDataRange } from './tracks/wig/wigSummary';
|
|
38
44
|
export { HeadlessGenomeBrowser, BrowserEvent } from './headlessGenomeBrowser';
|
|
39
|
-
export type { HeadlessGenomeBrowserOptions, ManagedTrack, AddRulerOptions, AddWigTrackOptions, AddGtxTrackOptions, AddBedTrackOptions, AddAnnotationTrackOptions, AddInteractionTrackOptions, AddSequenceTrackOptions } from './headlessGenomeBrowser';
|
|
45
|
+
export type { HeadlessGenomeBrowserOptions, ManagedTrack, AddRulerOptions, AddWigTrackOptions, AddGtxTrackOptions, AddBedTrackOptions, AddAnnotationTrackOptions, AddInteractionTrackOptions, AddSequenceTrackOptions, AddWigTrackWithFeaturesOptions, AddBedTrackWithFeaturesOptions } from './headlessGenomeBrowser';
|
|
40
46
|
export { GenomeBrowser } from './genomeBrowser';
|
|
41
47
|
export type { GenomeBrowserOptions, BrowserEvents } from './genomeBrowser';
|
|
42
48
|
export type { ChromSizes, CumulativeOffsets } from './genome/chromSizes';
|
|
@@ -92,6 +98,7 @@ export { GeneDataSource } from './dataSources/geneDataSource';
|
|
|
92
98
|
export { TextFeatureSource } from './dataSources/textFeatureSource';
|
|
93
99
|
export type { TextFeatureSourceConfig } from './dataSources/textFeatureSource';
|
|
94
100
|
export { SequenceDataSource } from './dataSources/sequenceDataSource';
|
|
101
|
+
export { MemoryDataSource } from './dataSources/memoryDataSource';
|
|
95
102
|
export { createFeatureSource } from './dataSources/featureSourceFactory';
|
|
96
103
|
export type { FeatureSourceConfig, FeatureSourceResult } from './dataSources/featureSourceFactory';
|
|
97
104
|
export { dataSourceCacheKey } from './dataSources/dataSourceCacheKey';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MainThreadDataSourceProvider — fallback DataSourceWorkerProvider that runs
|
|
3
|
+
* DataSources directly on the main thread with no serialization overhead.
|
|
4
|
+
*
|
|
5
|
+
* Analogous to JBrowse 2's MainThreadRpcDriver.
|
|
6
|
+
* Used when web workers are unavailable or for debugging.
|
|
7
|
+
*
|
|
8
|
+
* Layer 1 (Data + Layout): no DOM.
|
|
9
|
+
*/
|
|
10
|
+
import type { DataSourceWorkerProvider } from './dataSourceWorkerProvider';
|
|
11
|
+
import type { DataSourceConfig, Locus } from './types';
|
|
12
|
+
export declare class MainThreadDataSourceProvider implements DataSourceWorkerProvider {
|
|
13
|
+
private readonly instances;
|
|
14
|
+
create(instanceId: string, config: DataSourceConfig): void;
|
|
15
|
+
fetch<F>(instanceId: string, locus: Locus, bpPerPixel: number, signal: AbortSignal): Promise<F[]>;
|
|
16
|
+
configure(instanceId: string, method: string, ...args: unknown[]): void;
|
|
17
|
+
destroy(instanceId: string): void;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { GenomeBrowser } from '../genomeBrowser';
|
|
2
|
+
import type { ShellTheme } from '../ui/themes';
|
|
2
3
|
export interface GenomeBrowserContextValue {
|
|
3
4
|
/** The underlying GenomeBrowser instance. null before initialization or during SSR. */
|
|
4
5
|
browser: GenomeBrowser | null;
|
|
6
|
+
/** Inferred shell theme for UI components. */
|
|
7
|
+
shellTheme: ShellTheme;
|
|
5
8
|
}
|
|
6
9
|
export declare const GenomeBrowserContext: import("react").Context<GenomeBrowserContextValue | null>;
|
|
@@ -25,7 +25,21 @@ export interface LoomBrowserProps {
|
|
|
25
25
|
interactive?: boolean;
|
|
26
26
|
/** Enable wheel zoom. Default: true. */
|
|
27
27
|
wheelZoom?: boolean;
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Auto-create a unified web worker pool. `true` for auto pool size,
|
|
30
|
+
* or a number for explicit pool size. See GenomeBrowserOptions.workers.
|
|
31
|
+
*/
|
|
32
|
+
workers?: boolean | number;
|
|
33
|
+
/**
|
|
34
|
+
* Factory for custom worker instantiation (webpack 5, Vite).
|
|
35
|
+
* See GenomeBrowserOptions.workerFactory.
|
|
36
|
+
*/
|
|
37
|
+
workerFactory?: () => Worker;
|
|
38
|
+
/**
|
|
39
|
+
* Worker provider for off-main-thread tasks.
|
|
40
|
+
* If this also implements DataSourceWorkerProvider (e.g. WebWorkerPool),
|
|
41
|
+
* it will be used for data fetching automatically.
|
|
42
|
+
*/
|
|
29
43
|
workerProvider?: WorkerProvider;
|
|
30
44
|
/** Popup provider. Pass null to disable. */
|
|
31
45
|
popupProvider?: PopupProvider | null;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import type { AnnotationRenderConfig, TextFileFormat } from '../../types';
|
|
1
|
+
import type { AnnotationFeature, AnnotationRenderConfig, TextFileFormat } from '../../types';
|
|
2
2
|
export interface BedTrackProps {
|
|
3
|
-
|
|
3
|
+
/** URL to a BED/peak file. Mutually exclusive with `features`. */
|
|
4
|
+
url?: string;
|
|
5
|
+
/** In-memory annotation features. Mutually exclusive with `url`. Features must include `chr`. */
|
|
6
|
+
features?: (AnnotationFeature & {
|
|
7
|
+
chr: string;
|
|
8
|
+
})[];
|
|
4
9
|
config?: Partial<AnnotationRenderConfig>;
|
|
5
10
|
height?: number;
|
|
6
11
|
background?: string;
|
|
@@ -11,4 +16,4 @@ export interface BedTrackProps {
|
|
|
11
16
|
name?: string;
|
|
12
17
|
metadata?: Record<string, string>;
|
|
13
18
|
}
|
|
14
|
-
export declare function BedTrack({ url, config, height, background, format, indexURL, indexed, maxTrackHeight, name, metadata }: BedTrackProps): null;
|
|
19
|
+
export declare function BedTrack({ url, features, config, height, background, format, indexURL, indexed, maxTrackHeight, name, metadata }: BedTrackProps): null;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import type { WigRenderConfig, WindowFunction } from '../../types';
|
|
1
|
+
import type { WigFeature, WigRenderConfig, WindowFunction } from '../../types';
|
|
2
2
|
export interface WigTrackProps {
|
|
3
|
-
|
|
3
|
+
/** URL to a BigWig file. Mutually exclusive with `features`. */
|
|
4
|
+
url?: string;
|
|
5
|
+
/** In-memory wig features. Mutually exclusive with `url`. */
|
|
6
|
+
features?: WigFeature[];
|
|
4
7
|
config?: Partial<WigRenderConfig>;
|
|
5
8
|
height?: number;
|
|
6
9
|
background?: string;
|
|
@@ -9,4 +12,4 @@ export interface WigTrackProps {
|
|
|
9
12
|
name?: string;
|
|
10
13
|
metadata?: Record<string, string>;
|
|
11
14
|
}
|
|
12
|
-
export declare function WigTrack({ url, config, height, background, windowFunction, maxTrackHeight, name, metadata }: WigTrackProps): null;
|
|
15
|
+
export declare function WigTrack({ url, features, config, height, background, windowFunction, maxTrackHeight, name, metadata }: WigTrackProps): null;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { GenomeBrowser } from '../../genomeBrowser';
|
|
2
|
+
import type { ShellTheme } from '../../ui/themes';
|
|
2
3
|
import './types';
|
|
3
4
|
export interface NavbarProps {
|
|
4
5
|
/** Override the browser from context. */
|
|
5
6
|
browser?: GenomeBrowser | null;
|
|
7
|
+
/** Override the shell theme. By default, inferred from the parent LoomBrowser's render theme. */
|
|
8
|
+
theme?: ShellTheme;
|
|
6
9
|
}
|
|
7
|
-
export declare function Navbar({ browser: browserProp }: NavbarProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function Navbar({ browser: browserProp, theme: themeProp }: NavbarProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/types/session.d.ts
CHANGED
|
@@ -15,13 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { SessionConfig, TrackSessionConfig, IgvSessionObject, Locus, SequenceProvider } from './types';
|
|
17
17
|
import type { CanvasProvider } from './canvasProvider';
|
|
18
|
-
import type { WorkerProvider } from './workerProvider';
|
|
19
18
|
import type { RenderTheme } from './themes/renderTheme';
|
|
20
19
|
export type { CreatedTrack } from './trackRegistry';
|
|
21
20
|
export declare const SESSION_VERSION = "1.0";
|
|
22
21
|
export interface CreateDataSourceOptions {
|
|
23
|
-
/** Worker provider for offloading CPU-intensive tasks in data sources. */
|
|
24
|
-
workerProvider?: WorkerProvider;
|
|
25
22
|
}
|
|
26
23
|
/**
|
|
27
24
|
* @deprecated Use the track registry (`createTrackFromConfig`) instead, which
|