mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
72.01k stars 6.53k forks source link

Specify colour of individual nodes? #1679

Open chaeron opened 4 years ago

chaeron commented 4 years ago

Is there any way to specify the colour of individual nodes, node by node, most especially for Class and ER nodes?

We have a used case where we need to control the colour of nodes individually in class/er diagrams, to denote different characteristics of nodes (eg. inherited, external, root, etc.)

If not, consider this a feature request for such!

Thanks!

jgreywolf commented 4 years ago

Will using CSS to style the individual nodes work for your scenario?

ari commented 4 years ago

It would be sufficient to have the flowchart classDef concept available everywhere, and those classes could be defined in either the css file or in the code itself.

jgreywolf commented 4 years ago

Currently it is not possible to define cssClasses/styles within the diagram code itself. You can assign classes to a diagram element, but the CSS would need to be defined elsewhere.

Haapavuo commented 3 years ago

So there is still no "class" attribute for nodes that could be used for custom colouring per nodes or node groups? That is going to be a game breaker for me.