A canvas widget used to display directed graphs. This container
widget contains zero or more 'node widgets', which are connected by zero
or more GraphEdgeWidget
s. The GraphWidget
is
responsible for updating the edge widgets when nodes move; and for
initially arranging the nodes.
|
|
|
add_node(self,
node)
Add a new node to the graph. |
source code
|
|
|
|
|
|
|
|
|
destroy_edge(self,
edge)
Remove an edge from the graph, and destroy the edge. |
source code
|
|
|
destroy_node(self,
node)
Remove a node from the graph, and destroy the node. |
source code
|
|
list of int
|
_tags(self)
Returns:
a list of canvas tags for all graphical elements managed by this
canvas widget, not including graphical elements managed by its child
widgets. |
source code
|
|
None
|
|
|
|
|
_node_port(self,
node,
src_x,
src_y,
curve) |
source code
|
|
|
|
None
|
|
|
|
|
_arrange_levels(self)
Re-arrange each level to (locally) minimize the number of crossing
edges. |
source code
|
|
|
|
|
_arrange_into_levels(self,
toplevel)
Assign a level to each node. |
source code
|
|
|
_reachable(self,
node,
reached=None)
How many *unexpanded* nodes can be reached from the given node? |
source code
|
|
|
_add_descendants(self,
parent_level,
levelnum)
Add all the descendants of the nodes in the list parent_level to the
structures self._level and self._nodelevel. |
source code
|
|
|
_add_descendants_dfs(self,
parent_level,
levelnum) |
source code
|
|
|
_add_descendants_bfs(self,
parent_level,
levelnum) |
source code
|
|
|
_add_descendants_bfs2(self,
parent_level,
levelnum) |
source code
|
|
Inherited from draw.CanvasWidget :
__getitem__ ,
__repr__ ,
__setitem__ ,
bbox ,
bind_click ,
bind_drag ,
canvas ,
child_widgets ,
destroy ,
height ,
hidden ,
hide ,
manage ,
move ,
moveto ,
parent ,
show ,
tags ,
unbind_click ,
unbind_drag ,
update ,
width
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__str__
|