// HACKER NEWS — CYBERSECURITY
Show HN: Reladraw – A diagram language where you decide where to place things
A text language for diagrams where you say where things go.
Try it in your browser → — edit the source on the left, watch the layout re-solve on the right. Nothing to install.
And the same diagram written down in reladraw and rendered from the text — examples/arch.reladraw, 44 statements, no coordinates anywhere in it:
Every distance in the second picture was worked out from statements like above-left of cluster.hub and between cluster.desktop1 and cluster.laptop1. Nothing chose the arrangement; the file states it.
Mermaid, Graphviz and D2 have you declare entities and connections, and then place everything for you. That is a superpower, and for most diagrams it is the right one. It stops being the right one as soon as you have a particular picture in mind and care where things go. Say you are actively building your understanding of a system by diagramming it, and you want some module over to the right with its connections placed just so: the auto-layout languages have no way to say it.
On the other end of the spectrum are the absolute-positioning tools — draw.io, Excalidraw, Figma. They give you total control of placement, at the cost of making every edit to a complex diagram slow hand-work. And it is slow for a human but expensive for an agent, which has to work the picture out from the coordinates before it can decide which ones to change.
reladraw aims at the middle. Every position is stated relative to something else, and nothing in the file is a coordinate:
Nothing is nested, so no line depends on another line's position or indentation.
The draft is in SYNTAX.md, with a worked example in examples/.
The common case is not drawing a diagram, it is changing one. Ask for the auth service to move left and a queue to go behind it. With pixel coordinates, an agent has to rebuild the picture from the numbers before it can work out which numbers to change. With auto-layout there is nothing to read at all, because the arrangement was never written down — it can only reword the source and re-render. With stated placement the arrangement is in the file as sentences, and changing the picture is changing the sentence that says where the thing goes.