Skip to content

Known limitation (upstream): Tap stream never fires on link_selections-wrapped holoviews element #490

Closed

Description

@cpsievert

Known limitation (upstream): hv.streams.Tap never fires on an element wrapped in hv.link_selections

In a @render_holoviews app, a hv.streams.Tap(source=element) attached to an element that is also passed through hv.link_selections() never fires — the tap-select tool shows in the toolbar and can be activated, but clicking does nothing and the subscriber's value never updates. A control app with the identical Tap subscriber but no link_selections receives the taps correctly in the same session.

Root cause is upstream holoviews, not shinywidgets' comm layer. Root-caused and filed as holoviz/holoviews#7159: Tap(source=a) registers on a._streams; link_selections displays DynamicMap-produced clones and Element.clone() drops _streams, so the bokeh Plot is built with the TapTool but no tap event callback (Plot._event_callbacks has only link_selections' own selectiongeometry/reset). The callback registration happens at Python plot-construction time, so nothing is ever sent over the comm — Jupyter is affected identically.

Workaround (already used in the shinywidgets holoviews guide): attach the Tap stream to a separate, unlinked plot instead of a link_selections-wrapped one.

Filing here only so the limitation is tracked for shinywidgets users; no shinywidgets-side fix is expected. Can be closed as upstream/wontfix, or kept open until holoviz/holoviews#7159 is resolved.

Reproduction (shinywidgets)

import holoviews as hv
import hvplot.pandas  # noqa: F401
import numpy as np
import pandas as pd
from shiny import reactive
from shiny.express import render, ui
from shinywidgets import render_holoviews

hv.extension("bokeh")
ui.page_opts(fillable=True)

df = pd.DataFrame({"x": np.random.normal(size=200), "y": np.random.normal(size=200)})
links = hv.link_selections.instance()
tap_xy = reactive.value(None)

@render_holoviews
def linked():
    a = df.hvplot.scatter("x", "y", responsive=True, title="A", tools=["tap"])
    b = df.hvplot.hist("x", responsive=True, title="B")
    hv.streams.Tap(source=a).add_subscriber(lambda x, y: tap_xy.set((x, y)))
    return links(a + b)

@render.text
def tap_text():
    return str(tap_xy())  # stays None no matter how many times you click plot A

Verified with real Playwright clicks (tap tool activated first): 0 taps delivered with link_selections, 3/3 delivered in the no-link_selections control.

Versions: shinywidgets main (0.8.2.dev), holoviews 1.23.2, hvplot 0.13.0, panel 1.10.0, bokeh 3.10.2, shiny 1.9.0.

Activity

  1. cpsievert commented on Nov 21, 2026

    @cpsievert
    CollaboratorAuthor

    Closing as upstream/wontfix, per the issue's own framing — the root cause is in HoloViews (Element.clone() drops _streams, so a link_selections-wrapped element never registers its tap event callback), tracked at holoviz/holoviews#7159, and Jupyter is affected identically.

    The limitation and the recommended workaround (attach the Tap stream to a separate, unlinked plot, as in 08_tap_detail.py) are documented in the holoviews guide's Gotchas and limitations section. If holoviz/holoviews#7159 gets resolved we can verify and drop that note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions