-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Labels
Milestone
Description
Brief outline of the proposed feature
Motivation for this change
The conversation at #640 on the possibility of supporting the specification of options that can be applied to multiple examples.
To demonstrate the usage of this feature, I've modified ControlElectric.lua
, while simplifying the code by removing unnecessary double quotes at the same time.
** Pull request already approved **
Usage example
For the record: Here are other examples that could make use of this PR:
-
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua
Lines 101 to 140 in 12f1783
--[[ % TODOsp: codeexamples: the following 3 examples need these libraries % \usetikzlibrary{graphs,graphdrawing} % \usegdlibrary{force} --]] example [[ \begin{tikzpicture} \draw [help lines] (0,0) grid (3,2); \graph [spring layout] { a[x=1] -- { b, c, d, e -- {f,g,h} }; { h, g } -- a; }; \end{tikzpicture} ]] example [[ \begin{tikzpicture} \draw [help lines] (0,0) grid (3,2); \graph [spring layout] { a -- { b, c, d[x=0], e -- {f[x=2], g, h[x=1]} }; { h, g } -- a; }; \end{tikzpicture} ]] example [[ \begin{tikzpicture} \draw [help lines] (0,0) grid (3,2); \graph [spring layout] { a -- { b, c, d[x=0], e -- {f[x=2,y=1], g, h[x=1]} }; { h, g } -- a; }; \end{tikzpicture} ]] -
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua
Lines 170 to 191 in 12f1783
--[[ % TODOsp: codeexamples: the following 4 examples need these libraries % \usetikzlibrary{graphs,graphdrawing} % \usegdlibrary{layered} --]] example [[ \tikz \draw (0,0) -- (1,0.5) graph [edges=red, layered layout, anchor node=a] { a -> {b,c} } -- (1.5,0) graph [edges=blue, layered layout, anchor node=y, anchor at={(2,0)}] { x -> {y,z} }; ]] example [[ \begin{tikzpicture} \draw [help lines] (0,0) grid (3,2); \graph [layered layout, anchor node=c, edges=rounded corners] { a -- {b [x=1,y=1], c [x=1,y=1] } -- d -- a}; \end{tikzpicture} ]]