State management in CeTZ #739
-
Is there a
Maybe I can use the Cetz context for this, but I haven't been able to figure out how it works. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Maybe using anchors is enough for drawing nodes next to each other? Note that you can overwrite anchors (e.g. calling something like Yes, you can use cetz context for this. The simplest way to modify the context is by calling An element function (like For an example, have a look at how |
Beta Was this translation helpful? Give feedback.
Maybe using anchors is enough for drawing nodes next to each other? Note that you can overwrite anchors (e.g. calling something like
anchor("last-elem", (...))
multiple times works).Yes, you can use cetz context for this. The simplest way to modify the context is by calling
set-ctx(ctx => { ... return ctx })
. If you need more control, you can define your own elements, because all elements can modify the context (note that the context is scoped by groups/scopes).An element function (like
line()
) returns a single-element array containing a functionthat takes a context and returns a dictionary with it's (optional) drawables (paths) and a new context.
For an example, have a look at how
group
…