news.volyx.in

D2, a diagram scripting language that turns text to diagrams, is now open source (github.com)

629 points by alixanderwang · 1385 days ago · 155 comments on HN

Article summary

D2 is a diagram scripting language that turns text into diagrams and is now open source. The language is designed for software architecture diagrams and is compared to other tools like MermaidJS, Graphviz, and PlantUML on the website text-to-diagram.com. The company behind D2, Terrastruct, offers an alternative layout engine for sale, but the open-source version of D2 is usable without it. The language is written in Go and has a simple syntax for creating diagrams.

Main themes

  • diagram scripting languages
  • software architecture diagrams
  • graph layout algorithms
  • open-source tools
  • niche approaches to diagramming
  • plugin development

What commenters say

  • The default layout algorithms for graphs often perform poorly, especially for larger graphs.
  • D2 is well-suited for software architecture diagrams, but may not be the best choice for very large graphs or other types of diagrams.
  • Graphviz can handle large graphs with thousands of nodes, but may struggle with edge layout.
  • The choice of layout algorithm and defaults can significantly impact the usability and appearance of diagrams.
  • There is a need for niche approaches to diagramming, as general-purpose tools may not meet specific use cases.
  • The open-source community can benefit from more tools and plugins for diagramming, such as an Obsidian plugin for D2.
  • Some users prefer D2's syntax and defaults over other tools like MermaidJS and Graphviz.
  • The use of deprecated libraries like dagrejs can be a concern, but may be mitigated by maintaining a wrapper or fork.