Skip to content

Render HiGlass viewer inside Shadow DOM#208

Merged
nvictus merged 5 commits intomainfrom
push-rvuyomyqtsyt
Mar 1, 2026
Merged

Render HiGlass viewer inside Shadow DOM#208
nvictus merged 5 commits intomainfrom
push-rvuyomyqtsyt

Conversation

@manzt
Copy link
Member

@manzt manzt commented Feb 28, 2026

HiGlass v2.2.2 exports its CSS as hglib.CSS, which lets us encapsulate viewer styles using the Constructable Stylesheets API and a Shadow DOM. This prevents HiGlass styles from leaking into (or being affected by) the host notebook environment.

The wheel event handler now also calls preventDefault() in addition to stopPropagation(). With the shadow DOM boundary, stopPropagation() alone wasn't sufficient to prevent page scrolling in marimo since composed events cross the shadow boundary.

higlass-python in marimo:

@manzt manzt added the enhancement New feature or request label Feb 28, 2026
@manzt
Copy link
Member Author

manzt commented Feb 28, 2026

Type errors are coming from 500 on ESM.sh..

@nvictus nvictus force-pushed the push-rvuyomyqtsyt branch from 12341a9 to 21ec025 Compare March 1, 2026 02:24
manzt and others added 3 commits February 28, 2026 21:56
HiGlass v2.2.2 exports its CSS as `hglib.CSS`, which lets us encapsulate
viewer styles using the Constructable Stylesheets API and a Shadow DOM.
This prevents HiGlass styles from leaking into (or being affected by)
the host notebook environment.

The wheel event handler now also calls `preventDefault()` in addition to
`stopPropagation()`. With the shadow DOM boundary, `stopPropagation()`
alone wasn't sufficient to prevent page scrolling in marimo since
composed events cross the shadow boundary.
@nvictus nvictus force-pushed the push-rvuyomyqtsyt branch from 21ec025 to 6172686 Compare March 1, 2026 02:56
@nvictus nvictus merged commit 815e4aa into main Mar 1, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants