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

Rendering a simple graph? #8

Open
jeffalstott opened this issue Jul 3, 2014 · 3 comments
Open

Rendering a simple graph? #8

jeffalstott opened this issue Jul 3, 2014 · 3 comments

Comments

@jeffalstott
Copy link

Thanks for this great code! We have been discussing it over at wrobstory/vincent#96

How would one render a simple, static graph? Ideally something like:

    g = networkx.erdos_renyi(100,.1)
    render(g)

Unfortunately, even using the "demo simple" notebook it appears I can't
even do:

    g = networkx.erdos_renyi(100,.1)
    G = EventfulGraph(g)
    d3 = ForceDirectedGraphWidget(G)
    floating_container.children = [d3]
    display(floating_container)

I understand I could do:

    G = EventfulGraph()

and build the network I want from there "manually", but that's painful and sometimes impractical.

@Midnighter
Copy link

In older networkx versions the graph generator functions had an argument create_using so that you should be able to do:

g = EventfulGraph()
g = nx.erdos_renyi(100, 0.1, create_using=g)
...

Still, improvements would be a good thing :)

@jeffalstott
Copy link
Author

Interesting! Any idea how to create similar functionality with current versions of networkx? Maybe we could talk to the networkx folks.

@jdfreder
Copy link
Owner

Hi @jeffalstott , AFAIK there isn't a way to do that with the current design. However, I don't think it should be too difficult to implement.

Side note: I've been thinking a bit more about this repository and I think it'd be better named ipython-d3networkx. That way I can use ipython-d3 for a more generic library that wraps d3 entirely.

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

No branches or pull requests

3 participants