mb14
mb14

Reputation: 22616

Add svg attributes in diagrams

I would like to add tooltips (or hovering behavior) on SVG diagrams generated by diagrams.

Is there a way to add custom properties to a diagram , or worst comes to the worst be able to set and id to things, so they can be referred to in Javascript.

Upvotes: 4

Views: 99

Answers (2)

Finn Espen Gundersen
Finn Espen Gundersen

Reputation: 93

The question is slightly misleading because the title property that gives tooltips on SVGs in browsers is not an attribute, but an element of its own. You add tooltips, that is SVG titles, with the method svgTitle in Diagrams.Backend.SVG.

The same module also contains methods svgID and svgClass to add these attributes to allow external javascript to find specific SVG elements.

Upvotes: 1

Chris Wohlert
Chris Wohlert

Reputation: 600

I kept googling, and havn't tried it yet, but I found this. It seems to exist to exactly satisfy your need.

It is SVG backend only.

Upvotes: 0

Related Questions