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
43
Issues
43
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
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
cf3440f4
Commit
cf3440f4
authored
Sep 26, 2011
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement parsing of HTML-like labels in graph_draw()
parent
211f6788
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
src/graph_tool/draw/__init__.py
src/graph_tool/draw/__init__.py
+8
-1
No files found.
src/graph_tool/draw/__init__.py
View file @
cf3440f4
...
...
@@ -84,6 +84,7 @@ try:
libgv
.
agnode
.
restype
=
ptype
libgv
.
agedge
.
restype
=
ptype
libgv
.
agget
.
restype
=
ptype
libgv
.
agstrdup_html
.
restype
=
ptype
# 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
()
...
...
@@ -96,8 +97,14 @@ __all__ = ["graph_draw", "fruchterman_reingold_layout", "arf_layout",
"random_layout"
]
def
htmlize
(
val
):
if
len
(
val
)
>=
2
and
val
[
0
]
==
"<"
and
val
[
-
1
]
==
">"
:
return
ctypes
.
string_at
(
libgv
.
agstrdup_html
(
val
[
1
:
-
1
]))
return
val
def
aset
(
elem
,
attr
,
value
):
v
=
str
(
value
)
v
=
htmlize
(
str
(
value
)
)
libgv
.
agsafeset
(
elem
,
str
(
attr
),
v
,
v
)
...
...
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