[mindmap] Please add the possibility to assign an ID and/or a class to the generated element for the SVG export

0 votes
asked 3 days ago in Wanted features by kasra (1,040 points)


In Graphviz, we have 3 important attributes for the SVG export : 

  • class : Classnames to attach to the node, edge, graph, or cluster's SVG element
  • id : identifiers for graph objects

  • stylesheet : A URL or pathname specifying an XML style sheet, used in SVG output

These attributes are important if we want to add with javascript some interactivity to the diagram.

What are the possibilities in Plantuml today ? I checked a bit the documentation but I did not see anything linked to that topic.

If we focus on mindmap, the generated node is a rect followed by a text

for example in the mindmap diagram if we have : + Some Node

it will produce 

<rect ...attributes></rect> // shape for the node

<text ...attributes >Some Node</text> // the text of the node

(it's the simplest case, if links are added then anchors will appear...)

I would love to have the ability to produce : 

<rect id="myID" class="myClass" ...></rect> // shape for the node

<text ...>Some Node</text> // the text of the node

Today we can reference classname like so : 


+ Some Node<<myClass>> 

  • we could then add in the corresponding element this class name (<rect class="myClass" ...></rect>) 
  • Why the element rect instead of the element text ? I don't really care the important part is to have some infos that helps us to know where we are.

of course I understand the problem... for plantuml point of view <<myClass>> is used to apply the style defined by 





and we could have  FontSize and BackGroundColor inside it. 

  • FontSize will  impact the text element, 
  • BackGroundColor will impact the rect element

so we indeed have a problem of consistency here...because "one plantuml statement" produces multiple svg elements... so I don't know how we could resolve that.


+ Some Node<<#myID>>   ( to keep things close to the web ) 

  • we can then add in the corresponding element this id (<rect id="myID" ...></rect>) 

Here the issue is why target rect element rather than the text element ? 

Class and ID

+ Some Node<<#myID myClass>> 

  • we can then add in the corresponding element both (<rect id="myID" class="myClass" ...></rect>) 

This is just a straightforward first draft to present the request


Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.