ArtPoon/BioID

Interactive animation of root-to-tip regression

Closed this issue · 2 comments

This should comprise three parts:

  1. an interactive plot of a tree in unrooted format - user should be able to drag a point to any location along the tree.
  2. a dendrogram style plot of the same tree that updates with placement of root in (1)
  3. a scatterplot of distance from root (y) against date of sample collection (x)

To deal with the first component, we need to make the canvas aware of where the pointer is on a mousedown event.
I think first we need to reduce the tree down to (x,y) coordinates for every node.

  1. determine which node is closest to pointer
  2. select second note such that pointer is within the sector defined by the bisects of the adjacent branches.
  3. find nearest point on branch connected first and second nodes
  4. store this location as the root

Two problems drawing rooted tree:

  1. Second SVG is only updating when user slides root node to a different branch. Sliding along a given branch of the unrooted tree induces changes in branch lengths in the rooted tree that should update the SVG.
  2. Only 12 nodes are being displayed in the rooted tree SVG. There are 14 nodes total, but 2 of the nodes have the exact same (x,y) coordinates as other nodes.