gosling-lang / gosling.js

Grammar of Scalable Linked Interactive Nucleotide Graphics

Home Page:https://gosling.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding a track resets genomic coordinates, not maintaining the current zoom status

sehilyi opened this issue · comments

I think the issue comes from the fact that the xDomain defined in a Gosling spec is reused when a track is added. A potential fix would be getting the current genomic coordinates from the higlass spec (e.g., hgRef.current.api.getViewConfig) and putting that information in the Gosling spec. Code that needed to be updated for this fix:

https://github.com/gosling-lang/gosling.js/blob/09a5207fb58c877484911b7158724deec6304f67/src/core/gosling-component.tsx#L115C21-L120C29

Example of compiled viewConfig:

Screenshot 2023-09-22 at 11 57 48

Update initialXDomain of views by referring to HiGlass view uid, i.e., views[x].initialXDomain