Improve large diagram scalability with viewport virtualization - #1122
Open
rat wants to merge 4 commits into
Open
Improve large diagram scalability with viewport virtualization#1122rat wants to merge 4 commits into
rat wants to merge 4 commits into
Conversation
|
@rat is attempting to deploy a commit to the dottle's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
Improve DrawDB's behavior with very large diagrams by virtualizing canvas and side-panel rendering, coalescing viewport updates, and moving JSON/DDB validation off the main thread when Web Workers are available.
The diagram contexts remain the single source of truth. Culling only controls which React/SVG components are mounted, so off-screen entities remain available to search, export, editing, undo/redo, and other whole-diagram operations.
Problem
The canvas previously mounted every table, note, area, and relationship at the same time. Several components also scanned the complete diagram or rebuilt relationship paths during viewport interaction. On large imports this creates substantial DOM, React, SVG, and V8 heap pressure and can eventually crash Chromium's renderer even when system RAM and swap are available, because the renderer/V8 heap has per-process limits.
The side-panel lists and issue detection also performed work proportional to the complete graph during normal interaction, while JSON/DDB parsing and validation ran synchronously on the main thread.
Changes
requestAnimationFrameand cancel superseded frames without touching persistence or history.ArrayBufferis transferred rather than cloned, progress and cancellation are exposed in the UI, and unsupported/failed Worker environments retain a main-thread fallback.performance.memoryis available. Diagram contents and entity names are never logged.Compatibility
Validation
npm run lintnpm test— 3 regression test files pass, covering spatial lookup, off-screen global search, relationship double-click behavior, pan/zoom invariants, complete export data, import counts/references, and scalable cycle detection.npm run buildLimitations
This substantially reduces mounted component count and main-thread work, but a web application cannot remove Chromium/V8's intrinsic per-renderer heap limits. Operations that necessarily consume the complete diagram, such as export and auto-arrange, still require whole-diagram data; they now remain independent from the virtualized render set.