[prev in list] [next in list] [prev in thread] [next in thread]
List: graphviz-interest
Subject: Re: [graphviz-interest] Orthogonal edge drawing?
From: "Emden R. Gansner" <erg () research ! att ! com>
Date: 2010-08-27 15:44:14
Message-ID: 4C77DD4E.6010103 () research ! att ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
On 8/25/10 1:16 AM, Jian Zhang wrote:
> Hey, I tried to draw a graph using orthogonal lines. For example,
> http://esapubs.org/archive/ecol/E091/083/appendix-A.htm
Strictly speaking, this does not use orthogonal edges, but also allows 45 degree edges. At present,
Graphviz doesn't support it.
> But I cannot figure out how to get it in Graphviz. Just get the graph based on the following code.
> So I want to ask whether there is a way to draw a graph with orthogonal lines at the edge.
>
First, make sure you built Graphviz using --with-ortho=yes. (This is not standard as there are still
holes concerning edge labels in dots and ports.
That means that the binary packages don't have it on.)
Next, to get orthogonal routing, you need to use splines=ortho, not splines=polyline. If there were
no edge labels or you weren't using dot,
that would be all you need. However, as edge labels in dot don't work with splines=ortho yet, the
trick is to lay out the nodes using dot, but
then use neato to add the edges and render the graph:
dot -Gsplines=none sem.gv | neato -Gsplines=ortho -n
This produces the attached output. I also used edge[arrowhead=0.5] to get a more appropriate
arrowhead size.
Emden
[Attachment #5 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=GB2312" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 8/25/10 1:16 AM, Jian Zhang wrote:
<blockquote type="cite">
<meta content="text/html; charset=GB2312"
http-equiv="Content-Type">
<meta name="GENERATOR" content="MSHTML 8.00.7600.16625">
<link rel="stylesheet"
href="BLOCKQUOTE%7Bmargin-Top:%200px;%20margin-Bottom:%200px;%20margin-Left:%202em%7D">
<meta name="GENERATOR" content="MSHTML 6.00.2900.5512">
<link rel="stylesheet"
href="BLOCKQUOTE%7Bmargin-Top:%200px;%20margin-Bottom:%200px;%20margin-Left:%202em%7D">
<meta name="GENERATOR" content="MSHTML 6.00.2900.5512">
<link rel="stylesheet"
href="BLOCKQUOTE%7Bmargin-Top:%200px;%20margin-Bottom:%200px;%20margin-Left:%202em%7D">
<div><font face="Verdana" size="2"><font face="Times New Roman"><font
size="2"><font face="Verdana" size="2"><font face="Times
New Roman"><font size="2"><font face="Times New Roman"
size="3">Hey, I tried to draw a graph using
orthogonal lines. For \
example,</font></font></font></font></font></font></font></div> <div>
<div>
<div>
<div>
<div><font face="Verdana" size="2"><font face="Times New
Roman"><font size="2"><font face="Verdana" size="2"><font
face="Times New Roman"><font size="2"><font
face="Times New Roman" size="3"><a
\
href="http://esapubs.org/archive/ecol/E091/083/appendix-A.htm">http://esapubs.org/arch \
ive/ecol/E091/083/appendix-A.htm</a></font></font></font></font></font></font></font></div>
<div><font face="Verdana" size="2"><font face="Times New
Roman"><font size="2"><font face="Verdana" size="2"><font
face="Times New Roman"><font \
size="2"> </font></font></font></font></font></font></div> </div>
</div>
</div>
</div>
</blockquote>
<font face="Times New Roman, Times, serif">Strictly speaking, this
does not use orthogonal edges, but also allows 45 degree edges. At
present, Graphviz doesn't support it.</font> <br>
<blockquote type="cite">
<div>
<div>
<div>
<div>
<div><font face="Verdana" size="2"><font face="Times New
Roman"><font size="2"><font face="Verdana" size="2"><font
face="Times New Roman"><font size="2"><font
face="Times New Roman" size="3">But I
cannot figure out how to get it in
Graphviz. Just get the graph based on the
following code. So I want to ask whether
there is a way to draw a graph with
orthogonal lines at the \
edge.</font></font></font></font></font></font></font></div> <div><font \
face="Verdana" size="2"><font face="Times New
Roman"><font size="2"><font face="Verdana" size="2"><font
face="Times New Roman"><font \
size="2"> </font></font></font></font></font></font></div> <br>
</div>
</div>
</div>
</div>
</blockquote>
<font size="3"><font face="Times New Roman">First, make sure you
built Graphviz using --with-ortho=yes. (This is not standard as
there are still holes concerning edge labels in dots and ports.<br>
That means that the binary packages don't have it on.) <br>
<br>
Next, to get orthogonal routing, you need to use splines=ortho,
not splines=polyline. If there were no edge labels or you
weren't using dot,<br>
that would be all you need. However, as edge labels in dot don't
work with splines=ortho yet, the trick is to lay out the nodes
using dot, but<br>
then use neato to add the edges and render the graph:<br>
<br>
dot -Gsplines=none sem.gv | neato -Gsplines=ortho -n<br>
<br>
This produces the attached output. I also used
edge[arrowhead=0.5] to get a more appropriate arrowhead size.<br>
<br>
Emden<br>
<br>
</font></font>
</body>
</html>
["out.png" (image/png)]
_______________________________________________
graphviz-interest@research.att.com
https://mailman.research.att.com/mailman/listinfo/graphviz-interest
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic