Open fmarotta opened 3 months ago
For phylogeny
objects this is essentially done. We now support two broad classes of edges, "links" and "combs". They are both based on geom_segment
, but they can also be used with geom_link
or geom_diagonal
; geom_line
has been abandoned.
For recPhylo
objects it's a bit more complex. The "comb" layout doesn't require big changes, but in order to have link-type edges we need to change the layout of the species and gene trees. In particular, the y-thickness should always be zero and the x position of the internal events must be interpolated on the line joining parent and child. At any rate, we should also add a callback or something to customize the way individual edges are drawn based on their type, especially bifurcationOut and transferBack. For example, transfers could be bezier curves while other edge types are links or combs. We just have to inject some config in the stat-like function that computes the edges.
Currently the "edge data.frames" are built to work with the geom_line() geom. However, using geom_segment() might give more flexibility. In particular it would open the way to use geom_link(), geom_bezier() and so on from ggforce. See e.g. this: