How do I manually trigger a stream or `pn.bind`?

import numpy as np
import holoviews as hv
import panel as pn
# create an empty Points element
points = hv.Points([])
# Create the Tap stream with the points element as the source
# We set the x and y here with starting values
stream = hv.streams.Tap(source=points, x=np.nan, y=np.nan)

# make a function that displays the location when called.
def location(x, y):
    """Display pane showing the x and y values"""
    print(x, y, 'hey')
    return pn.pane.Str('Click at %0.3f, %0.3f' % (x, y), width=200)

# Display the points and the function output, updated
# whenever the stream values change
bind = pn.bind(location, x=stream.param.x, y=stream.param.y)
layout = pn.Row(points, bind)
# display the container

I was thinking of like:

Similar to:

stream.update(x=stream.x) works

1 Like