Skip to content

Add first-class controls to disable pan and zoom #80

Description

@Kastier1

Problem

XY charts are interactive by default, but interaction_config() only configures hover, click, selection, brush, crosshair, view-change events, and linked views. There is no supported way to make a chart's viewport static.

As a result, dashboard charts that are intended as fixed summaries can still be dragged or wheel-zoomed, leaving bars or axes partially out of view. Hiding the modebar does not disable those gestures, and disabling pointer events on a framework wrapper is brittle because the chart's canvas owns the interaction handlers.

Reproduction

chart = xy.bar_chart(
    xy.bar(["A", "B", "C"], [10, 20, 30]),
    xy.modebar(show=False),
)

Plain-drag still pans and the wheel still zooms.

Proposed API

xy.interaction_config(pan=False, zoom=False)
  • pan=False: ignore plain-drag pan gestures.
  • zoom=False: ignore wheel, box-zoom, double-click reset, and zoom controls.
  • Defaults remain enabled for backward compatibility.
  • Hover and selection should remain independently configurable.

This would let dashboards use fixed-domain summary charts while keeping deliberately exploratory charts interactive.

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