I'm including the dvisvgm svg output of tikz in an html page, and I would like to be able to refer to some specific elements to eg restyle them or animate them via javascript.
To this end, it would be extremely useful if dvisvgm could add a id attribute matching the named tikz nodes & paths, algonside some class information (for instance, node, the shape -- circle, etc).
For instance,
\documentclass[tikz,dvisvgm]{standalone}
\begin{document}
\begin{tikzpicture}
\node[draw] (node1) at (0,0) {Hello world};
\node[draw, shape=circle] (node2) at (1,1) {Hello world 2};
\path (node1) edge[->,name=edge1] (node2);
\end{tikzpicture}
\end{document}
Brief outline of the proposed feature
Issue originally reported in
dvisvgm
: https://github.com/mgieseki/dvisvgm/issues/270I'm including the
dvisvgm
svg output of tikz in an html page, and I would like to be able to refer to some specific elements to eg restyle them or animate them via javascript.To this end, it would be extremely useful if
dvisvgm
could add aid
attribute matching the named tikz nodes & paths, algonside some class information (for instance,node
, the shape --circle
, etc).For instance,
would generate something like:
This would require tikz to expose the names to the
dvisvgm
backend. Would it be feasible?Usage example
No response