gosling.js icon indicating copy to clipboard operation
gosling.js copied to clipboard

Overlaying a single track over multiple tracks

Open ThHarbig opened this issue 1 year ago • 2 comments

I think it would be useful to be able to add a single track as an overlay for multiple tracks. For example, for IslandViewer, where a point track is overlaid over multiple stacked tracks.

Island Viewer with overlaid point track

It is possible to implement this at the moment using multiple overlaid tracks with increasing y parameters.

Another use case for this would be overlaying a brush over multiple tracks. In the Gremlin example, this is done for each track individually, but I think it would be more intuitive to add the brush just once in a single overlay track.

ThHarbig avatar Apr 28 '23 15:04 ThHarbig

Grammar-wise, we will need to allow StackedTracks in OverlaidTracks:

From

export interface OverlaidTracks extends CommonViewDef, Partial<SingleTrack> {
    alignment: 'overlay';
    tracks: PartialTrack[];
}

To

export interface OverlaidTracks extends CommonViewDef, Partial<SingleTrack> {
    alignment: 'overlay';
    tracks: (PartialTrack | StackedTracks)[];
}

sehilyi avatar May 02 '23 18:05 sehilyi

This will be beneficial when a user wants to put a brush that spans across tracks in a view. At the moment, users have to put brushes on individual tracks for this.

A technical difficulty would be that (AFAIK) HiGlass does not allow overlaying a view on top of multiple views.

sehilyi avatar May 08 '23 14:05 sehilyi