Join the discussion

Write your take first — we'll ask for email only when you're ready to publish.

  • Hacker News
  • That's an interesting idea, and an unexplored design space. Graphviz's dot has rank and head/tail ports, and Plantuml's class diagram has some support for relative position, but both are more hints for the layout engine, not deterministic declarations. If I had a nickel for every hour I spent fiddling with a Plantuml diagram to get the relation directions to force the layout into at least an approximation of what I wanted, I'll be a lot closer to retirement.

    I like that you're going for one generic syntax instead of many specific ones, like mermaid and Plantuml, but it's as much as a pro as it is a con, it's one reason why these languages evolved in the first place, instead of everyone just using DOT. One possible mitigation would be some sort of reuse mechanism? Some way that generic nodes could be defined once and instantiated many times, so if I wanted to draw something like a sequence diagram, I could define/change my participant lanes just once.

    Another issue the "No multi-line statements, no line continuations, no blocks." philosophy. I get *why* you chose it, and has its advantages, but it's a pretty annoying constraint, specially if one wants to have longer node names, or have more detailed description of the node in its label, like listing the responsibilities of a class, for instance. "No blocks" is something that can probably won't make much difference, but line continuations (i.e., some distinction between physical and logical lines) can make or break the user experience, IMHO

    The syntax for line breaks is another thing I urge you to reconsider, '/' is waaay to common of a character, and being forced to write long strings in a single line can get *really* annoying. Some sort of multiline string support would really make your existing syntax shine.

    The last two suggestions/complaints would complicate your parser a lot, specially since you're writing it manually, so, they are trade offs, but as a user who'd love to have something like this on my toolbelt, not having these features would make me hesitate a lot on investing time in this tool.

    That said, it's a nice idea, I'll keep an eye on it =)

  • The README looks LLM generated. Sorry, but that's where my interaction stops
  • Mermaid works great for fixed layouts like sequence diagrams and Gantts. For flowcharts, where position is king, it's bad.

    I've tried using svg in my MD files but they get unwieldy quite fast. This is a great idea. My first reaction was - but what's if I need something more exact. But reflecting on it, I've realized that this relative positioning is probably enough.

  • Seems a little buggy, I added this line:

    edge parser -> renderer "test edge" from: left to: right

    and it wasn't smart enough to make a curved arrow

  • Love it! I created a VSCode extension to render it in markdown files and highlight its syntax: https://github.com/volkanunsal/relative-diagrams-vscode/
  • The best looking diagram library where you can explicitly place elements IMO is schemdraw (python). Ironically it is a library for drawing electronic circuit diagrams with some flowchart functionality on the side.

    Examples: https://schemdraw.readthedocs.io/en/stable/gallery/flowchart...

    Usage: https://schemdraw.readthedocs.io/en/stable/elements/flow.htm...

  • The readme says:

    > Mermaid, Graphviz and D2 let you declare boxes and connections, then determine positions for you. If you have a particular picture in mind, these aren't the right tool.

    D2's layout engine TALA [1] actually allows you to provide a lot of manual control. TALA used to be commercial, but is now open source.

    In my own testing, TALA tends to produce much better layouts than Mermaid, including the ELK layout algorithm (which is not Mermaid's default; D2 also supports ELK).

    TALA supports controlling direction per container, defining which shapes have to be near each other, and so on. I've not played with this yet, though.

    [1] https://d2lang.com/tour/tala/

  • This is very needed in the AI coding age! I find diagramming is one of the best ways for high bandwidth alignment between my mental model and the agent’s. I have been working on this problem a bit as I see good visuals as a key bottleneck in faster development while maintaining a real architecture.

    Will def be adding this to my list of diagramming tools the agent can use!

Explore Birbla archives