Show HN: Reladraw – A diagram language where you decide where to place things
Reladraw is a diagram language that allows users to specify the relative placement of diagram elements. Unlike other diagramming tools that automatically layout elements, Reladraw leaves the positioning up to the user, who defines how elements relate to each other using statements like "above-left of" or "between." This approach offers a balance between automatic layout languages like Mermaid, Graphviz, and D2, which place elements without user input, and absolute-positioning tools like draw.io, Excalidraw, and Figma, which require manual adjustments.
In Reladraw, every position is described relative to another element, eliminating the need for explicit coordinates or nested structures. The syntax is written in plain Markdown, making it easy to read and modify. The language focuses on minimum distances between elements, allowing for automatic adjustments and avoiding stale numbers when text content changes. The solver works by finding the tightest arrangement that satisfies all specified distances, ensuring a clean layout without manual intervention.
Diagnostics are built into Reladraw, providing feedback on issues like overlapping nodes or nodes sticking together. The language is still in development, and its syntax may change, but it offers a practical solution for creating precise, user-defined diagrams without the limitations of fully automatic layout tools.
Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.