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

Allow draw_nodes to accept an iterable as the first argument. #508

Open
nwlandry opened this issue Feb 13, 2024 · 1 comment
Open

Allow draw_nodes to accept an iterable as the first argument. #508

nwlandry opened this issue Feb 13, 2024 · 1 comment
Labels
improve Make an existing feature better

Comments

@nwlandry
Copy link
Collaborator

It should be possible to draw nodes without supplying a hypergraph, since if you have the node IDs and corresponding positions, you can draw the nodes. If the user provides a Hypergraph, that allows them to access nodestats and the ability to do a spring layout without providing node positions. I think that one could get around this by selecting the positions at random if the user supplies an iterable of nodes without corresponding positions.

The reason why this could be necessary is that in the draw_bipartite function, when drawing the edge markers, the draw_nodes takes the dual of the hypergraph as an argument, which seems like unnecessary computation.

@maximelucas maximelucas added the improve Make an existing feature better label Aug 30, 2024
@maximelucas
Copy link
Collaborator

A workaround to this could be to use a trivial Hypergraph for this. Actually our current function does not allow to pass a list of nodes for this (only a number of nodes), but we could either that option to xgi.trivial_hypergraph() or if you have your list of nodes, you could do it manually

H = xgi.Hypergraph()
H.add_nodes_from(nodes)

This way we don't need to touch draw_nodes()?
I think I used this trick is some (maybe since then overwritten) version of the bipartite drawing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improve Make an existing feature better
Projects
None yet
Development

No branches or pull requests

2 participants