Graph rendering on dlang.org

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


On Friday, 30 June 2017 at 21:40:05 UTC, Andrei Alexandrescu 
wrote:
> Currently we have a nice table at 
> https://dlang.org/spec/const3.html#implicit_conversions 
> documenting how implicit conversions work across qualifiers. 
> While complete and informative, it doesn't quickly give an 
> intuition.
>
> A DAG like the sketch at http://imgur.com/a/VuxLT would be easy 
> to follow - all paths are possible conversions.
>
> What would be a nice tool to render this DAG online? Who'd want 
> to work on inserting this? Ideally it would be some vector 
> rendering.
>
>
> Thanks,
>
> Andrei

There's also mermaid.  They have a live editor here: 
https://knsv.github.io/mermaid/live_editor/

You can view the diagram here: 
https://knsv.github.io/mermaid/live_editor/#/view/Z3JhcGggQlQKCiUlIERlY2xhcmUgTm9kZXMgV2l0aCBTcGFjZXMgaW4gdGhlaXIgTmFtZQppbm91dF9jb25zdFtpbm91dCBjb25zdF0Kc2hhcmVkX2NvbnN0W3NoYXJlZCBjb25zdF0KaW5vdXRfc2hhcmVkX2NvbnN0W2lub3V0IHNoYXJlZCBjb25zdF0KaW5vdXRfc2hhcmVkW2lub3V0IHNoYXJlZF0KCiUlIExlZnQgaGFuZCBzaWRlIG9mIGdyYXBoCm11dGFibGUgLS0-IGNvbnN0Cmlub3V0X2NvbnN0IC0tPiBjb25zdAppbm91dCAtLT4gaW5vdXRfY29uc3QKaW1tdXRhYmxlIC0tPiBpbm91dF9jb25zdAoKJSUgUmlnaHQgaGFuZCBzaWRlIG9mIGdyYXBoCmltbXV0YWJsZSAtLT4gaW5vdXRfc2hhcmVkX2NvbnN0Cmlub3V0X3NoYXJlZCAtLT4gaW5vdXRfc2hhcmVkX2NvbnN0CnNoYXJlZCAtLT4gc2hhcmVkX2NvbnN0Cmlub3V0X3NoYXJlZF9jb25zdCAtLT4gc2hhcmVkX2NvbnN0

The syntax to create the given graph would be:

graph BT

%% Declare Nodes With Spaces in their Name
inout_const[inout const]
shared_const[shared const]
inout_shared_const[inout shared const]
inout_shared[inout shared]

%% Left hand side of graph
mutable --> const
inout_const --> const
inout --> inout_const
immutable --> inout_const

%% Right hand side of graph
immutable --> inout_shared_const
inout_shared --> inout_shared_const
shared --> shared_const
inout_shared_const --> shared_const



More information about the Digitalmars-d mailing list