Context: I would like to connect nodeparts in a TikZ graph that is positioned by the graphdrawing
library. Unfortunately it fails to find the node, when I do attach the .first
, .second
, ... suffix.
Question:
- Is there something wrong in this example?
- Is there an easy way around this limitation?
Failing minimal working example with graphdrawing
:
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{graphdrawing,graphs,shapes}
\usegdlibrary{layered}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\begin{document}
\begin{tikzpicture}[layered layout]
\node
[rectangle split, rectangle split parts=4, text ragged]
(NodeA)
{
Node A
\nodepart{two}
Part two
\nodepart{three}
Part three
\nodepart{four}
Part four
};
\node
[rectangle split, rectangle split parts=3, text ragged]
(NodeB)
{
Node B
\nodepart{two}
Part two
\nodepart{three}
Part three
};
\draw (NodeA.two) edge[->] (NodeB.three);
\end{tikzpicture}
\end{document}
Minimal working example without graphdrawing
:
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{graphs,shapes}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\begin{document}
\begin{tikzpicture}
\node
[rectangle split, rectangle split parts=4, text ragged]
(NodeA)
{
Node A
\nodepart{two}
Part two
\nodepart{three}
Part three
\nodepart{four}
Part four
};
\node
[rectangle split, rectangle split parts=3, text ragged]
(NodeB)
{
Node B
\nodepart{two}
Part two
\nodepart{three}
Part three
};
\draw (NodeA.two) edge[->] (NodeB.three);
\end{tikzpicture}
\end{document}
graphdrawing
library? By the way if you comment out[layered layout]
and specify nodes positions like0,0
and2,0
, the line will appear. – Alenanno Jan 28 '16 at 16:33graphdrawing
I suggest you look at the Tikz manual and see how graphs are done there because I don't think you're respecting the syntax here (and that would explain the lack of results). – Alenanno Jan 28 '16 at 16:44forest
package and actually use it for some visualizations too. I'll check the syntax again, thank you :) – Christoph Jan 28 '16 at 16:56\draw (A) -- (B);
doesn't work? – cfr Jan 28 '16 at 23:45