GMOD / jbrowse-components

Source code for JBrowse 2, a modern React-based genome browser
https://jbrowse.org/jb2
Apache License 2.0
207 stars 62 forks source link

Dragging the circular view should rotate it #943

Open ihh opened 4 years ago

ihh commented 4 years ago

Is your feature request related to a problem? Please describe.

It takes frustratingly long to rotate the circular view by pressing the buttons. Increasing the rotation per button press (as in #942) will help, but at the cost of precision.

Describe the solution you'd like

Dragging the circular view should rotate it in a direction such that the drag is tangent to the circle at the point where the drag starts. (In other words, clicking at the top and dragging left will rotate it counterclockwise; clicking on the right and dragging down will rotate it clockwise.)

Describe alternatives you've considered

Buttons should also rotate it more #942 but this is JBrowse, it should be draggable.

Additional context

The prototype at http://jbrowse.org/u24/rotunda/ is a good example of how it should work.

cmdcolin commented 3 years ago

this is a good issue. I think that a similar one is that scrolling our circular view, in general is a little weird. for example, when we zoom in, it makes the whole scroll panel of the circular view large, and then you can e.g. scroll into the middle of the circle, and even to the top left corner where there is nothing. I think probably the zooming and scrolling on the rotunda model is a bit more intuitive.

cmdcolin commented 3 years ago

example screenshot showing what i mean

there are large scrollbars for the element, and i'm zoomed into a random region in the middle of the circle, instead of the zoom in focusing on a particular region on the circle.

Screenshot from 2021-08-25 10-13-45

it could be argued that there is some benefit to zooming into a random region in the middle of the circle, but I think it is not common and may be able to be removed from design entirely.

cmdcolin commented 3 years ago

@garrettjstevens would be curious about your ideas here. It seems like we may need to address stuff like this at some point to improve circular view usability

garrettjstevens commented 3 years ago

I agree, circular view usability could use some attention. I haven't thought about it a lot, but agree that dragging to rotate feels more familiar, especially if you're used dragging to scroll in the LGV. And for zooming, I think doing what the JBrowse 1 rotunda demo does and always zooming toward the top edge makes sense.

I think it also might make sense to migrate this view to use Canvas instead of SVG as part of working on the usability.