Skip to content

facet_chart: opt-in linked zoom/pan/selection across panels (default stays independent) #92

Description

@Darksinian

Summary

Feature request: facet panels should support linked interactions — synchronized zoom/pan (and optionally box-selection) across panels — behind an explicit opt-in. The default should remain what it is today: every panel zooms, pans, and selects independently.

Current behavior

facet_chart(share_x=True, share_y=True) only aligns the panels' initial domains at build time (components.py:3209 computes shared dims once). At runtime each panel is an independent renderStandalone instance (facets.py:170), so:

  • zooming/panning one panel leaves the others at their original view — comparing the same region across panels means manually reproducing the same box zoom N times;
  • box-select is per-panel; there's no way to brush one panel and see the same x-range (or the selected rows) highlighted in the rest.

There is no API to change this.

Proposed API

xy.facet_chart(
    xy.scatter(x="x", y="y"),
    by="g",
    cols=2,
    data=df,
    link="x",        # None (default) | "x" | "y" | "both"
    link_select=True # default False: brushing one panel echoes the selection to all
)
  • link=None (default): today's behavior, fully independent panels.
  • link="x" | "y" | "both": a zoom/pan in any panel broadcasts its new domain to the other panels on the linked dimension(s). Natural pairing with share_x/share_y — linking a dimension probably implies sharing its initial domain.
  • link_select (or fold into link): a brush in one panel applies the same data-space predicate across panels, and on_select fires once with the union.

Notes

Environment/context: xy main @ 541a7da, playground testing in Jupyter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions