graph-ui: node budget (up to 10M), scale rendering, and contrast controls#942
Merged
Conversation
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>
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.
Makes the 3D graph view usable on large repositories and adds visual controls.
Node budget
max_nodesabove 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_NODESstill adjusts the ceiling for constrained deployments).Rendering at scale
Contrast / "galaxy" look
Testing
tsc -bclean; 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.