Hacker News new | ask | show | jobs
by alixanderwang 297 days 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...

3 comments

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)
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!

So from TFA it just downscales from ELK? Do I have to specify ELK for this to work, or will it automagically enable if I try to output a .txt? (Really I'm just curious becasue I use ELK already for most of my d2 diagrams).
Just wanted to thank you for a great tool :-). I love d2 and ever since I discovered it a couple of years back I've been using it for all my diagramming needs.

Thanks again and keep up the good work!