D2 (text to diagram tool) now supports ASCII renders

d2lang.com

426 points by alixanderwang a day ago


alixanderwang - a day ago

Hello fellow devs. Just wanted to share a new feature we added this morning, though it's very alpha stage (already someone's filed a github issue for it hah)

If you want to skip the blog post and poke around directly: https://play.d2lang.com/?script=qlDQtVOotFLIyFTwSEzOTi1S8Est...

For a bigger example: https://play.d2lang.com/?script=rJJBjtswDEX3OgWBrm2kzU4Feoru...

mwexler - 17 hours ago

I appreciated the link to this helpful comparison site:

https://text-to-diagram.com/

lidavidm - a day ago

I always liked D2 more than mermaid, except IMO, this makes grid layouts essentially useless: https://github.com/terrastruct/d2/issues/1164

Having to figure out the exact pixel widths defeats the point of these tools, at least for me.

arunc - a day ago

Conversion from ASCII is nice. How do we get the original D2 source if there's a need to update the diagram?!

smusamashah - a day ago

I maintain a list of browser based text to diagram tools (which I have shared a number of times here). I recently realised that the online version of D2 does NOT work solely in browser, diagram's are generated by backend servers.

Can D2 work in browser by itself? Does the extension mentioned in the post work offline? (lots of tools do)

hiAndrewQuinn - a day ago

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.

fzeindl - a day ago

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.

masfoobar - 17 hours ago

I dont think I've come across this one.

I have experimented with other text-based diagrams - but this certainly looks interesting.

While I am always forced (at workplace) to use a GUI-based diagram like Visio... I see more merit to this one.

Definitely worth a play with my home-based or own business setups.

robertlagrant - a day ago

This looks cool. And I saw the previous post you got C4 support! I'm just about to do some C4 things; I'll check it out.

tombert - a day ago

This is awesome.

I hadn't heard of D2, but I love the idea that I can create my charts directly in Neovim in the terminal to get a rough draft, and do a final render with a pretty picture.

I will be playing with this shortly.

reactordev - a day ago

The vim extension is such a flex...

heliophobicdude - a day ago

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

jillesvangurp - a day ago

Llm to text to diagram is the killer workflow these days.

The key challenge is making these things presentable. Optimizing them for human editability is a secondary concern at this point. This is where a lot of these tools fall apart.

peroids - a day ago

Can you please establish an official python repository? I’ve been wanting to use this in notebooks but am forced to use databricks

jiehong - a day ago

I’ve been using d2 for sequences diagrams or migration diagrams and I like it!

This new feature is interesting!

eric-p7 - a day ago

Not to be confused with The D Programming Language, which has a similar domain (dlang.org), and is currently on version 2.

CuriouslyC - a day ago

This will be super helpful for saving context feeding architecture diagrams to LLMs.

sidewndr46 - a day ago

Does this mean a quine is possible?

scrubs - a day ago

Talk about awesome. This is awesome. I'm gonna use it. Super cool.

HeartofCPU - 21 hours ago

Love it

bxpn77 - a day ago

Super cool!

mielebauknecht - a day ago

wow! Now d2 is turned into something that is acually useful!