Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
371d3b75
Commit
371d3b75
authored
Mar 21, 2012
by
Tiago Peixoto
Browse files
Fix initial placement of arf_layout()
parent
cc6a4ca2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/draw/__init__.py
View file @
371d3b75
...
...
@@ -298,10 +298,7 @@ def arf_layout(g, weight=None, d=0.5, a=10, dt=0.001, epsilon=1e-6,
"""
if
pos
is
None
:
if
dim
!=
2
:
pos
=
random_layout
(
g
,
dim
=
dim
)
else
:
pos
=
graph_draw
(
g
,
output
=
None
)
pos
=
random_layout
(
g
,
dim
=
dim
)
_check_prop_vector
(
pos
,
name
=
"pos"
,
floating
=
True
)
ug
=
GraphView
(
g
,
directed
=
False
)
...
...
@@ -362,7 +359,10 @@ def _propagate_pos(g, cg, c, cc, cpos, delta, mivs):
def
_avg_edge_distance
(
g
,
pos
):
return
libgraph_tool_layout
.
avg_dist
(
g
.
_Graph__graph
,
_prop
(
"v"
,
g
,
pos
))
ad
=
libgraph_tool_layout
.
avg_dist
(
g
.
_Graph__graph
,
_prop
(
"v"
,
g
,
pos
))
if
numpy
.
isnan
(
ad
):
ad
=
1.
return
ad
def
coarse_graphs
(
g
,
method
=
"hybrid"
,
mivs_thres
=
0.9
,
ec_thres
=
0.75
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment