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

Too many nodes! #15

Open
mattharrison opened this issue Jun 2, 2015 · 0 comments
Open

Too many nodes! #15

mattharrison opened this issue Jun 2, 2015 · 0 comments

Comments

@mattharrison
Copy link

I'm trying to plot a simple graph with a node and a child. Sometimes it renders 3 nodes (2 of them connected). Other times it renders nothing. What am I doing wrong?

eg2 = EventfulGraph()
d32 = ForceDirectedGraph(eg2)

d32.width = 300
d32.height = 300

edges = set()
for name, rid, pid in [('root', 1, None),
                       ('c1', 2, 1)]:
    eg2.add_node(rid, label=name, 
                 fill='red', 
                 stroke="black", color='black',
                 font_size='8px', r=5)
    if pid: 
        edges = edges | {(rid, pid)}
for i1, i2 in edges:
    eg2.add_edge(int(i1), int(i2),
                 distance=50)
display(d32)
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

1 participant