Skip to content

HTML viz hard-refuses at >5000 nodes without WebGL fallback or aggregated view #447

Closed

Description

@harnill

Context

On an 8333-node graph, the skill pipeline prints:

Graph has 8333 nodes - too large for HTML viz. Use Obsidian vault instead.

and skips graph.html generation entirely. No fallback is offered beyond Obsidian (which requires a separate app) or the markdown wiki.

Why this matters

The wiki is useful but is agent-oriented; for human exploration the interactive HTML graph is the primary artefact. Hitting the 5K ceiling on a mid-sized codebase (≤500 files) means visualisation is unavailable in exactly the situation where a knowledge graph is most valuable.

Root cause

The ceiling appears to be hard-coded against vis.js DOM performance:

if G.number_of_nodes() > 5000:
    print(f'Graph has {G.number_of_nodes()} nodes - too large for HTML viz.')

vis.js degrades past ~3–5K DOM nodes. But this is a renderer choice, not an inherent graph limit.

Proposed fixes

Ranked by effort:

  1. Aggregated view (cheapest): when above ceiling, emit an HTML that collapses each community to a meta-node, edges weighted by inter-community edge count. Click to expand into member nodes. Keeps vis.js.
  2. WebGL renderer option: sigma.js or Cosmograph handle 50K+ nodes at 60fps. Ship as --renderer webgl flag.
  3. Explicit override: --force-html for users who accept slow render.

Even #1 alone (aggregated view as default above ceiling) would eliminate the "no viz" outcome for mid-sized graphs.

Repro

  • 410 files → 8333 nodes → HTML refused.
  • 5K ceiling is approximately 250-300 mid-complexity Python files.

Activity

  1. Harsh-Codes-77 commented on Apr 21, 2026

    @Harsh-Codes-77

    I'd like to work on this

  2. safishamsi commented on Apr 22, 2026

    @safishamsi
    Member

    Fixed in v0.4.31: graphs with >5000 nodes now render an aggregated community meta-graph (one node per community, edge weights = cross-community edge count) instead of hard-refusing. This keeps the HTML visualization useful at any scale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions