Re: [graphviz-interest] Graphviz: make invisible node take no space
Igor Chetverovod <[email protected]> Thu, 14 Sep 2017 05:56:19 +0300
| Newsgroups | gmane.comp.video.graphviz |
|---|---|
| Message-ID | <[email protected]> |
--===============4118948145600425255==
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
<html><head></head><body text=3D"#000000" bgcolor=3D"#FFFFFF" lang=3D"ru-RU=
" style=3D"background-color: rgb(255, 255, 255); line-height: initial;"> =
=
<div style=3D"width: 100%; font-size: initial; font-family: Calibri=
, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align:=
initial; background-color: rgb(255, 255, 255);"><br></div> =
=
<div style=3D"width: 100%; font-s=
ize: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; co=
lor: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255,=
255);"><br style=3D"display:initial"></div> =
=
=
<div style=3D"font-size: initial; font-family: Calibri, 'Slat=
e Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initia=
l; background-color: rgb(255, 255, 255);">=D0=9E=D1=82=D0=BF=D1=80=D0=B0=D0=
=B2=D0=BB=D0=B5=D0=BD=D0=BE =D1=81 =D0=BC=D0=BE=D0=B5=D0=B3=D0=BE=
=D1=81=D0=BC=D0=B0=D1=80=D1=82=D1=84=D0=BE=D0=BD=D0=B0 BlackBerr=
y 10.</div> =
=
<table width=3D"100%" style=3D"=
background-color:white;border-spacing:0px;"> <tbody><tr><td colspan=3D"2" s=
tyle=3D"font-size: initial; text-align: initial; background-color: rgb(255,=
255, 255);"> <div style=3D"border-style: solid n=
one none; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padd=
ing: 3pt 0in 0in; font-family: Tahoma, 'BB Alpha Sans', 'Slate Pro'; font-s=
ize: 10pt;"> <div><b>=D0=9E=D1=82: </b>Emden R. Gansner</div><div><b>=D0=
=9E=D1=82=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE: </b>=D1=87=D0=B5=
=D1=82=D0=B2=D0=B5=D1=80=D0=B3, 14 =D1=81=D0=B5=D0=BD=D1=82=D1=8F=D0=B1=D1=
=80=D1=8F 2017 =D0=B3., 0:53</div><div><b>=D0=9A=D0=BE=D0=BC=D1=83: </=
b>[email protected]</div><div><b>=D0=A2=D0=B5=D0=BC=
=D0=B0: </b>Re: [graphviz-interest] Graphviz: make invisible node take no s=
pace</div></div></td></tr></tbody></table><div style=3D"border-style: solid=
none none; border-top-color: rgb(186, 188, 209); border-top-width: 1pt; fo=
nt-size: initial; text-align: initial; background-color: rgb(255, 255, 255)=
;"></div><br><div id=3D"_originalContent" style=3D"background-color: rgb(25=
5, 255, 255);">
=20
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8=
">
=20
=20
<div class=3D"moz-cite-prefix">The node itself is not taking up space;
the culprits are the nodesep and cluster margin. No matter the
size of the node, there will always be 2*nodesep or <br>
nodesep+margin space around the node. That is built into the dot
algorithm. <br>
<br>
If you are after cluster edges without having to pick a
representative node (using ltail/lhead), one could try doing a dot
layout without the cluster edges, then add invisible nodes
representing the cluster and the missing cluster edges, and then
the graph through neato -n2 -Gsplines. Unfortunately, this won't
work. If you make the invisible node a point, you still need to
handle the clipping to the cluster boundary. If you make the
invisible node a rectangle the size of the cluster, the spline
routing will fail. <br>
<br>
The machinery for handling real compound edges exists in fdp and
could be exposed to be used in other layouts. For most layouts
this would be fine, but to do this correctly in dot, one would
have to handle compound edges during crossing reduction. <br>
<br>
Emden<br>
<br>
<br>
<br>
On 9/13/17 4:08 AM, Chiel ten Brinke wrote:<br>
</div>
<blockquote type=3D"cite" cite=3D"mid:CAFw20sz_UTK=3Daz+3zLYdMLhxPCecyP=
[email protected]">
<div dir=3D"ltr">
<div class=3D"gmail_default">
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif">Consider the graph </font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"><br>
</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> digraph "Graph
b9ca21a1-971e-400c-a7f4-cd650986476a" {</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> graph [ margin=3D10 ]=
;</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> node [ shape=3Dpoint =
];</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> </font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> "Invisible" [</=
font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> //heigh=
t=3D0,</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> //width=
=3D0,</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> //margi=
n=3D0,</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> //style=
=3Dinvis,</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> color=
=3D"red"</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> ];</fon=
t></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> </font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> subgraph "cluster_1" =
{</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> "A";</f=
ont></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> "B";</f=
ont></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> "Invisi=
ble";</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> "C";</f=
ont></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> "D";</f=
ont></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> }</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> </font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"> }</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"><br>
</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif">resulting in</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"><br>
</font></div>
<div class=3D"gmail_default"><span style=3D"font-family:arial,hel=
vetica,sans-serif"><a href=3D"https://i.stack.imgur.com/iF1ax.png" moz-do-n=
ot-send=3D"true">https://i.stack.imgur.com/iF1ax.png</a></span><br>
</div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"><br>
</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif">I want the red node to be completely
invisible, taking up no space, but it has to remain there,
such that it can be used for `lhead`/`ltail` an other such
miscellaneous things.</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"><br>
</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif">When uncommenting the commented lines, the
result is</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"><br>
</font></div>
<div class=3D"gmail_default"><span style=3D"font-family:arial,hel=
vetica,sans-serif"><a href=3D"https://i.stack.imgur.com/jjrp7.png" moz-do-n=
ot-send=3D"true">https://i.stack.imgur.com/jjrp7.png</a></span><br>
</div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"><br>
</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif">As you see, there is still a spatial artifact
of this node.</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif"><br>
</font></div>
<div class=3D"gmail_default"><font face=3D"arial, helvetica,
sans-serif">Question: is there a way to remove this
completely, without affecting the other nodes' layout in
the graph?</font></div>
<div class=3D"gmail_default"><br>
</div>
<div class=3D"gmail_default"><br>
</div>
<div class=3D"gmail_default">Regards,</div>
<div class=3D"gmail_default"><br>
</div>
<div class=3D"gmail_default">Chiel</div>
</div>
</div>
<br>
<fieldset class=3D"mimeAttachmentHeader"></fieldset>
<br>
<pre wrap=3D"">_______________________________________________
<a class=3D"moz-txt-link-abbreviated" href=3D"mailto:graphviz-interest@list=
s.research.att.com">[email protected]</a>
<a class=3D"moz-txt-link-freetext" href=3D"http://lists.research.att.com/ma=
ilman/listinfo/graphviz-interest">http://lists.research.att.com/mailman/lis=
tinfo/graphviz-interest</a>
</pre>
</blockquote>
<br>
=20
<br><!--end of _originalContent --></div></body></html>
--===============4118948145600425255==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
[email protected]
http://lists.research.att.com/mailman/listinfo/graphviz-interest
--===============4118948145600425255==--