Live data from Hacker News

D2 (text to diagram tool) now supports ASCII renders

d2lang.com

41–50 of 74 posts

Re: D2 (text to diagram tool) now supports ASCII renders

#41

Earlier quoted context omitted.

I thought your playground wasn't working as it renders black text on black background. Maybe I have darkmode enabled or something. Other renderers work, but ascii is invisible.

Ah right, forgot to test the update with dark mode. Thanks for letting me know! edit: fixed

Does the SVG renderer support custom IDs and/or attributes on nodes? If so I'll add support for this to Stylus (https://github.com/mmastrac/stylus)

Re: D2 (text to diagram tool) now supports ASCII renders

#43
Oh, this is excellent! The syntax of D2 is very compelling but the tooling of Mermaid has unfortunately made it win out for me more times than not in the last few years. This, however, is a genuinely novel thing that I don't think I've seen Mermaid do. Bridges the gap to https://asciiflow.com/ quite nicely.

Re: D2 (text to diagram tool) now supports ASCII renders

#45

Earlier quoted context omitted.

How on earth can it be weird that a vim extension is written in vimscript?!

Vim is basically dead. Most new plugins are written in Lue (for Neovim). I don’t like Lue much but it’s 1000x better than vim script. I occasionally tweak my Neovim plugins but don’t bother with those written in Vimscript.

1. Vim is extremely alive

2. “Lue” is actually Lua

3. It’s very possible to use both Vimscript and Lua in the same Neovim setup, so transition (or don’t) at your leisure.

4. New plugins tend to be written in Lua (for Neovim).

Re: D2 (text to diagram tool) now supports ASCII renders

#46

Earlier quoted context omitted.

Ah right, forgot to test the update with dark mode. Thanks for letting me know! edit: fixed

Does the SVG renderer support custom IDs and/or attributes on nodes? If so I'll add support for this to Stylus ( https://github.com/mmastrac/stylus )

Yeah I think what you're looking for is the note at the end of this section: https://d2lang.com/tour/exports/#svg

Feel free to make a PR to d2/d2-docs to include it in our list of community tools/plugins if you do!

Re: D2 (text to diagram tool) now supports ASCII renders

#47
1. how does this add value over mermaid? I like how it looks and works, but is there any real reason to switch over.

2. in my opinion, what all these tools are missing is the ability to add a manual „corrective“ layer, meaning to be able to adjust the automatically created output by moving and resizing boxes by a certain x/y amount.

Re: D2 (text to diagram tool) now supports ASCII renders

#48
post #47

1. how does this add value over mermaid? I like how it looks and works, but is there any real reason to switch over. 2. in my opinion, what all these tools are missing is the ability to add a manual „corrective“ layer, meaning to be able to adjust the automatically created output by moving and resizing boxes by a certain x/y amount.

1. It depends on what you value =). For some, those 2 you mentioned are enough. For others, it can be something like the our CLI doesn't require a chromium browser to render SVGs (https://news.ycombinator.com/item?id=31275754). It doesn't cover every difference, but we made a little comparison site if it helps: https://text-to-diagram.com

2. I'm not trying to advertise our paid product in this post about the open source product, but since you mentioned it, we make an IDE that adds the ability to lock in positions and dimensions: https://docs.terrastruct.com/tour/freehand

Re: D2 (text to diagram tool) now supports ASCII renders

#50

This looks way better than mermaid. Is there support for this in GitHub PR code blocks like mermaid?

Unfortunately not, I've tried reaching out to GH folks but no dice. However it should be noted that d2.js, which enables client-side renders, didn't really become usable until this month and still isn't really officially released (kind of hidden). So, we'll see if the official release (soon™) changes things. If any D2-enjoyers reading this knows anyone on the GH frontend team, plz bend their ear =)

Good luck, it would be fantastic if you can get it accepted as a mermaid alternative; it's much, much niceer than mermaid, both the visual result, and the language. I've used D2 heavily for a couple of years or so now. It's really fantastic. I hope you're paid product is healthy. Sequence diagrams are my most common diagram type by some way I think. And I seem to always use the sketch rendering over the last year.

While you're here, can I mention a feature request? I'd like to be able to put clickable hyperlinks into sequence diagram arrow labels (e.g. so I can link the message to where in the code it occurs).

Also, I'd like more control over vertical spacing in sequence diagrams, and perhaps the ability to define groups of columns (just visually grouped).

Post reply on HN