Commit 2881e360 authored by Tiago Peixoto's avatar Tiago Peixoto

Fix drawing of graphs with no edges

This fixes issue #269
parent 441463ed
Pipeline #107 failed with stage
...@@ -1278,7 +1278,7 @@ def get_bb(g, pos, size, pen_width, size_scale=1, text=None, font_family=None, ...@@ -1278,7 +1278,7 @@ def get_bb(g, pos, size, pen_width, size_scale=1, text=None, font_family=None,
size[:] = size[i] size[:] = size[i]
break break
sl = label_self_loops(g) sl = label_self_loops(g)
slm = sl.fa.max() * 0.75 slm = sl.fa.max() * 0.75 if g.num_edges() > 0 else 0
delta = (size * size_scale * (slm + 1)) / 2 + pen_width * 2 delta = (size * size_scale * (slm + 1)) / 2 + pen_width * 2
x_range = [pos_x.fa.min(), pos_x.fa.max()] x_range = [pos_x.fa.min(), pos_x.fa.max()]
y_range = [pos_y.fa.min(), pos_y.fa.max()] y_range = [pos_y.fa.min(), pos_y.fa.max()]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment