SOF-8027: add the Entity Map at schemas.mat3ra.com/map - #417
Open
timurbazhirov wants to merge 1 commit into
Open
SOF-8027: add the Entity Map at schemas.mat3ra.com/map#417timurbazhirov wants to merge 1 commit into
timurbazhirov wants to merge 1 commit into
Conversation
An interactive map of the whole schema corpus: pan, zoom, search, fly to an entity, inspect its relationships, share the view as a URL. - src/html/map/: vanilla JS over Cytoscape.js (CDN, pinned + subresource integrity), matching the explorer's palette and conventions. - src/js/scripts/entityGraphLayout.ts: bakes coordinates into graph.json at build time. The layout is deliberately not a force simulation. Force layout arranges schemas by reference density, which reproduces the directory tree and teaches a reader nothing. This places them by architectural layer instead: primitives at the centre, root entities ringed around them, category and directory catalogues on the rim, so reading outward is reading the build-up. Being a pure function of the graph it is also deterministic, so a schema keeps its place between releases and the map is worth building spatial memory of. It needs no layout extensions at all — Cytoscape renders preset positions. Encoding: colour groups the 22 source directories into eight families, shape marks the layer, size grows with in-degree so hubs read as hubs, and edge style distinguishes extends from contains from variant. Semantic zoom shows landmarks, then hubs, then every label; font size varies per tier because Cytoscape scales text with zoom, and a fixed size vanishes once the whole map fits on screen. Verified in a browser: render, search and fly-to, detail panel links, relationship navigation, deep links in a fresh tab, focus mode, zoom tiers and edge toggles, with no console errors. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014ANArWM4ehvsXKNzQpQgx1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket: SOF-8027 · Epic: SOF-8025
Plan:
plan/review/2026-08-16-entity-map.mdChained onto #416 — review that first; this PR's diff is against
feature/SOF-8026.An interactive map of the whole schema corpus at
schemas.mat3ra.com/map/. Pan, zoom, search, fly to an entity, inspect its relationships, share the view as a URL. Both the MVP and polish scope land here.The layout is the argument
The plan called for
fcose. I did not use it, and the reason is the point of the feature.A force layout arranges schemas by how densely they reference one another — which reproduces the directory tree. That is precisely what review decision 10 rejected: a map that is a prettier
ls -Rteaches nothing.So placement is computed instead (
src/js/scripts/entityGraphLayout.ts), by architectural layer:Reading outward from the middle is reading the build-up the concept docs describe. Measured mean radius per layer, confirming the bands:
Three consequences, all good:
graph.jsonat build time; Cytoscape renderspresetpositions and lays nothing out. No spinner, no jank.fcose,cose-baseorlayout-base— Cytoscape alone, pinned with a subresource-integrity hash.Encoding
definitions/unitsandcore/primitive/scalarread as the hubs they areisResult/isMonitor/ default units, from the properties manifestSemantic zoom shows landmarks, then hubs, then everything. Font size varies per tier: Cytoscape scales text with zoom, so a fixed size vanishes entirely once the whole map fits on screen — the landmarks tier would have been unreachable.
Also here
Search with fly-to · detail panel with clickable extends / contains / variants / used-by and links to the explorer, resolved JSON, example and GitHub source ·
#/entity/<id>and#/view/x,y,zpermalinks · focus mode (double-click, 2 hops) · edge-kind toggles · family filters from the legend · minimap · keyboard access (/search, arrows, Escape) ·prefers-reduced-motion· pinch-pan on touch.Testing
Driven in a real browser with Playwright — not just built and assumed:
Two bugs this caught that review would not have: the whole graph rendering collapsed at the origin (stale
graph.jsonwithout coordinates), and no labels at all appearing at whole-map zoom (min-zoomed-font-sizesuppressing the landmarks tier).Notes for the reviewer
window.esseEntityMapis exposed deliberately, as a console handle on a page whose purpose is poking at the schema graph.graph.jsonat the site root, which SOF-8026: extract schema reference graph (graph.json) and lint the corpus #416 publishes.🤖 Generated with Claude Code
Generated by Claude Code