Skip to content

Investigate and document deck.gl/viv scatterplot popout event handling breakage#398

Draft
xinaesthete with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-deck-viv-scatterplots
Draft

Investigate and document deck.gl/viv scatterplot popout event handling breakage#398
xinaesthete with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-deck-viv-scatterplots

Conversation

Copilot AI commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Deck.gl and Viv scatterplots break when popped out: DeckScatterComponent loses scroll-zoom (panning still works, axes update but canvas framebuffer shows stale content); VivScatterComponent renders 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.ts source to understand the event registration lifecycle across document moves:

  • rebindMouseEvents is structurally soundviewManager._rebuildViewports() exists as a private method in 9.1.11 and is callable at runtime; Object.seal() in ViewManager's constructor allows mutating existing properties (_eventManager, controllers); the call chain through _createControllercontroller.setProps()toggleEvents(['wheel'], true)WheelInput.enableEventType is correct
  • Window-level pointer events are handled correctly — Hammer.js PointerEventInput registers pointermove/pointerup/pointercancel via getWindowForElement(element) which uses element.ownerDocument.defaultView, correctly resolving to the popup window after DOM move
  • WheelInput is element-level — registered directly via element.addEventListener('wheel', ...), so it survives document moves

Unresolved

The exact timing/lifecycle bug was not isolated before the session ended. Most likely candidates:

  • Race condition between the useEffect([outerContainer]) firing and deck.gl's async WebGL init (deck.gl creates eventManager inside _setDevice, which is called from animationLoop.onInitialize — asynchronously after Deck construction; deck.eventManager may be null at first-effect time, causing early return, but this should be benign)
  • A subsequent internal _rebuildViewports() call triggered by a React re-render after the monkeypatch replaces controllers before wheel event subscriptions are established
  • Something specific to how the @deck.gl/react DeckGL component exposes .deck via ref and whether deck.eventManager is set at the time rebindMouseEvents is called on popout

The relevant code is src/lib/deckMonkeypatch.ts (rebindMouseEvents), src/react/components/DeckScatterComponent.tsx (the useEffect([outerContainer])), and src/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
    • Triggering command: /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
    • Triggering command: /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
    • Triggering command: /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:

@netlify

netlify Bot commented Apr 2, 2026

Copy link
Copy Markdown

Deploy Preview for mdv-dev ready!

Name Link
🔨 Latest commit 5f716c5
🔍 Latest deploy log https://app.netlify.com/projects/mdv-dev/deploys/69ce46e535adad0008912968
😎 Deploy Preview https://deploy-preview-398--mdv-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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
Copilot AI requested a review from xinaesthete April 2, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deck and viv scatterplots broken in pop-out

3 participants