{"record":{"id":"373b7e53028f5c0f","repo":"Graphify-Labs/graphify","slug":"graph-has-g-number-of-nodes-nodes-too-large","errorCode":null,"errorMessage":"Graph has {G.number_of_nodes()} nodes - too large for HTML viz (limit: {limit}). Use --no-viz, raise GRAPHIFY_VIZ_NODE_LIMIT, or reduce input size.","messagePattern":"Graph has (.+?) nodes - too large for HTML viz \\(limit: (.+?)\\)\\. Use --no-viz, raise GRAPHIFY_VIZ_NODE_LIMIT, or reduce input size\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"graphify/exporters/html.py","lineNumber":468,"sourceCode":"                        s = str(c)\n                        if s in seen:\n                            continue\n                        seen.add(s)\n                        comm_ids.append(s)\n                    if len(comm_ids) < 2:\n                        continue\n                    remapped.append({\n                        \"id\": he.get(\"id\", \"\"),\n                        \"label\": he.get(\"label\") or he.get(\"relation\", \"\").replace(\"_\", \" \"),\n                        \"nodes\": comm_ids,\n                    })\n                meta.graph[\"hyperedges\"] = remapped\n            to_html(meta, meta_communities, output_path,\n                    community_labels=community_labels, member_counts=mc)\n            print(f\"graph.html written (aggregated: {meta.number_of_nodes()} community nodes, {meta.number_of_edges()} cross-community edges)\")\n            print(\"Tip: run with --obsidian for full node-level detail.\")\n            return\n        raise ValueError(\n            f\"Graph has {G.number_of_nodes()} nodes - too large for HTML viz \"\n            f\"(limit: {limit}). Use --no-viz, raise GRAPHIFY_VIZ_NODE_LIMIT, \"\n            f\"or reduce input size.\"\n        )\n\n    node_community = _node_community_map(communities)\n    degree = dict(G.degree())\n    max_deg = max(degree.values(), default=1) or 1\n    max_mc = (max(member_counts.values(), default=1) or 1) if member_counts else 1\n\n    # Work-memory overlay (derived sidecar). When not passed explicitly, load it\n    # best-effort from the sibling .graphify_learning.json next to the output\n    # graph.html (which lives beside graph.json). Empty/missing => no learning\n    # fields, so the un-annotated render is byte-identical to pre-feature.\n    if learning_overlay is None:\n        learning_overlay = {}\n        try:\n            from graphify.reflect import load_learning_overlay as _llo","sourceCodeStart":450,"sourceCodeEnd":486,"githubUrl":"https://github.com/Graphify-Labs/graphify/blob/7fe58b0b0f3873be9a21c30106b8b8527c353aa6/graphify/exporters/html.py#L450-L486","documentation":"Raised by the HTML exporter when the graph exceeds the visualization node limit (env var GRAPHIFY_VIZ_NODE_LIMIT). Rendering hundreds of thousands of DOM nodes freezes browsers, so graphify hard-caps the interactive view. Note the aggregation path above it: if a smaller aggregated community view was possible it returns early; this error means even that escape hatch wasn't taken (e.g. --no-viz off, aggregation disabled or also too large), so it raises instead of silently producing a broken page.","triggerScenarios":"Calling the HTML export entry point on a graph where G.number_of_nodes() > limit (from GRAPHIFY_VIZ_NODE_LIMIT) and the community-aggregated path was not selected (aggregation only triggers above its own threshold/flag, or communities are absent so remapping is skipped).","commonSituations":"Running graphify on a large monorepo or a merged global graph; lowering the default limit in CI to speed builds; forgetting --no-viz in a cron job over a big codebase.","solutions":["Re-run with --no-viz to skip HTML generation entirely","Raise the cap for this run: GRAPHIFY_VIZ_NODE_LIMIT=200000 graphify ... (size it to your machine — the browser, not graphify, is the bottleneck)","Use the aggregated community view (the exporter prints 'aggregated: N community nodes') or --obsidian for node-level detail without the interactive viz","Reduce input size: index a subdirectory or exclude vendored/generated code"],"exampleFix":"# before\nGRAPHIFY_VIZ_NODE_LIMIT=5000 graphify build .   # ValueError: Graph has 12000 nodes - too large\n\n# after\ngraphify build . --no-viz\n# or\nGRAPHIFY_VIZ_NODE_LIMIT=20000 graphify build .","handlingStrategy":"validation","validationCode":"import os\nfrom graphify.exporters.html import _viz_node_limit  # or read env directly\n\nlimit = int(os.environ.get(\"GRAPHIFY_VIZ_NODE_LIMIT\", \"100000\"))\nif G.number_of_nodes() > limit:\n    print(f\"{G.number_of_nodes()} nodes > limit {limit}; skipping HTML viz\")\nelse:\n    export_html(G, communities, \"graph.html\")","typeGuard":null,"tryCatchPattern":"try:\n    export_html(G, communities, \"graph.html\")\nexcept ValueError as e:\n    if \"too large for HTML viz\" in str(e):\n        # fall back to a lighter-weight export\n        export_dot(G, \"graph.dot\")\n    else:\n        raise","preventionTips":["Use --no-viz in automation over large repos so builds never depend on the cap","Set GRAPHIFY_VIZ_NODE_LIMIT explicitly (per machine) rather than relying on the default","Check G.number_of_nodes() before calling HTML export in your own pipeline code"],"tags":["visualization","html","limits","configuration","large-graphs"],"backgroundTag":null,"analyzedSha":"7fe58b0b0f3873be9a21c30106b8b8527c353aa6","analyzedAt":"2026-08-14T19:23:21.323Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}