-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add Mermaid diagram generators #27
Comments
This would be very useful for us to keep diagrams in markdown documentation automatically up to date |
This is currently on hold due to too limited template class rendering (called in Mermaid
renders the following diagram: classDiagram
class A~T~ {
+T value
}
class A~T,N~ {
}
class A~int~ {
}
A~int~ <|.. A~T~
with only |
That's a shame. Seems like there is an open issue for mermaid regarding this mermaid-js/mermaid#3287 ? But no movement sadly. |
Looks like there is some movement on the mermaid issue and there is a Mermaid Chart team that's going to be tackling some issues. mermaid-js/mermaid#4227 |
@bkryza Even with the limitation for class templates, would it still be worth pursuing this so that diagrams can be generated for non-template code? |
@DeveloperPaul123 Personally to me it's not worth it as this is very serious limitation and the effort related to developing it and even more so on maintaining it is just too big. However, if Mermaid finally supports them then I will definitely reconsider! Also, if you're really pressed to have diagrams in Mermaid format, please note that |
@bkryza That seems reasonable; and thanks for the tip regarding How stable is the JSON output format at this point? |
@DeveloperPaul123 This is a good question :-) On the one hand I'd like to think that at least the overall structure of the JSON is stable, as I already have substantial amount of test cases for it, but on the other hand it is a very new feature so it also depends on the feedback I get on it... |
@bkryza That seems reasonable. In the short term, until feedback is received, would it be possible to add a |
@DeveloperPaul123 The latest version (0.3.4) now contains by default the following JSON element: "metadata": {
"clang_uml_version": "0.3.4",
"llvm_version": "Ubuntu clang version 15.0.6",
"schema_version": 1
}, |
@bkryza Awesome, thanks for adding that! |
Hi @bkryza , mermaid layout looks quite lot like dot, with dot engine layout. I was trying to convert json to dot and render, had success with less than 15 class nodes. I am curious what are lucrative features from mermaid ? |
@mahatt The main benefit of MermaidJS is that the diagrams can be rendered in-browser, so you can just keep their source in your Markdown documentation and the diagrams are generated on the fly, in particular GitHub's markdown supports it. Unfortunately, due to current very limited support for template parameters/arguments in Mermaid, this issue is on hold - I keep it open for discussions and hopefully if Mermaid's handling of templates is improved I might considering adding support for it... |
It looks like mermaid has potentially fixed issues with template types. They have a PR that has been merged. See mermaid-js/mermaid#3287 (comment) and mermaid-js/mermaid#4565 |
@DeveloperPaul123 I've deployed locally their latest
classDiagram
class A001["A<T>"] {
}
class A002["A<int>"] {
}
class A003["A<std::function(int,std::string)>"] {
+std::vector<std::function(int,std::string)> func
}
A001 <|.. A002
A001 <|.. A003
In a nutshell, I can just generate class names based on unique identifiers in my model, and then generate the actual class label and use the unique class names for relationships. The question is whether you care about how the actual diagram source code looks like - or are you just interested in the output diagram? Anyway with this, I'll definitely revisit the MermaidJS generator, maybe even for the next release... |
@bkryza Thanks for the update! For me personally I would say that we care more about the generated diagram, and not so much what the diagram source code looks like. |
@DeveloperPaul123 Latest release 0.4.0 now contains support for MermaidJS for all types of diagrams supported already for PlantUML (just add You can browse through test cases documentation to compare PlantUML and Mermaid diagrams generates from the same code snippets. If you'll have any specific issues with Mermaid generator please open new issue... |
@bkryza This is amazing! Thanks for the update. I'll be sure to give this a try on some of our projects. Thanks again |
Add at least basic support for generation of Mermaid (https://mermaid-js.github.io) diagrams in addition to PlantUML...
The text was updated successfully, but these errors were encountered: