digitalmars.D - Graph rendering on dlang.org
- Andrei Alexandrescu (10/10) Jun 30 2017 Currently we have a nice table at
- Brian Schott (14/17) Jun 30 2017 Graphviz's "dot" tool can output svg.
- Andrei Alexandrescu (3/22) Jun 30 2017 Whoa, pretty nice: http://erdani.com/conversions.svg. How do I place the...
- Brian Schott (6/8) Jun 30 2017 digraph "conversion" {
- H. S. Teoh via Digitalmars-d (17/40) Jun 30 2017 Like this:
- Patrick Schluter (5/22) Jul 01 2017 That's what doxygen uses to generate call graphs, callee graphs,
- Andrei Alexandrescu (4/29) Jul 01 2017 That's a cool idea. (Do it!) At least at a point someone generated the
- Jonathan Marler (23/35) Jul 01 2017 There's also mermaid. They have a live editor here:
- Cym13 (4/10) Jul 01 2017 Graphviz looks nicer both as diagram and markup honnestly; the
- Jonathan Marler (28/40) Jul 01 2017 I'm not an expert, but from what I've read mermaid has some nice
- Cym13 (2/14) Jul 01 2017 That does look way nicer, thanks!
- Mark (5/17) Jul 02 2017 My experience with GraphViz is that it's okay for simple, small
- Mario =?UTF-8?B?S3LDtnBsaW4=?= (23/23) Jul 01 2017 Try http://plantuml.com/ (based on dot). Paste
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
Jun 30 2017
On Friday, 30 June 2017 at 21:40:05 UTC, Andrei Alexandrescu wrote: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.Graphviz's "dot" tool can output svg. digraph "conversions" { "mutable" -> "const"; "inout const" -> "const"; "inout" -> "inout const"; "immutable" -> "inout const"; "immutable" -> "inout shared const"; "inout shared" -> "inout shared const"; "shared" -> "shared const"; "inout shared const" -> "shared const"; } dot -Tsvg conversions.dot > conversions.svg
Jun 30 2017
On 06/30/2017 05:52 PM, Brian Schott wrote:On Friday, 30 June 2017 at 21:40:05 UTC, Andrei Alexandrescu wrote:Whoa, pretty nice: http://erdani.com/conversions.svg. How do I place the whole thing upside down? Thanks! -- AndreiWhat 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.Graphviz's "dot" tool can output svg. digraph "conversions" { "mutable" -> "const"; "inout const" -> "const"; "inout" -> "inout const"; "immutable" -> "inout const"; "immutable" -> "inout shared const"; "inout shared" -> "inout shared const"; "shared" -> "shared const"; "inout shared const" -> "shared const"; } dot -Tsvg conversions.dot > conversions.svg
Jun 30 2017
On Friday, 30 June 2017 at 21:55:34 UTC, Andrei Alexandrescu wrote:Whoa, pretty nice: http://erdani.com/conversions.svg. How do I place the whole thing upside down? Thanks! -- Andreidigraph "conversion" { rankdir="BT"; ... }
Jun 30 2017
On Fri, Jun 30, 2017 at 05:55:34PM -0400, Andrei Alexandrescu via Digitalmars-d wrote:On 06/30/2017 05:52 PM, Brian Schott wrote:Like this: digraph { edge[dir="back"]; const; const -> mutable; const -> "inout const"; const -> inout; "inout const" -> immutable; "inout shared const" -> immutable; "inout shared const" -> "inout shared"; "shared const" -> "inout shared const"; "shared const" -> shared; } T -- Freedom: (n.) Man's self-given right to be enslaved by his own depravity.On Friday, 30 June 2017 at 21:40:05 UTC, Andrei Alexandrescu wrote:Whoa, pretty nice: http://erdani.com/conversions.svg. How do I place the whole thing upside down? Thanks! -- AndreiWhat 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.Graphviz's "dot" tool can output svg. digraph "conversions" { "mutable" -> "const"; "inout const" -> "const"; "inout" -> "inout const"; "immutable" -> "inout const"; "immutable" -> "inout shared const"; "inout shared" -> "inout shared const"; "shared" -> "shared const"; "inout shared const" -> "shared const"; } dot -Tsvg conversions.dot > conversions.svg
Jun 30 2017
On Friday, 30 June 2017 at 21:52:10 UTC, Brian Schott wrote:On Friday, 30 June 2017 at 21:40:05 UTC, Andrei Alexandrescu wrote:That's what doxygen uses to generate call graphs, callee graphs, include hierarchies and other stuff. The dot language can also be embedded directly in the comments. It would be nice if the D document generator also used it.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.Graphviz's "dot" tool can output svg. digraph "conversions" { "mutable" -> "const"; "inout const" -> "const"; "inout" -> "inout const"; "immutable" -> "inout const"; "immutable" -> "inout shared const"; "inout shared" -> "inout shared const"; "shared" -> "shared const"; "inout shared const" -> "shared const"; } dot -Tsvg conversions.dot > conversions.svg
Jul 01 2017
On 07/01/2017 03:56 AM, Patrick Schluter wrote:On Friday, 30 June 2017 at 21:52:10 UTC, Brian Schott wrote:That's a cool idea. (Do it!) At least at a point someone generated the global import graph for phobos. It would be great to have that available permanently so we know how to improve it. -- AndreiOn Friday, 30 June 2017 at 21:40:05 UTC, Andrei Alexandrescu wrote:That's what doxygen uses to generate call graphs, callee graphs, include hierarchies and other stuff. The dot language can also be embedded directly in the comments. It would be nice if the D document generator also used it.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.Graphviz's "dot" tool can output svg. digraph "conversions" { "mutable" -> "const"; "inout const" -> "const"; "inout" -> "inout const"; "immutable" -> "inout const"; "immutable" -> "inout shared const"; "inout shared" -> "inout shared const"; "shared" -> "shared const"; "inout shared const" -> "shared const"; } dot -Tsvg conversions.dot > conversions.svg
Jul 01 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, AndreiThere'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
Jul 01 2017
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: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.[...]There's also mermaid. They have a live editor here: https://knsv.github.io/mermaid/live_editor/ [...]
Jul 01 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: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_constOn Friday, 30 June 2017 at 21:40:05 UTC, Andrei Alexandrescu wrote: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.[...]There's also mermaid. They have a live editor here: https://knsv.github.io/mermaid/live_editor/ [...]
Jul 01 2017
On Saturday, 1 July 2017 at 22:09:49 UTC, Jonathan Marler wrote: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_constThat does look way nicer, thanks!
Jul 01 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:My experience with GraphViz is that it's okay for simple, small diagrams but when I want to make something more complex it can be incredibly frustrating to make the digram look the way you want. I didn't try Mermaid or any other visualization tools, though.On Friday, 30 June 2017 at 21:40:05 UTC, Andrei Alexandrescu wrote: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.[...]There's also mermaid. They have a live editor here: https://knsv.github.io/mermaid/live_editor/ [...]
Jul 02 2017
Try http://plantuml.com/ (based on dot). Paste startuml hide circle hide empty attributes hide empty methods class "mutable" class "const" class "inout" class "inout const" class "immutable" class "shared" class "shared const" class "inout shared const" "mutable" -up-> "const" "inout const" -up-> "const" "inout" -up-> "inout const" "immutable" -up-> "inout const" "immutable" -up-> "inout shared const" "inout shared" -up-> "inout shared const" "shared" -up-> "shared const" "inout shared const" -up-> "shared const" enduml http://www.plantuml.com/plantuml/svg/bOyz2i0W38LtJn7SUuNUnMf0GMinSUZjIuTA4wJGpVV3yqjC0S6dvZEQUB-n77o2OsvfwupqTWjoh86CyTaHWIsTtPRHFjhNdNYejDUk5AX6qGiKNSEW94nsGKPciC3IZsKTBEBVQJPSGVXY-vTBBc5-DrNdOqTT8ymB
Jul 01 2017