Skip to content

Too many nodes! #15

@mattharrison

Description

@mattharrison

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions