Commit 0285f00a authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Check for vector property type in graph_draw()

parent 03248ef2
...@@ -48,7 +48,8 @@ import copy ...@@ -48,7 +48,8 @@ import copy
from collections import defaultdict from collections import defaultdict
from .. import GraphView, PropertyMap, ungroup_vector_property,\ from .. import GraphView, PropertyMap, ungroup_vector_property,\
group_vector_property, _prop group_vector_property, _prop, _check_prop_vector
from .. stats import label_parallel_edges, label_self_loops from .. stats import label_parallel_edges, label_self_loops
from .. dl_import import dl_import from .. dl_import import dl_import
...@@ -612,11 +613,13 @@ def graph_draw(g, pos=None, vprops=None, eprops=None, vorder=None, eorder=None, ...@@ -612,11 +613,13 @@ def graph_draw(g, pos=None, vprops=None, eprops=None, vorder=None, eorder=None,
kwargs["layout_K"] = _avg_edge_distance(g, pos) / 10 kwargs["layout_K"] = _avg_edge_distance(g, pos) / 10
else: else:
pos = sfdp_layout(g) pos = sfdp_layout(g)
elif output is None: else:
if "layout_K" not in kwargs: _check_prop_vector(pos, name="pos", floating=True)
kwargs["layout_K"] = _avg_edge_distance(g, pos) if output is None:
if "update_layout" not in kwargs: if "layout_K" not in kwargs:
kwargs["update_layout"] = False kwargs["layout_K"] = _avg_edge_distance(g, pos)
if "update_layout" not in kwargs:
kwargs["update_layout"] = False
if output is None: if output is None:
return interactive_window(g, pos, vprops, eprops, vorder, eorder, return interactive_window(g, pos, vprops, eprops, vorder, eorder,
......
Supports Markdown
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