Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node size #204

Open
pwang16 opened this issue Aug 30, 2019 · 4 comments
Open

Node size #204

pwang16 opened this issue Aug 30, 2019 · 4 comments

Comments

@pwang16
Copy link

pwang16 commented Aug 30, 2019

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

@llrs
Copy link

llrs commented Sep 2, 2019

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)

@pwang16
Copy link
Author

pwang16 commented Sep 12, 2019

Thank you very much! Nice codes!

@michalovadek
Copy link

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).

@thomasp85
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants