I am writing an animation in TikZ, where I often have one node appearing in different contexts and want to animate the path it takes from one setting to the other, for now I am preparing the settings using invisible (opacity=0) nodes to calculate the coordinates and anchors to then create a visible node that gets animated. Here's a MWE:
\documentclass[dvisvgm]{standalone} \usepackage{tikz} \usetikzlibrary{positioning} \usetikzlibrary{animations} \begin{document} \begin{tikzpicture}[scale=4,transform shape] \node[circle, draw, ultra thick, fill=blue!20] (Go) at (0,-2) {Go!}; \begin{scope}[ every node/.style={opacity=0.2, draw}, baseline, node distance=0 ] \node (start-M) at (0,0) {Minimal}; \node (start-E) [base right=of start-M] {example}; \node (end-M) at (0,-1) {Minimal}; \node (end-W) [base right=of end-M] {working}; \node (end-E) [base right=of end-W] {example}; \end{scope} \node (M) :position={0s="{(start-M.center)}" base, 1s="{(end-M.center)}", freeze, begin on ={click, of=Go}} {Minimal}; \node (W) at (end-W) :opacity={0s="0" base, 1s="1", freeze, begin on={click, of=Go}} {working}; \node (E) :position={0s="{(start-E.center)}" base, 1s="{(end-E.center)}", freeze, begin on={click, of=Go}} {example}; \end{tikzpicture} \end{document} Here I set opacity=0.2 instead of 0 so you can see the nodes. See the resulting SVG file (click on the go button).
I'm wondering, is it possible to have the nodes of the invisible scope not appear in the SVG file at all? I only need them to calculate positions and afterwards use these positions to draw the visisble nodes.
opacity=0instead ofopacity=0.2?0still results in the nodes appearing in the SVG source.dvisvgmoption--font-format=woff. See tex.stackexchange.com/a/469440 .