gosling-lang/gosling.js

Add buttons for zooming and panning

thomcsmits opened this issue · 3 comments

(This issue is a small piece in the roadmap to keyboard accessibility)

Implement the ability to navigate in a single track with buttons. E.g., clicking 'move left' will move the view left by a default [x] basepairs, and zoom in will move zoom in a default amount.

image

This looks like it would be useful! Here's a few questions I have that we can address here or when we meet:

  • Do we envision a new option passed into GoslingComponent which will show the buttons?
  • Where should the buttons go? In some central location vs localized to the view they correspond to, etc.
  • Would should the behavior be for a multi-view visualization? You could have multiple sets of buttons or a way to select the view you want the buttons to be responsive to.
  • Should we extend this type of button functionality to brushes as well?

What I am thinking is to link these buttons to an individual track, and eventually, have other buttons to navigate between tracks. We would have to track the level of current focus to be able to navigate between different views and switch to individual tracks within a view.

For a view like such:
image

We would initially select the whole gosling component
image

Where we would have some navigation between the different views including the header
image

And for example this first view
image

Then we can select the first view and go one level deeper
image

Where we can then select the individual tracks
image

And move to the next track
image

So what I think is that this will then also have buttons for

  • left right for components on the same level
  • up down for levels

Brushes only get relevant when we get to this multi-view visualization, and yes, I think then we should also have a button to go to the brush and then both the navigation and zoom buttons for the brush only.

Somehow access this in the same level as the individual tracks
image

Then for the zoom and pan functionality, we would just show the zoom/pan button for the currently selected track.

Initially I was thinking that we would eventually just map these to keyboard combinations and not need the buttons (just for the dev purposes). But it might actually be nice to have this functionality anyway. I think for that it might be nice to have an optional parameter for the GoslingComponent like showButton?: true

It looks like this largely overlaps with what I have in mind with #911. I am going to implement an initial implementation and open a PR so that we can discuss using the working demo.