Not so much a bug but a lack of efficient best practice perhaps,
(found because I was trying to change colours in term_gene_graph() function)
but this idea of creating a new attribute in V(g) called color based on V(g)$term and using it in the aes()
for geom_node_point() is not too great an idea simply because that is the job of aes() and then scale_color_manual() in the first place.
The creation of this color attribute is unnecessary because by defining the aes() on term like so
i.e. p <- p + ggraph::geom_node_point(ggplot2::aes(color=.data$type, size=.data$size)
then
scale_color_manual(value=
can be assigned to the three colours. As I say, it's not a bug, but it obscures a major part of ggplot2's philosophy, the whole aes() concept, "Grammar of Graphics" etc.
Not so much a bug but a lack of efficient best practice perhaps, (found because I was trying to change colours in term_gene_graph() function) but this idea of creating a new attribute in
V(g)
calledcolor
based onV(g)$term
and using it in theaes()
forgeom_node_point()
is not too great an idea simply because that is the job ofaes()
and thenscale_color_manual()
in the first place. The creation of thiscolor
attribute is unnecessary because by defining theaes()
onterm
like sothen
can be assigned to the three colours. As I say, it's not a bug, but it obscures a major part of ggplot2's philosophy, the whole
aes()
concept, "Grammar of Graphics" etc.