Skip to content

The schema diagram draws the biggest classes, and reads lighter - #511

Merged
WaylandYang merged 5 commits into
devfrom
feat/the-schema-diagram-reads-better
Sep 9, 2026
Merged

WaylandYang merged 5 commits into
devfrom
feat/the-schema-diagram-reads-better

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

Stacked on #499. Salvaged from #508, which is closed — the level switch it was built for is not happening, but everything below was a defect in the schema diagram on its own terms.

It drew every class that has an instance. In a base with schema.org installed that is 142 classes, and most of them have exactly one instance — Person at 172 was drawn no larger and no more prominently than an ImageObject at 1, and the picture was a hairball rather than the shape of the base. It now draws the biggest classes by usage, plus their ancestors so inheritance chains stay whole, on the same four-step ladder the instance graph uses (SCHEMA_BUDGETS, default 30). The stepper sits in the legend row beside the +N classes pill, which already reports exactly what the ladder is holding back; searching a class still reveals it regardless of the budget.

Here that is 142 nodes and 460 edges down to 44 and 158.

The edge floor flattened the diagram's own distinction. MIN_EDGE_THICKNESS was 3 while inheritance edges are sized 0.9 and relation edges 2 — the floor drew both at 3, so "inheritance thin and bright, relations thick and grey" did not exist on screen. It is 2 now, which matches the relation edge's own size and still leaves something a mouse can hit, which is why the floor is there.

The legend read as uneven line weights. Its swatches used the focus colours: inheritance at 95% white next to relations at 60% white. Two lines differing only in brightness read as thick and thin, not as two kinds of edge. Four opaque colours at one weight now, taken from each edge's resting colour.

One row, two radii. The explanatory chips were rounded-cell spans and the interactive one a rounded-control pill, at identical height, padding and size. They all use the pill now, with is-static suppressing the hover lift on the ones that do not respond — the rule that says 4 for chips and 6 for controls is about telling boxes apart, and these boxes were not different.

The forces differed for no recorded reason. gravity 0.55 and scalingRatio 28 against the instance graph's 0.35 and 22, a circular seed of 260 against 300, and a hard stop at 200 iterations against 60 plus a settling worker. Same engine, one graph open and the other balled up. The forces and the seed now match; iterations go to 600, which at this size is a few tens of milliseconds and reaches the same place the worker would.

Measured on a copy of the benchmark base, mean nearest-neighbour distance over the layout's own span: the diagram went from 4.15% to 7.54%, against the instance graph's 4.85%. Raising scalingRatio was tried first and does nothing — it scales the layout uniformly and the camera fits to it, so the ratio is unchanged. Recorded here because it is the obvious lever and it is the wrong one.

Also: __sg / __ssigma dev handles, matching /graph's, which is how the numbers above were taken.

pnpm build clean; looked at in the browser against 916 classes.

WaylandYang and others added 5 commits September 9, 2026 10:39
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
(cherry picked from commit fe5ac50119a38553a947557e87aec8eb045a9ebc)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
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