Skip to content

graph-ui: node budget (up to 10M), scale rendering, and contrast controls#942

Merged
DeusData merged 3 commits into
mainfrom
feat/ui-node-budget
Jul 7, 2026
Merged

graph-ui: node budget (up to 10M), scale rendering, and contrast controls#942
DeusData merged 3 commits into
mainfrom
feat/ui-node-budget

Conversation

@DeusData

@DeusData DeusData commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Makes the 3D graph view usable on large repositories and adds visual controls.

Node budget

  • The layout endpoint previously treated the default render cap (2000) as a hard ceiling — an explicit max_nodes above it was silently clamped back down, so the UI could never show more than 2000 nodes. The default is now a default: an explicit request is honored up to a hard ceiling of 10M nodes (CBM_UI_MAX_RENDER_NODES still adjusts the ceiling for constrained deployments).
  • A type-in node budget control (5,000 steps, default 5,000, persisted per project) sits next to Refresh. Edges follow automatically — the layout returns every edge between the loaded nodes.
  • Layout refinement scales its iteration count down past 100k/500k bodies to keep very large budgets responsive.

Rendering at scale

  • Instance matrices are rebuilt only when the node set or highlight changes (they were rebuilt every frame for a static layout).
  • Sphere tessellation steps down as counts grow; past 75k nodes the cloud switches to point sprites.
  • A streaming loading animation shows live download progress instead of a bare spinner.

Contrast / "galaxy" look

  • Density-aware compensation keeps contrast roughly constant as the graph grows: edges dim by ~1/√(edgeCount) (they cause the white-out), while nodes and bloom stay full up to ~25k nodes and only ease gently past that.
  • Per-node glow is colour-aware by channel dominance: blue high-degree hubs glow brightest, red leaves modestly, white/yellow least.
  • A Display menu (edge brightness / node glow / bloom, persisted) lets the look be tuned live.

Testing

tsc -b clean; 33 vitest tests green (node-budget clamping, streaming progress, density scales, glow ordering). New backend reproduce-first test (layout_honors_budget_above_default) proves the ceiling fix. Verified in-browser on the full CBM graph (15,357 nodes / 83,838 edges).

Addresses the large-graph freeze/clamp behavior reported in #498 and #726.

DeusData added 3 commits July 7, 2026 23:09
The layout endpoint treated the default render cap (2000) as a ceiling:
an explicit max_nodes above it was silently clamped back down, so the UI
could never show more than 2000 nodes regardless of the request. Make the
default a default — an explicit request is now honored up to a hard
ceiling of 10M nodes; CBM_UI_MAX_RENDER_NODES still adjusts the ceiling
for constrained deployments. The default budget rises to 5000, and the
layout refinement pass scales its iteration count down past 100k/500k
bodies to keep very large budgets responsive. Edges need no changes: the
layout already returns every edge between loaded nodes.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Add a node-budget control next to Refresh: type any count (snapped to
5,000 steps, 5,000 default, 10M max) and the graph reloads with that many
nodes plus every edge between them. The choice persists per project.

Loading gets real feedback: the layout response streams with a live
MB counter under an animated constellation (static under
prefers-reduced-motion), replacing the bare spinner.

Rendering scales with the budget: instance matrices are rebuilt only when
the node set or highlight changes instead of every frame, sphere
tessellation steps down as counts grow, and past 75k nodes the cloud
switches to soft point sprites — one position per node — so six-figure
budgets stay interactive. The truncation notice now names the loaded edge
count and points at the budget control.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
High-density graphs washed out to a cyan-white blob: edges blend additively
and the per-node boost rewarded luminance, so ~80k overlapping edges plus the
white/yellow mid-tier stars saturated the center.

Compensate by density so contrast stays roughly constant as the graph grows:
- edges dim by ~1/sqrt(edgeCount) (they cause the blob) while nodes and bloom
  stay at full strength up to 25k nodes and only ease gently past that, so the
  bright-star look is preserved on moderate graphs;
- the per-node glow is now colour-aware by channel dominance instead of
  luminance: blue hubs (high-degree) glow brightest, red leaves modestly,
  white/yellow least — matching the star-class meaning and giving the graph
  depth instead of a uniform white core.

Add a Display menu (edge brightness / node glow / bloom multipliers, 0–3×,
persisted) layered on top of the adaptive defaults, so the look is tunable
live. A selection is never density-scaled and stays bright against the
dimmed rest.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
@DeusData DeusData merged commit 6e118fc into main Jul 7, 2026
11 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