loom-browser 0.0.10 → 0.0.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.
- package/dist/loom-react.esm.js +14 -7
- package/dist/loom-react.esm.min.js +1 -1
- package/dist/loom-react.esm.min.js.map +1 -1
- package/dist/loom.esm.js +14 -7
- package/dist/loom.esm.min.js +1 -1
- package/dist/loom.esm.min.js.map +1 -1
- package/dist/loom.js +14 -7
- 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/browser/headless/trackDataManager.d.ts +6 -1
- package/dist/types/react/tracks/BedTrack.d.ts +7 -7
- package/package.json +1 -1
|
@@ -33,8 +33,13 @@ export declare class TrackDataManager {
|
|
|
33
33
|
* During rapid zoom/pan, this coalesces multiple setLocus() calls into a
|
|
34
34
|
* single data fetch cycle after the interaction settles (100ms quiet period).
|
|
35
35
|
* Abort in-flight requests immediately so they don't race with the eventual fetch.
|
|
36
|
+
*
|
|
37
|
+
* @param getViewportWidth Getter that reads the current viewport width when
|
|
38
|
+
* the timer fires, rather than capturing a stale value at call time. This
|
|
39
|
+
* prevents the timer from firing with viewportWidth=0 when debouncedLoad
|
|
40
|
+
* was called before the first render/layout.
|
|
36
41
|
*/
|
|
37
|
-
debouncedLoad(managedTracks: ManagedTrack[], locus: Locus,
|
|
42
|
+
debouncedLoad(managedTracks: ManagedTrack[], locus: Locus, getViewportWidth: () => number): void;
|
|
38
43
|
loadAllTracksIfNeeded(managedTracks: ManagedTrack[], locus: Locus, viewportWidth: number): void;
|
|
39
44
|
/**
|
|
40
45
|
* Load data for a single track, deduplicating against inflight fetches
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { BedFeature, AnnotationRenderConfig, TextFileFormat } from '../../types';
|
|
2
2
|
import type { TrackClickEvent } from '../hooks/useTrackManager';
|
|
3
|
-
export interface BedTrackProps {
|
|
3
|
+
export interface BedTrackProps<F extends BedFeature = BedFeature> {
|
|
4
4
|
/** URL to a BED/peak file. Mutually exclusive with `features`. */
|
|
5
5
|
url?: string;
|
|
6
6
|
/** In-memory annotation features. Mutually exclusive with `url`. Features must include `chr`. */
|
|
7
|
-
features?:
|
|
7
|
+
features?: F[];
|
|
8
8
|
config?: Partial<AnnotationRenderConfig>;
|
|
9
9
|
height?: number;
|
|
10
10
|
background?: string;
|
|
@@ -15,10 +15,10 @@ export interface BedTrackProps {
|
|
|
15
15
|
name?: string;
|
|
16
16
|
metadata?: Record<string, string>;
|
|
17
17
|
/** Compute per-feature color. Applied to in-memory features before rendering. */
|
|
18
|
-
colorBy?: (feature:
|
|
19
|
-
/** Called when this track is clicked.
|
|
20
|
-
onClick?: (event: TrackClickEvent<
|
|
18
|
+
colorBy?: (feature: F) => string;
|
|
19
|
+
/** Called when this track is clicked. */
|
|
20
|
+
onClick?: (event: TrackClickEvent<F>) => void;
|
|
21
21
|
/** Called when this track is right-clicked. */
|
|
22
|
-
onContextMenu?: (event: TrackClickEvent<
|
|
22
|
+
onContextMenu?: (event: TrackClickEvent<F>) => void;
|
|
23
23
|
}
|
|
24
|
-
export declare function BedTrack({ url, features, config, height, background, format, indexURL, indexed, maxTrackHeight, name, metadata, colorBy, onClick, onContextMenu }: BedTrackProps): null;
|
|
24
|
+
export declare function BedTrack<F extends BedFeature = BedFeature>({ url, features, config, height, background, format, indexURL, indexed, maxTrackHeight, name, metadata, colorBy, onClick, onContextMenu }: BedTrackProps<F>): null;
|