gosling.js
gosling.js copied to clipboard
Mouse position tracking incorrect when track orientation is vertical
When the track orientation is vertical, the mouse position indicator is incorrect; it does not track the position of the mouse.
To reproduce:
{
"orientation": "vertical",
"tracks": [
{
"id": "1-1",
"title": "Sample 1",
"data": {
"url": "https://resgen.io/api/v1/tileset_info/?d=Zz3CBDSqQ3ySrOSe2yj1eg",
"type": "vector",
"column": "position",
"value": "peak",
"binSize": 4
},
"mark": "bar",
"x": {
"field": "start",
"type": "genomic",
"axis": "bottom",
"linkingId": "1"
},
"xe": {"field": "end", "type": "genomic"},
"y": {
"field": "peak",
"type": "quantitative",
"axis": "left",
"flip": false
},
"color": {"value": "#CC7DAA"},
"stroke": {"value": "white"},
"strokeWidth": {"value": 0.2},
"style": {"background": "lightgray", "backgroundOpacity": 0},
"width": 700,
"height": 400
}
]
}
https://user-images.githubusercontent.com/14843470/229638732-05fb2495-e01d-4396-a870-f3e11e195513.mov
The “showMousePosition” and “mousePositionColor” options in gosling-theme. https://github.com/gosling-lang/gosling-theme/blob/d438f77ed244eb04a4982891729b572d61285a5a/src/dark.ts#L22
From @sehilyi
The mouse positions are implemented in HiGlass, and we are using HiGlass’ track option (showMousePosition) to show the line in Gosling tracks. Unsure why it is not shown correctly. FYI, showMousePosition in HiGlass: https://docs.higlass.io/view_config.html