Top
Best
New

Posted by jpwalsh234 5 hours ago

Show HN: Reladraw – A diagram language where you decide where to place things(github.com)
I love making diagrams to help understand, plan, etc. However, the options are (A) auto-placement languages like Mermaid or Graphviz (which don't let me decide how the diagram looks), or (B) software like Draw.io which are powerful but are very time consuming (and inefficient for agents to manipulate).

I wanted to have the benefits of both, where you can define a diagram in a diagram language, but also retain a high degree of control over what the diagram looks like.

I also wanted this to work well for humans and agents.

On the Github link, there's a playground where you can try it out without installation. There's also instructions for a simple npm install and for installing a skill you can use with Claude or other agents.

106 points | 29 commentspage 2
light_hue_1 1 hour ago|
I wish this just implement tikz without latex. I've yet to see a better drawing library that is both simple and has the depth to build the most complicated things.
jpwalsh234 54 minutes ago|
tikz looks super powerful. Reladraw is opting for a narrower job - making diagrams with boxes, groups, arrows, where you can say relative positions and let Reladraw save you extra work.
monster_truck 3 hours ago||
This genuinely fucks. Thank you

Fighting with mermaid is so frustraiting, especially when it comes to normal vs github formatting. This is going to replace several ad-hoc half impls I have laying around

jpwalsh234 3 hours ago|
Glad to hear it :) If you find that you want Reladraw to do something that it can't, let me know! I keep uncovering features by looking at actual Draw.io diagrams I've made and seeing if Reladraw can do it.
Jailbird 59 minutes ago|||
(since you ask...) Edges drawn with right angles would be a nice option.
jpwalsh234 46 minutes ago||
Great idea! Adding to the todo list.
monster_truck 21 minutes ago|||
o7 will do, and if I cook anything up I think you might appreciate I'll try and yeet over a nice PR
lastscattering 3 hours ago|
This is basically tikz's positioning library (right=of, below left=of) without having to touch LaTeX. With tikz it was never the nodes that hurt me, it was the edges. Once two edges want the same side of a box it gets ugly fast. Does the resolver do any routing, or is from:/to: all you get? And what happens with conflicting statements, does the first one win or do you get an error?
jpwalsh234 2 hours ago|
Appreciate the comment and questions!

Does the resolver do any routing? It doesn't auto-route around obstacles. But, if nodes A, B, and C all have edges going to the left side of D, they share that side and space themselves apart so they don't cross. If the side is too short, they'll bow out to make space for each other, so you don't have to manually fiddle. You can also give routing instructions like "these edges pass between these two nodes on their way to D".

Conflicting statements? Statements that can all hold will all apply. Right of one node and below another is okay. Or, "right of A and B and C" will clear whichever sticks out furthest. If they all can't hold, you'll get an error naming the clashing statements (e.g., something both left and right of A). Nothing silently wins.

drfloyd51 2 hours ago||
>nothing silently wins.

Fantastic! Never change this.

People will complain. These people also prefer type unsafe languages. Hold fast.

jpwalsh234 2 hours ago||
Thanks! My concern was that a resolver making decisions "to be helpful" could become surprising or frustrating.

For example, if you ask for edges to pass "between C and D", but those two nodes sit diagonally, the gap you are asking for might be the vertical channel or horizontal channel between them. So instead of guessing for you, it will tell you of the ambiguity and let you spell out what you want.