gosling-lang / gosling.js

Grammar of Scalable Linked Interactive Nucleotide Graphics
https://gosling.js.org
MIT License
166 stars 27 forks source link

zoom-in and zoom-out buttons #597

Open zhangzhen opened 2 years ago

zhangzhen commented 2 years ago

How can I implement zooming using zoom-out and zoom-in buttons rather than using mouse scrolling?

Zhen

sehilyi commented 2 years ago

I think a combination of using hgRef.current.getLocation() and gosRef.current.zoomTo() can allow implementing zoom in and out buttons.

One thing we can support in the API is something like zoomIn() and zoomOut() somewhere at https://github.com/gosling-lang/gosling.js/blob/73061be167c058a4fb18ef5dec00c87ff2d5af38/src/core/api.ts#L130