0

I am trying to use Graph Drawing in TikZ to layout and connect logic gates. Everything seems fine until I use a layout (like layered layout in particular) and specify an edge head or tail anchor specific to the nodes I am using. If I use an anchor name like 'north', there is no problem. But, if a use an anchor name like 'output' or 'input 1' (which are valid for the nodes I am dealing with), I get the following error:

graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua:213: ...generic/pgf/graphdrawing/lua/pgf/gd/model/Coordinate.lua:154: attempt to index a nil value (local 'a') stack traceback: [C]: in function 'assert' ...graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua:213: in function 'pgf.gd.interface.InterfaceToDisplay.resumeGraphDrawingCoroutine' ...graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua:182: in function 'pgf.gd.interface.InterfaceToDisplay.runGraphDrawingAlgorithm' [\directlua]:1: in main chunk. \pgfgdendscope ...lay.runGraphDrawingAlgorithm() } \pgfutil@loop \ifpgfgdresu... l.14 } ;

Here is a simplified example that produces the error:

\documentclass{standalone}

\usepackage{tikz}
\usetikzlibrary{graphs, graphdrawing}
\usegdlibrary{layered}
\usetikzlibrary{circuits.logic.US}

\begin{document}
\begin{tikzpicture}[circuit logic US]

\graph[layered layout, grow=right]
{
    a[or gate] --[head anchor=input 1] b[or gate];
};

\end{tikzpicture}
\end{document}

And, here is an example that "works" using a directional anchor (which is undesirable):

Sort of working example

\documentclass{standalone}

\usepackage{tikz}
\usetikzlibrary{graphs, graphdrawing}
\usegdlibrary{layered}
\usetikzlibrary{circuits.logic.US}

\begin{document}
\begin{tikzpicture}[circuit logic US]

\graph[layered layout, grow=right]
{
    a[or gate] --[head anchor=north west] b[or gate];
};

\end{tikzpicture}
\end{document}

This issue only occurs when applying a layout with Graph Drawing. Otherwise, the left anchor and right anchor keys with seem to work properly with the Graphs library. However, when a layout is specified, left and right anchors no longer work, and head/tail anchors error out with node-specific anchors.

Anyone have any ideas?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.