ggraph
ggraph copied to clipboard
Node size
Hi Thomas,
I have a question for facet_edges(~year) in the example of ggraph. For the comparison of year 1957 and 1958, the position of the each node in each panel is same, but the node size is also the same. I think the node size is the popularity, which should be not same in two different years, right? How can I make the node size different according to each year's data just keeping the node position same? Thanks and look forward to your reply.
Peng
I tried with
graph <- as_tbl_graph(highschool) %>%
activate("edges") %>%
group_by(year) %>%
mutate(Popularity = centrality_degree(mode = 'in'))
Error: This call requires nodes to be active
Maybe it is hard to implement such a feature that needs to account for grouped variables in other. Probably this is also linked that the resulting information would mean that there are two values of popularity for each node, while the advantage of tbl_graph
is to only store one row for each node and each edge.
(It could be helpful to consider other solutions, like what I did on BaseSet, where elements/nodes are only once, and sets/edges are only stored once but the relation set-element can be multiple on the relation slot)
Thank you very much! Nice codes!
I was about to open a new issue but I realize the underlying question is the same. Is there any way of obtaining and plotting facet-level information (other than simply doing two plots)? facet_edge basically splits a network into sub-graphs and variables such as centrality, coreness, etc. differ accordingly. I guess this would ultimately mean that the layout of the facets could change with facet_edge, which is currently not the case of course (nodes are fixed in position).
I'm still trying to figure out how to best handle dynamic graphs... at present everything is still evaluated in the context of the input graph...
Maybe we need to support morphed tbl_graphs?