Open grabear opened 6 years ago
I have not used ggtree or ggraph much. I have considered something like this before and I would be interested in adding something like this as an option (or maybe just a converter to the format ggraph wants), but I dont think I would want to replace the current implementation of heat_tree
with a ggraph
-based solution without more convincing, because:
heat_tree
does a lot of optimization (labels, overlap, etc) that requires the actual coordinates of where things will be plotted, not just relative sizes. Because of the first bullet, ggplot-based solutions cant supply this information before plotting as far as I know. In other words, the relationship between the size of elements and the distance between them changes with output size.heat_tree
uses ggplot2, the things drawn are polygons, not points and lines, so I can control them more. Using ggraph
would make the code for heat_tree
much simpler, but I would loose a lot of control over the details.ggraph
is optimized (or at least allows for) networks, whereas metacoder is optimized for taxonomic trees. There are certain assumptions the current implementation of heat_tree
can make that ggraph
cannot.Are you talking about using ggraph
internally and returning a ggraph
plot with the current function/option setup for heat_tree
, or redesigning the way plots are made by the user to use the ggraph
syntax?
I can easily add a way to convert taxmap
objects to tbl_graph
objects so they can be used with ggraph
. From my limited knowledge of tbl_graph
objects, that would force some loss of information in some cases, because taxmap
objects can have multiple datasets (e.g. tables) associated with the same taxonomy, whereas tbl_graph
objects only contain one "node data" table, so the user would have to pick a single dataset to be included in the tbl_graph
object.
Thanks for the thoughts!
Thoughts on reworking metacoder with ggraph? I noticed this package the other day and thought about how it could be used here. It even has a workflow in it's documentation that involves igraph. That would be a major version update though.