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
58b73413
Commit
58b73413
authored
Dec 01, 2013
by
Tiago Peixoto
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include support for new graphviz API (>= 2.30) in graphviz_draw()
parent
392b1150
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
src/graph_tool/draw/graphviz_draw.py
src/graph_tool/draw/graphviz_draw.py
+17
-1
No files found.
src/graph_tool/draw/graphviz_draw.py
View file @
58b73413
...
...
@@ -71,6 +71,16 @@ try:
# create a context to use the whole time (if we keep freeing and recreating
# it, we will hit a memory leak in graphviz)
gvc
=
libgv
.
gvContext
()
try
:
gv_new_api
=
True
libgv_directed
=
libgv
.
Agdirected
libgv_undirected
=
libgv
.
Agundirected
except
AttributeError
:
gv_new_api
=
False
libgv_directed
=
1
libgv_undirected
=
0
except
OSError
:
msg
=
"Error importing graphviz C library (libgvc)... graphviz_draw() will not work."
warnings
.
filterwarnings
(
"always"
,
msg
,
ImportWarning
)
...
...
@@ -302,7 +312,13 @@ def graphviz_draw(g, pos=None, size=(15, 15), pin=False, layout=None,
has_layout
=
False
try
:
gvg
=
libgv
.
agopen
(
"G"
.
encode
(
"utf8"
),
1
if
g
.
is_directed
()
else
0
)
if
gv_new_api
:
gvg
=
libgv
.
agopen
(
"G"
.
encode
(
"utf8"
),
libgv_directed
if
g
.
is_directed
()
else
libgv_undirected
,
None
)
else
:
gvg
=
libgv
.
agopen
(
"G"
.
encode
(
"utf8"
),
libgv_directed
if
g
.
is_directed
()
else
libgv_undirected
)
if
layout
is
None
:
if
pin
==
False
:
...
...
Tiago Peixoto
@count0
mentioned in issue
#125 (closed)
·
Aug 06, 2014
mentioned in issue
#125 (closed)
mentioned in issue #125
Toggle commit list
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