# Simple Panel example of map/time series interaction for data cube?

**URL:** <https://discourse.holoviz.org/t/simple-panel-example-of-map-time-series-interaction-for-data-cube/1485>\
**Category:** Panel\
**Created:** [November 30, 2020, 7:44pm UTC](https://discourse.holoviz.org/t/simple-panel-example-of-map-time-series-interaction-for-data-cube/1485 "2020-11-30T19:44:23Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jbednar](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/jbednar/32/23_2.png) [@jbednar](https://discourse.holoviz.org/u/jbednar)\
**Post date:** [November 30, 2020, 9:49pm UTC](https://discourse.holoviz.org/t/simple-panel-example-of-map-time-series-interaction-for-data-cube/1485/3 "2020-11-30T21:49:20Z")

</div>

Thanks, @ahuang11! If you want to see how it looks using `pn.bind` from panel 0.10.1 instead of `@depends`, it’s just:

```auto
import panel as pn
import numpy as np
import xarray as xr
import holoviews as hv
import 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)

def timeseries(x, y):
    return ds.sel(lon=x, lat=y, method='nearest').hvplot('time')

pn.Column(image, pn.bind(timeseries, x=stream.param.x, y=stream.param.y))

```

I.e., basically the same, but now you can write your callback function as just a regular Python function now, with no decorator, and then later bind its arguments to widgets or to stream parameters when you want to put it in a panel.

[UPDATED with working code; I needed to add .dmap()]  
You can also write this even more simply using the new `.interactive` support in hvPlot, which lets you eliminate the callback entirely:

```auto
import panel as pn
import numpy as np
import xarray as xr
import holoviews as hv
import 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())

```

---

_[View the full topic](https://discourse.holoviz.org/t/simple-panel-example-of-map-time-series-interaction-for-data-cube/1485)._
