Ask HN: How to do manual graph layout diagrams in code?

2 points by Multicomp ↗ HN
I am aware of [1] and have somewhat used it with somewhat painful ergonomics, and I just learned about [2] today.

Can anyone direct me to an as-code tool that you input something like the following, and it spits out a graph diagram of nodes and edges? Mermaidjs, plantuml, graphviz always re-layout everything whenever the contents of the graph change, and I want to have manual or semi-manual control of the layout.

I'm trying to track generally geographic locations (dungeon rooms, location node graphs) or relationships (Marvin likes Doug but hates Mr. Spiff. Mr. Spiff is suspicious of Doug yet worries about Marvin. etc. )

A[Village square]

B[Farmers cabin] east of A

C[Haunted windmill] southwest of B

D[Wolf Pub] west of B

B<-"N/S game trail path"->D

[1] https://fossil-scm.org/pikchr/doc/trunk/homepage.md

[2] https://stackoverflow.com/a/26571628

2 comments

[ 2.9 ms ] story [ 16.1 ms ] thread
Old MUDs come to mind, and seems like a modern take on their automappers would be something like Mudlet's https://wiki.mudlet.org/w/Manual:Mapper, which has a verbose but human readable XML format?

https://wiki.mudlet.org/w/Manual:Mapper https://forums.mudlet.org/viewtopic.php?t=22957

Not quite as terse as your Mermaid-like syntax, unfortunately.

Also, in Mermaid, can't you specify left/right top/bottom, etc.? https://mermaid.js.org/syntax/flowchart.html#direction-in-su...

Thanks! Yeah a tool like that is similar to what I'm after. As far as mermaid goes, it lets you specify the direction of how the node layout is created, but does not allow you to specify one node will always be a cardinal direction relative to another node.