Show HN: Reladraw – A diagram language where you decide where to place things

A new diagramming language, Reladraw, aims to bridge the gap between auto-layout tools like Mermaid, Graphviz, and D2 and manual tools like draw.io by letting authors specify relative positioning (“right of,” “below,” specific edge sides) while the engine handles the arithmetic and routing. Commenters praise its clarity of intent, fine-grained control, and suitability for AI agents that need deterministic layouts, while also comparing it to systems like Pikchr, TikZ, PlantUML, and C4 modeling. Key feature requests and early improvements focus on edge routing, themes, multiline and macro-like constructs, and integration into editors and markdown workflows.

Overall reception

  • Many commenters are enthusiastic; several say this fills a long‑standing gap between auto‑layout tools (Mermaid, Graphviz, D2) and manual tools (Draw.io, Excalidraw).
  • Common pain point: fighting layout engines to match a mental picture; Reladraw’s explicit relative placement is seen as a relief.
  • Some say they’ll try it on real work diagrams or integrate it into note‑taking/IDE workflows (Obsidian, VS Code, IntelliJ).

Comparison with existing tools

  • Compared to Pikchr and pic: those are “turtle graphics” or coordinate/offset based; Reladraw is constraint-/relationship-based (e.g., “right of A”).
  • Compared to Mermaid/Graphviz/D2: those decide layout automatically; Reladraw lets users/agents decide placement but still handles arithmetic and collision spacing.
  • Compared to TikZ/PlantUML: TikZ is more powerful but LaTeX-heavy; PlantUML is flexible but still layout‑hint based. Reladraw aims for a narrower, more direct diagram DSL.
  • Some say D2’s TALA already provides advanced constrained layout, but others feel it still doesn’t give deterministic control like Reladraw.

Language design & capabilities

  • Emphasis on nodes, edges, and simple relative relations (left/right/below/of).
  • Edges support right angles (sharp/rounded), styles (solid/dashed/dotted), thickness, and side-specific ports with spacing between multiple edges on a side.
  • Conflicting or ambiguous constraints produce explicit errors rather than silent overrides; there’s debate over strict errors vs warnings and sensible defaults.
  • Current philosophy: no blocks, no multi-line statements; multiple commenters request line continuations and multi-line/long labels, noting parser trade-offs.
  • Planned features: custom attributes, variables, functions, possible macros with parameters, and better reuse mechanisms (e.g., for sequence/C4-style diagrams).
  • Discussion of parameterization from external data (CSV/JSON) and more programmatic generation.

Routing, themes, and bugs

  • No full obstacle-avoiding auto-routing, but edges can “pass between” nodes; some users want less routing micromanagement.
  • Right-angle and curved edge behavior is being iterated; bugs in edge curvature and themes were reported and quickly fixed.
  • Multiple themes (light/dark, including a “Vesper”-like one) now exist; initial Safari/theming glitches noted.

Ecosystem & integration

  • A VS Code extension already exists for rendering and syntax highlighting.
  • Markdown embedding like mermaid on GitHub is not currently possible; local tools can support it via plugins.
  • CLI currently outputs rendered diagrams, but there’s interest in a mode that outputs only resolved positions (JSON) so other renderers/backends can be used.
  • Implementation is TypeScript/Node; some want smaller, dependency‑free binaries. Experiments with tools like scriptc and Deno are mentioned, with trade-offs in binary size.

AI/agents and workflow

  • Several commenters explicitly want this as an “agent-friendly” diagram DSL: agents can express relative layout instead of guessing coordinates or fighting auto-layout.
  • Some argue for even more “visual-first” approaches (pure visual programming/UML), while others report good results letting agents drive Draw.io or Graphviz.
  • One person notes they now often just prompt frontier models to emit SVG directly, but others find a stable DSL valuable for reproducibility and control.

Critiques and skepticism

  • Some consider the syntax and constraints potentially cumbersome for long labels and complex layouts until multiline/continuation is added.
  • Concerns over language fragmentation vs extending Mermaid or D2; others think mixing auto‑layout and strong constraints would be too complex.
  • One commenter questions the project’s value if large parts appear LLM-generated, suggesting distrust, while others push back on that stance.
  • Overall, there is a mix of excitement about the concept and recognition that ergonomics, reuse, and ecosystem support will determine long‑term adoption.