jameshadfield / phandango

an interactive viewer for populations of bacterial genomes linked by a phylogeny
http://phandango.net
MIT License
116 stars 27 forks source link

phylocanvas zoom improvements #23

Closed simonrharris closed 8 years ago

simonrharris commented 9 years ago

It would be great to be able to e.g. right click and ask phylocanvas to zoom both horizontally and vertically to best fit the canvas space.

jameshadfield commented 9 years ago

Have fun with this one Jyo

jyothishnt commented 9 years ago

Good idea. Zoom calculation in PC is bit tricky. But I will try.

jameshadfield commented 9 years ago

Yeah I couldn't understand the code for zooming. But you and @richardgoater are going to have to separate out the x and y zoom, as well as zoom centered around the mouse, because this functionality is pretty essential not only here but in other projects.

E.g. people will want to zoom into a clade on this tree http://microreact.org/project/NJqiECX8 but they have to zoom in, pan, zoom in, pan ....

I zoom in a pretty simple way (and only in one direction) https://github.com/jameshadfield/JScandy/blob/master/js/stores/genome.js#61, but it works really well.

richardgoater commented 9 years ago

@jameshadfield I started on zooming to the position of the mouse on the old version of PC a while ago: https://github.com/PhyloCanvas/PhyloCanvas/tree/zoom-to-mouse-cursor Zooming itself worked but it messed up the tree centering, I'm meaning to re-apply it to v2 when I get time...

jameshadfield commented 8 years ago
richardgoater commented 8 years ago

@jameshadfield middle two tasks are already done in PhyloCanvas v2.

jameshadfield commented 8 years ago

PhyloCanvas2.0 used as of commit 4d76aa1 thanks @richardgoater

instructions to get it working (it's not currently in packages.conf)

jameshadfield commented 8 years ago

fixed in version 0.5.0 (phylocanvas rc11)