if len(children)>0 and joinChildren==1:
cNode = jN + 'c'
- e = [cNode,children[0]]
- if has_node(cNode):
- tcNode = cNode + children[0]
- if len(cNodes[cNode])>0:
- last = cNodes[cNode][-1]
- else:
- last = cNode
- add_spot(tcNode)
- cNodes[cNode].append(tcNode)
- add_no_arrow(last,tcNode)
- add_subgraph([tcNode,cNode])
+ tcNode = cNode + children[0]
+
+ if cNodes.has_key(cNode):
+ if not has_node(tcNode):
+ if len(cNodes[cNode])>0:
+ last = cNodes[cNode][-1]
+ add_spot(tcNode)
+ cNodes[cNode].append(tcNode)
+ add_no_arrow(last,tcNode)
+ add_subgraph([tcNode,last])
else:
- tcNode = cNode
- add_spot(cNode)
- cNodes[cNode] = []
- add_no_arrow(jN,cNode)
+ add_spot(tcNode)
+ cNodes[cNode] = [tcNode]
+ add_no_arrow(jN,tcNode)
+
elif len(children)>0:
tcNode = jN
global dot
dot = dot + "}"
-def start_dot():
+def start_dot(fs):
global dot
global nodes
global edges
dot = "digraph G{\n"
dot = dot + "ranksep = 0.5 nodesep = 0\n"
subgraphs=[]
- set_attr()
+ set_attr(fs)
def add_highlight(name):
add_node(name,highlight_attr)
add_node(name,spot_attr)
-def set_attr():
+def set_attr(fs):
global person_attr
global highlight_attr
global spot_attr
global debug_attr
global debug_edge_attr
zero_size = [('width','0'),('height','0')]
- person_attr = [('fontsize','8'),('shape','plaintext')] + zero_size
+ person_attr = [('fontsize',str(fs)),('shape','plaintext')] + zero_size
highlight_attr = person_attr + \
[('fontcolor','red'),('shape','box'),('color','red')]
debug_attr = person_attr + [('fontcolor','green')]