At the moment, draw_svg() spaces apart mutations evenly on a branch. Now that we have introduced mutation times we should really use the time value (if defined) to place mutations on branches when drawing trees.
This would be easy, apart from the fact that there may be mutations above the root. In this case, we need to scale the tree so that, rather than a fixed root branch length (which is a hack anyway), the tree height is given by the oldest mutation above the root node. When plotting a whole tree sequence, we need to find the oldest of these values. Unfortunately, this is not quite as easy as finding max(ts.tables.mutations.time), because I think we can have valid mutations that are not above any node on any tree. We previously hit this issue for node times, and solved it by defining a ts.max_root_time property. I wonder if we now need a ts.max_mutation_time property too?
I think max(ts.tables.mutations.time) is all we need for drawing - having a mutation above an isolated non-sample node that is older than the mutations above the roots is a pretty remote corner case.
@hyanwong Looks like we can close this, yes?
Just looking through the list of old issues. I don't think this has actually been implemented yet, so we should leave it open. Sorry!
Most helpful comment
I think
max(ts.tables.mutations.time)is all we need for drawing - having a mutation above an isolated non-sample node that is older than the mutations above the roots is a pretty remote corner case.