Investigate and document deck.gl/viv scatterplot popout event handling breakage#398
Draft
xinaesthete with Copilot wants to merge 1 commit into
Draft
Investigate and document deck.gl/viv scatterplot popout event handling breakage#398xinaesthete with Copilot wants to merge 1 commit into
xinaesthete with Copilot wants to merge 1 commit into
Conversation
✅ Deploy Preview for mdv-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Copilot
AI
changed the title
[WIP] Fix deck and viv scatterplots in pop-out
Investigate and document deck.gl/viv scatterplot popout event handling breakage
Apr 2, 2026
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.
Deck.gl and Viv scatterplots break when popped out:
DeckScatterComponentloses scroll-zoom (panning still works, axes update but canvas framebuffer shows stale content);VivScatterComponentrenders correctly on first pop but then stops responding to interaction and settings changes.Investigation findings
Deep-dive into deck.gl 9.1.11, mjolnir.js 3.0.0, and
deckMonkeypatch.tssource to understand the event registration lifecycle across document moves:rebindMouseEventsis structurally sound —viewManager._rebuildViewports()exists as a private method in 9.1.11 and is callable at runtime;Object.seal()inViewManager's constructor allows mutating existing properties (_eventManager,controllers); the call chain through_createController→controller.setProps()→toggleEvents(['wheel'], true)→WheelInput.enableEventTypeis correctPointerEventInputregisterspointermove/pointerup/pointercancelviagetWindowForElement(element)which useselement.ownerDocument.defaultView, correctly resolving to the popup window after DOM moveWheelInputis element-level — registered directly viaelement.addEventListener('wheel', ...), so it survives document movesUnresolved
The exact timing/lifecycle bug was not isolated before the session ended. Most likely candidates:
useEffect([outerContainer])firing and deck.gl's async WebGL init (deck.gl createseventManagerinside_setDevice, which is called fromanimationLoop.onInitialize— asynchronously afterDeckconstruction;deck.eventManagermay benullat first-effect time, causing early return, but this should be benign)_rebuildViewports()call triggered by a React re-render after the monkeypatch replaces controllers before wheel event subscriptions are established@deck.gl/reactDeckGL component exposes.deckvia ref and whetherdeck.eventManageris set at the timerebindMouseEventsis called on popoutThe relevant code is
src/lib/deckMonkeypatch.ts(rebindMouseEvents),src/react/components/DeckScatterComponent.tsx(theuseEffect([outerContainer])), andsrc/react/components/avivatorish/MDVivViewer.tsx(componentDidUpdate).Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
cdn.jsdelivr.net/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)pkg.pr.new/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/_temp/ghcca-node/node/bin/npm install ./src/table/css/slickgrid.css ./src/charts/css/charts.css(dns block)unpkg.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either: