Skip to content

Compact organic force layout + Mermaid diagram fix#5

Merged
NeoVand merged 2 commits into
mainfrom
force-layout-default
Jun 19, 2026
Merged

Compact organic force layout + Mermaid diagram fix#5
NeoVand merged 2 commits into
mainfrom
force-layout-default

Conversation

@NeoVand

@NeoVand NeoVand commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Consolidates the two outstanding changes into one PR (supersedes #4).

1. Force layout — compact, organic, clearly-fanned branches

The old force layout pulled every node of a category toward one anchor angle, so
categories collapsed into a spoke — the Web/API tangle and the Utilities/Security
vertical line. Reworked createSimulation to anchor each node to its
hierarchical slice: every subcategory gets its own weighted angular wedge and
protocols fan under it. Nodes seed near their anchor (not all at 0,0), and local
charge (capped distanceMax) plus short, firm links keep the graph about as
dense as the radial layout (~510px max radius) while staying organic.

Net effect: same readable density as before, but each branch is now clearly
separated. Verified in-browser — initial bloom, force↔radial↔mesh↔timeline
round-trips, and detail panels all clean.

2. Mermaid diagram fix (was #4)

stripRichTextMarkup mangled Mermaid's {{…}}/[[…]] node-shape syntax (the
Transport story's T3{{"Middlebox"}}), breaking that diagram. Now only
slug-shaped ids resolve; Mermaid syntax passes through untouched — which also
restores labels that were silently dropped before.

All gates green: lint, svelte-check (0/0), 44 unit tests, 17 e2e.

🤖 Generated with Claude Code

NeoVand and others added 2 commits June 19, 2026 10:15
Mermaid reuses {{…}} (hexagon) and [[…]] (subroutine) for node shapes — e.g. the
Transport story's `T3{{"Middlebox"}}`. stripRichTextMarkup (which also cleans
Mermaid node labels) was turning that into invalid Mermaid, so the diagram
failed to render. Now only slug-shaped ids are resolved; non-slug {{…}}/[[…]]
(Mermaid syntax) pass through untouched — which also restores labels that were
previously dropped. Regression tests added.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Rework createSimulation to anchor each node to its hierarchical slice — every
subcategory gets its own weighted angular wedge and protocols fan under it — so
categories no longer collapse into a single spoke (the Web/API tangle and the
Utilities vertical line). Nodes seed near their anchor; local charge (capped
distanceMax) + short, firm links keep the graph about as dense as the radial
layout while staying organic. Settles at ~510px max radius vs the old tangle.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@NeoVand NeoVand merged commit 3e853b2 into main Jun 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant