Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
graph-tool
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
40
Issues
40
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tiago Peixoto
graph-tool
Commits
79e2c523
Commit
79e2c523
authored
Jul 13, 2019
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
graph_draw(): Propagate vertex/edge properties in multilevel interactive layout
This fixes issue
#595
parent
f4520a95
Pipeline
#503
failed with stage
in 217 minutes and 41 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
src/graph_tool/draw/gtk_draw.py
src/graph_tool/draw/gtk_draw.py
+14
-9
No files found.
src/graph_tool/draw/gtk_draw.py
View file @
79e2c523
...
@@ -312,9 +312,7 @@ class GraphWidget(Gtk.DrawingArea):
...
@@ -312,9 +312,7 @@ class GraphWidget(Gtk.DrawingArea):
self
.
g
=
self
.
cg
self
.
g
=
self
.
cg
self
.
pos
=
self
.
cpos
self
.
pos
=
self
.
cpos
self
.
layout_step
=
self
.
layout_K
self
.
layout_step
=
self
.
layout_K
self
.
selected
=
self
.
g
.
own_property
(
self
.
selected
)
self
.
_own_props
()
self
.
highlight
=
self
.
g
.
own_property
(
self
.
highlight
)
self
.
sel_edge_filt
=
self
.
g
.
own_property
(
self
.
sel_edge_filt
)
else
:
else
:
self
.
cg
=
None
self
.
cg
=
None
...
@@ -392,6 +390,17 @@ class GraphWidget(Gtk.DrawingArea):
...
@@ -392,6 +390,17 @@ class GraphWidget(Gtk.DrawingArea):
self
.
layout_step
=
self
.
layout_init_step
self
.
layout_step
=
self
.
layout_init_step
self
.
layout_callback_id
=
gobject
.
idle_add
(
self
.
layout_callback
)
self
.
layout_callback_id
=
gobject
.
idle_add
(
self
.
layout_callback
)
def
_own_props
(
self
):
self
.
selected
=
self
.
g
.
own_property
(
self
.
selected
)
self
.
highlight
=
self
.
g
.
own_property
(
self
.
highlight
)
self
.
sel_edge_filt
=
self
.
g
.
own_property
(
self
.
sel_edge_filt
)
for
k
,
vp
in
self
.
vprops
.
items
():
if
isinstance
(
vp
,
PropertyMap
):
self
.
vprops
[
k
]
=
self
.
g
.
own_property
(
vp
)
for
k
,
ep
in
self
.
eprops
.
items
():
if
isinstance
(
ep
,
PropertyMap
):
self
.
eprops
[
k
]
=
self
.
g
.
own_property
(
ep
)
def
layout_callback
(
self
):
def
layout_callback
(
self
):
"""Perform one step of the layout algorithm."""
"""Perform one step of the layout algorithm."""
if
self
.
layout_callback_id
is
None
or
self
.
g
.
num_vertices
()
==
0
:
if
self
.
layout_callback_id
is
None
or
self
.
g
.
num_vertices
()
==
0
:
...
@@ -425,9 +434,7 @@ class GraphWidget(Gtk.DrawingArea):
...
@@ -425,9 +434,7 @@ class GraphWidget(Gtk.DrawingArea):
self
.
layout_K
*=
0.75
self
.
layout_K
*=
0.75
self
.
g
=
self
.
cg
self
.
g
=
self
.
cg
self
.
pos
=
self
.
cpos
self
.
pos
=
self
.
cpos
self
.
selected
=
self
.
g
.
own_property
(
self
.
selected
)
self
.
_own_props
()
self
.
highlight
=
self
.
g
.
own_property
(
self
.
highlight
)
self
.
sel_edge_filt
=
self
.
g
.
own_property
(
self
.
sel_edge_filt
)
self
.
layout_step
=
max
(
self
.
layout_K
,
self
.
layout_step
=
max
(
self
.
layout_K
,
_avg_edge_distance
(
self
.
g
,
_avg_edge_distance
(
self
.
g
,
self
.
pos
)
/
10
)
self
.
pos
)
/
10
)
...
@@ -443,9 +450,7 @@ class GraphWidget(Gtk.DrawingArea):
...
@@ -443,9 +450,7 @@ class GraphWidget(Gtk.DrawingArea):
except
StopIteration
:
except
StopIteration
:
self
.
g
=
self
.
ag
self
.
g
=
self
.
ag
self
.
pos
=
self
.
apos
self
.
pos
=
self
.
apos
self
.
selected
=
self
.
g
.
own_property
(
self
.
selected
)
self
.
_own_props
()
self
.
highlight
=
self
.
g
.
own_property
(
self
.
highlight
)
self
.
sel_edge_filt
=
self
.
g
.
own_property
(
self
.
sel_edge_filt
)
self
.
g
.
copy_property
(
self
.
cpos
,
self
.
pos
)
self
.
g
.
copy_property
(
self
.
cpos
,
self
.
pos
)
if
self
.
vertex_matrix
is
not
None
:
if
self
.
vertex_matrix
is
not
None
:
self
.
vertex_matrix
=
VertexMatrix
(
self
.
g
,
self
.
pos
)
self
.
vertex_matrix
=
VertexMatrix
(
self
.
g
,
self
.
pos
)
...
...
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