Mermaid: Class diagram: Add support for annotations

Created on 30 Sep 2019  Â·  5Comments  Â·  Source: mermaid-js/mermaid

In UML diagrams, types are often decorated with annotations.


Same goes for all kinds of annotations. It makes easy to understand the purpose of the described type. This is not possible atm. Having annotations support would make the class diagram a lot more useful and could make it a replacement for other diagram tools.

Class Approved Enhancement

Most helpful comment

I would give this issue a try and try to implement it. PR coming soonâ„¢

All 5 comments

Yes this would be very appreciated, so it's possible to mark an entity as an interface.

I would give this issue a try and try to implement it. PR coming soonâ„¢

@chris579 Don't forget to drop by our slack if you need any help!

Looking forward to the PR @chris579. A heads up, @ashishjain0512 is also working with class diagrams. You two might want to sync up to avoid merging conflicts.

Regarding the syntax I came up with some ideas. What would you prefer?

In front of class definitions. Not my favorite solution because when using multiple ones (which should be possible) the line will get very long.

class <<interface>> <<injected>> MyInterface
class <<interface>> <<injected>> MyInterface {
}

Only for bracket syntax

class MyInterface {
<<interface>>
<<injected>>
}

As a separate statement that allows separate definitions to make things look cleaner.

class MyInterface
<<interface>> MyInterface
<<injected>> MyInterface

I would favor for the last solution. Looks straight forward for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

visualcurrent picture visualcurrent  Â·  3Comments

lth946965333 picture lth946965333  Â·  3Comments

yk-liu picture yk-liu  Â·  4Comments

init-dcat-ap-de picture init-dcat-ap-de  Â·  3Comments

lwalker-kforce picture lwalker-kforce  Â·  3Comments