Limitations of the .interactive API
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 124
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 1
Description
The new .interactive API is really fun to work with, but I'm bumping up against either its limits or my own imagination. E.g. if I start with this example that works well:
```python
import panel as pn, xarray as xr, holoviews as hv, hvplot.xarray
pn.extension()
ds = xr.tutorial.open_dataset('air_temperature')
image = ds.hvplot('lon', 'lat')
stream = hv.streams.Tap(source=image, x=-88+360, y=40)
timeseries = ds.interactive.sel(lon=stream.param.x, lat=stream.param.y,
method="nearest").hvplot('time')
pn.Column(image, timeseries.dmap())
```

That's great, but then I want to put some indication of where I tapped, as a red dot in the first plot and as numeric values in the second plot. I can't quite see how to do it. A start, with nothing actually connected:
```python
import panel as pn, xarray as xr, holoviews as hv, hvplot.xarray
pn.extension()
ds = xr.tutorial.open_dataset('air_temperature')
image = ds.hvplot('lon', 'lat')
stream = hv.streams.Tap(source=image, x=-88+360, y=40)
point = hv.Points([(260,40)]).opts(size=5, color="red")
timeseries = ds.interactive.sel(lon=stream.param.x, lat=stream.param.y,
method="nearest").hvplot('time').relabel(f"lon: {stream.x}, lat: {stream.y}")
pn.Column(image*point, timeseries.dmap())
```

I could write a DynamicMap returning a Points object, but that's an entirely new concept, so I'm wondering whether there is some .apply or other more reactive approach that fits better with the rest of the code here, i.e. without an explicit callback.
Also not sure how to specify the title properly in the second plot; stream.param.x won't work, as it just shows the Parameter object itself rather than fetching the current value. Is there a clean way?
It also might be nice to have an automatic way of getting the default title for the second plot, via hvPlot and .interactive somehow connecting up widget values to the title the same way NdOverlays do, but I guess that would be a separate issue.
Contributor guide
Assessment
This issue has not been assessed yet.