Description
Precomputed Graph Layout and Clusters prepares the company graph for fast visual browsing and grouped drill-down. A scheduled run creates stable two- and three-dimensional node coordinates, Dotabase super-node positions, cross-Dotabase flow totals, per-Dotabase cluster membership and flows, cluster-key availability statistics, and a cached company summary. Product reads can serve this materialized foundation instead of laying out or grouping the entire graph in the browser.
The computation uses a two-level model. Dotabases are positioned first as super-nodes, then their members are arranged around those centroids with community detection and bounded force layout. High-degree nodes receive the expensive force treatment while the long tail uses deterministic hash-derived placement. Cluster rollups support built-in dimensions plus eligible Select, Multi-Select, and Status properties from each Dotabase schema.
Selling Points
- Makes large graph views responsive by moving layout and aggregation off the request path.
- Produces stable coordinates that reduce visual jumping between unchanged refreshes.
- Enables cluster rosters and flows by content type, tags, folders, communities, or schema properties.
- Preserves useful super-node summaries even when row-grain layout exceeds the safe cap.
- Generation-stamps related tables so readers never mix old and new graph snapshots.
User Story
As a user opening a company-wide graph, I want the constellation to appear quickly and remain spatially familiar. I can drill into a Dotabase or property cluster without waiting for my browser to simulate millions of nodes or run live group-by queries.
Extension Surface
The rating is configurable because cluster axes derive from Dotabase schema properties and the browser-safe registry at packages/knowledge-graph/src/cluster-keys.ts. packages/knowledge-graph/src/metrics/precompute.ts accepts bounded options and consumes prior coordinates for warm starts. Custom schema properties expand available grouping choices, but layout algorithms and safety caps remain platform-controlled.
Capabilities & Limits
Capabilities include 2D and 3D coordinates, super-node and cross-database rollups, Louvain communities, property-derived clusters, cluster flows, degree denormalization, deterministic tail scatter, stale cleanup, and atomic generation swaps. Limits are explicit: only a bounded subset per group is force-laid, property cluster keys are capped and grammar-checked, and graphs above the row limit degrade to summary and super-node layers rather than claiming complete row coordinates.
Implementation Map
packages/knowledge-graph/src/metrics/precompute.tspackages/knowledge-graph/src/metrics/cluster-rollups.tspackages/knowledge-graph/src/metrics/property-cluster-keys.tspackages/knowledge-graph/src/cluster-keys.ts