Graph rendering on dlang.org

Jonathan Marler via Digitalmars-d digitalmars-d at puremagic.com
Sat Jul 1 15:09:49 PDT 2017


On Saturday, 1 July 2017 at 20:53:07 UTC, Cym13 wrote:
> On Saturday, 1 July 2017 at 19:19:09 UTC, Jonathan Marler wrote:
>> On Friday, 30 June 2017 at 21:40:05 UTC, Andrei Alexandrescu 
>> wrote:
>>> [...]
>>
>> There's also mermaid.  They have a live editor here: 
>> https://knsv.github.io/mermaid/live_editor/
>>
>> [...]
>
> Graphviz looks nicer both as diagram and markup honnestly; the 
> separation in two halves make it harder to read for me compared 
> to the more direct approach of graphviz.

I'm not an expert, but from what I've read mermaid has some nice 
tools that make it easy to integrate into websites such as 
styling via CSS and javascript libraries that convert mermaid to 
SVG.  This allows graphics to be generated on the client side 
(kinda cool).  Since the graphs are styled via CSS a website 
could make sure all their graphs are styled consistently, and the 
style can be changed without having to regenerate the graphic.

I've used both GraphViz and Mermaid a little, I opted to use 
mermaid recently because of the live editor, didn't have to 
download any tools and saw my results right away which was very 
convenient. I've also used GraphViz which was nice but had it's 
own quirks.  I'm also not sure if GraphViz supports sequence 
diagrams, that might be why I found mermaid in the first place.  
Not sure which one is better, would be good to get an opinion 
from someone who was a good amount of experience with both.  I'm 
not sure what you meant in your comment by "the separation in two 
halves make it harder to read"....I've rewritten the same graph 
so it looks more like the GraphViz version:

graph BT
   mutable --> const
   inout_const[inout const] --> const
   inout --> inout_const
   immutable --> inout_const
   immutable --> inout_shared_const[inout shared const]
   inout_shared[inout shared] --> inout_shared_const
   shared --> shared_const[shared const]
   inout_shared_const --> shared_const


More information about the Digitalmars-d mailing list