-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature request] id and class attributes for nodes and paths #270
Comments
A possible workaround if of course to manually wrap the nodes and paths in \documentclass[tikz,dvisvgm]{standalone}
\newcommand{\svgid}[1]{\special{dvisvgm:raw <g id='#1'>}}
\newcommand{\svgidend}{\special{dvisvgm:raw </g>}}
\begin{document}
\begin{tikzpicture}
\svgid{node1}
\node[draw] (node1) at (0,0) {Hello world};
\svgidend
\svgid{node2}
\node[draw] (node2) at (1,1) {Hello world 2};
\svgidend
\svgid{edge1}
\path (node1) edge[->] (node2);
\svgidend
\end{tikzpicture}
\end{document} This works as expected, but not great usability... |
The DVI file doesn't contain any information about the origins of the embedded SVG or PS fragments. Therefore, it's not possible to find out which parts were created by TikZ and which macros/commands were used in the |
thanks a lot for the quick feedback! I've opened an issue here: pgf-tikz/pgf#1344 |
I'm including the
dvisvgm
svg output 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 to the named tikz nodes & paths, algonside some class information (for instance,node
, the shape --circle
, etc).For instance,
would generate something like:
I understand that the tikz names are not visible to the drivers (at least, they do not seem to appear in the output
dvi
file). So it might require some tricks somewhere in the pipeline?The text was updated successfully, but these errors were encountered: