Skip to content

Lineage sharing graph: "Maximum text size in diagram exceeded" — diagram never renders for real projects #289

Description

@yustme

Bug

Opening the Lineage → Sharing graph tab shows a pink error box instead of the diagram:

Maximum text size in diagram exceeded

The table of edges below it loads fine (597 edges, 124 shared buckets, 240 linked buckets), but the visual Mermaid graph is completely broken — there is no way to see the lineage visually.

Root cause

web/frontend/src/pages/Lineage.tsx calls mermaid.initialize() twice (light and dark theme) but never sets maxTextSize:

mermaid.initialize({
  startOnLoad: false,
  theme: "dark",
  themeVariables: { ... },
  // maxTextSize not set → defaults to ~50 000 chars
});

Mermaid's default maxTextSize is around 50 000 characters. With 597 edges, the generated diagram definition far exceeds that limit and Mermaid renders the error node instead of the graph.

Immediate fix

Add maxTextSize to both mermaid.initialize() calls:

mermaid.initialize({
  startOnLoad: false,
  maxTextSize: 2_000_000,   // ← add this
  theme: "dark",
  themeVariables: { ... },
});

Longer-term UX concern

Even with maxTextSize raised, rendering 597 nodes as a single Mermaid flowchart will produce an unreadable hairball and likely freeze the browser. A better approach for large graphs:

  • Pagination / filtering — show only edges involving a selected project or bucket; let the user drill in
  • Cluster/collapse — group nodes by project, expand on click
  • Alternative renderer — for graphs this size, Cytoscape.js or a canvas-based renderer handles pan/zoom and large node counts much better than Mermaid SVG
  • "Top N" default view — render the 50 most-connected nodes by default with a "show all" warning

The immediate maxTextSize fix unblocks the feature for smaller projects; the UX improvements are needed to make it usable at scale.

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