logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·30.10.26
← Back to news

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

Original article
github.com|370 points|102 comments|by jpwalsh234|Sep 26, 2026

Reladraw: A Diagramming Language for Precise Placement

Reladraw is a text-based language designed for creating diagrams where the author—not an algorithm—determines the spatial arrangement of elements.

"I wanted to be able to create custom, expressive diagrams where I decided how to arrange the diagram, but without the inefficiency of manually drawing in draw.io."

The Problem Space

Most diagramming tools fall into two extreme categories. Reladraw aims to bridge this gap:

Tool TypeExamplesPlacement LogicProsCons
DeclarativeMermaid, Graphviz, D2AutomatedFast to writeLack of control\text{Lack of control}Lack of control
Manualdraw.io, ExcalidrawAbsoluteTotal controlHighly inefficient
ReladrawreladrawRelativeExpressive & FastSyntax is evolving

Visualizing the Gap

The two ends of the spectrum, with reladraw between them

How it Works: Relative Positioning

Unlike absolute coordinates, Reladraw uses relative logic. Mathematically, the position of a node N2N_2N2​ can be defined as a function of N1N_1N1​: Pos(N2)=Pos(N1)+offset(direction)Pos(N_2) = Pos(N_1) + \text{offset}(\text{direction})Pos(N2​)=Pos(N1​)+offset(direction)

Example Comparison

Manual Reference: Hand-drawn reference diagram

Reladraw Render: reference diagram via reladraw

The Source Code:

node app "Web app" 
node app.ui "Interface" 
node app.api "API" below app.ui 

node store "Database" right of app level with app 

edge app.api - store "queries" from: right to: left

Getting Started

  • Install the CLI
  • Create a .reladraw file
  • Render to SVG

Installation

To install globally via npm: npm install -g reladraw

To render a file: reladraw diagram.reladraw -o diagram.svg

Alternatively, you can build from a clone to access examples:

npm install
npm run build
node dist/cli.js examples/arch.reladraw -o out.svg

Integration with AI Agents

You can provide a "skill" to your AI agent (such as Claude Code, Cursor, Copilot, or Codex) so it understands how to write Reladraw:

Global installation for all agents: npx skills add reladraw/reladraw -g

Targeted installation for a specific agent (e.g., claude-code): npx skills add reladraw/reladraw -g -a claude-code

Note: Since this captures a snapshot of the skill, you must re-run the command to update to the latest release.


Technical Specifications & Project Status

  • Core: Written in TypeScript.
  • Dependencies: Zero runtime dependencies.
  • Output: Generates standard SVG files.
  • License: Apache-2.0.

[!WARNING] The language is stable not stable yet. Expect the syntax to change frequently.

Contribution Guidelines:

  • If you find a diagram that cannot be represented in Reladraw, please share it.
  • While the project is evolving, opening an issue is currently more helpful than submitting a pull request.
  • Legal Note: Use of the software grants no rights to the "reladraw" name, logo, or associated trademarks.