Menu

#90 support layout of edge labels in layered layout

Future
open
nobody
None
5
2014-12-18
2014-12-18
No

Currently the layered layout seems to ignore edge labels completely. I'd be nice to include them into that excellent layout engine. In the following example

\documentclass{standalone}

\usepackage{lipsum}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{graphdrawing}
\usetikzlibrary{arrows}
\usetikzlibrary{graphs}
\usegdlibrary{force, layered, trees}

\begin{document}
\newcommand{\lipedge}{0} 
% set to 0 in order to omit edge label and to 1 to see 
    % the confusion caused by large edge labels (values above 1 are not 
    % reasonable because 1 already shows enough)
\newcommand{\criticaledgelabel}{
%\parbox{10cm}{\lipsum[\lipedge]}
a
}
\scalebox{0.5}{
\tikz 
\graph [layered layout, edges={draw, auto}] 
{
first root -> "\parbox{10cm}{\lipsum[2]}" ->[edge 
label={\criticaledgelabel}] 
{"\parbox{10cm}{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut pu-
rus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Cur-
abitur dictum gravida mauris. Nam arcu libero, nonummy eget,
consectetuer id, vulputate a, magna. Donec vehicula augue eu
neque. Pellentesque habitant morbi tristique senectus et netus et
malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra
metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultri-
ces. Phasellus eu tellus sit amet tortor gravida placerat. Integer
sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent
eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi do-
lor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur
auctor semper nulla. Donec varius orci eget risus. Duis nibh mi,
congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci
sit amet orci dignissim rutrum.
\\
\\$\begin{array}{lll}
 a & b & c \\
\end{array}$}", 3, 
"\parbox{10cm}{\lipsum[1]}"} -> {4, 5}, 
"\parbox{10cm}{\lipsum[1]}" , 4 --[edge 
label={\parbox{10cm}{\lipsum[\lipedge]}}] 5;
};
}

\end{document}

shows the issue. Even labels containing 1 letter (use \criticaledgelabel to check out different lengths) cause trouble in this over size example. AFAIK, layered example is currently the only layout which can handle nodes of arbitrary size which brings it pretty close to being the greatest thing in the world :) If it could handle the labels and also oversize ones (e.g. commented content for \criticaledgelabel) we could finally draw ANY graph without taking care about layout!!

Discussion