AI NewsDev toolsAnnouncement

Open-diagram is a Python toolkit for architecture diagrams that check their own layout

Open-diagram is a Python toolkit where you describe panels and lines in a short script. The library refuses to save the file when blocks overlap.

AI News

Editorial2 min read

LinkedInX
GitHub repository card for lukendeasy/open-diagram showing the project name and description.

Image: GitHub

Why it mattersA coding agent drawing an architecture diagram is one place the output looks right and is wrong. A library that fails the build on an overlap moves the check into the tools.

A new Python library stops a diagram from being saved when two blocks overlap. It also stops a save when a line crosses through a label. The library is called open-diagram. The author is Luke Deasy. Scott Williams is listed as a founding contributor. The repository is at github.com/lukendeasy/open-diagram. It was created on 18 November and has 429 stars. The licence is MIT.

The README states the purpose in one line. You describe panels, tiles and lines in a short Python script. Open-diagram measures every label from the font. It places the blocks. It checks the result. The output is an SVG or a PNG file. Every label is drawn as SVG shapes. They are not font characters. So the picture looks the same in a browser, in PowerPoint and in Figma. The reader does not need the font installed.

What the layout check does

The library raises LayoutError when a diagram would be wrong to publish. The error message names the exact problem. Two examples from the README. One: 'Storage' and 'Recommendations' are only 9 px apart (minimum 16). Two: line 'Where videos come from' -> 'Storage' crosses 'Processing'. The message names the next step. For a collision, move a block. For a crossing line, route it with via_x or via_y. Or accept the crossing with cross_ok=True.

The agent angle

Open-diagram comes with a Model Context Protocol server. It also comes with a block of agent instructions to paste into the project's AGENTS.md file. A coding agent such as Claude Code or Cursor can run the server. It can then draw a diagram as part of its work. One common failure with an agent and a drawing tool is simple. The picture looks correct in the agent's head. It is wrong on the page. A build-time check closes that gap. The agent cannot save a file that fails LayoutError. So the first attempt that reaches a reviewer has passed the layout rules.

What it supports

The README lists twelve example diagrams. The named types are systems maps, release pipelines, layered stacks, data models, business processes and concept maps. The library also imports from Mermaid and from JSON. An existing diagram in either of those can be moved across without a rewrite. The three primitives are Panel, Tile and the connecting line.

Traction and limits

429 stars and 35 forks in ten days is steady for a developer-facing library with a narrow job. One person wrote most of it. A buyer should treat this as a focused tool from one maintainer. The pace of fixes is the pace one person can keep. The scope is deliberately small. A team that wants interactive diagrams, free-form drawing or real-time collaboration should look elsewhere.

A coding agent draws the diagram. A library refuses to save a broken one. The two work better together than alone. The diagram arrives with the rules already enforced. The review is then about whether the picture explains the system.

Source

lukendeasy/open-diagram on GitHub.

SourceGitHub

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project