Skip to content

Commit

Permalink
size nodes in dot layout properly
Browse files Browse the repository at this point in the history
  • Loading branch information
swhalemwo committed Mar 17, 2020
1 parent 22d9ba2 commit 7e06174
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions obvz.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,8 +791,9 @@ def recalc_layout_dot(self):
if self.use_edge_labels != True:
dg.edges([i for i in self.g.edges])

for n in self.g.nodes:
# dg.node(i) = {'width': self.g.nodes[i]['width']/96, 'height': self.g.nodes[i]['height']/96}
for n in self.g.nodes:
# dg.node(i) = {'width': self.g.nodes[i]['width']/96, 'height': self.g.nodes[i]['height']/96}
if self.g.nodes[n]['nd_tp'] == 'nd':
dg.node(n, width = str(self.g.nodes[n]['width']/72), height = str(self.g.nodes[n]['height']/72))


Expand Down Expand Up @@ -826,6 +827,7 @@ def recalc_layout_dot(self):
tail_name = dg_gv_parsed['objects'][tail_id]['name']
elbl_nd_name = elbl_nd_name = "lbl_" + head_name + "_" + tail_name + "_" + lbl_text
self.g.nodes[elbl_nd_name]['x'] = float(lbl_x)
# self.g.nodes[elbl_nd_name]['x'] = float(lbl_x) + self.g.nodes[elbl_nd_name]['width']/2
self.g.nodes[elbl_nd_name]['y'] = float(lbl_y)


Expand Down

0 comments on commit 7e06174

Please sign in to comment.