Update Line Chart on Click event on hvplot map in a panel app

Hi Marc,

Thank you for your reply. After some additional digging I found the following: Simple Panel example of map/time series interaction for data cube? which in essence describes what I am trying to achieve.

However, I have one additional issue that I am struggling with. In the above example, the Tap stream returns a x and y location, however my xarray has only an “index” dimension, where each item is associated with a timeseries of values and also has lat,lon coordinates. Therefore, to select the corresponding timeseries that I would like to display given the result of the tap stream, it would be easiest to index the xarray dataset with an index of points. However, hv.streams.Tap can only return x and y. I found Selection1D_tap but if I click on the map nothing happens, and it just returns the initial value.

So currently what I have tried is, so I have dropped the time slider and just try to plot a static image from which I can make selections through a stream.

ds = load_data()

# create a data array that holds index
loc_df = pd.DataFrame({"lat": ds.N_PROF.lat.data, "lon": ds.N_PROF.lon.data})

image = loc_df.hvplot.points(x="lon", y="lat", geo=True, color="red", alpha=0.4, tiles="ESRI").opts(height=650, width=1300)

# stream = hv.streams.Tap(source=image, index=0)
stream = hv.streams.Selection1D(source=image, index=[0])

def get_ds_timeseries(index):
    print(index)
    return index

# define layout of app
row = pn.Row(
    # pn.Column(image, pn.bind(get_ds_timeseries, x=stream.param.x, y=stream.param.y))
    pn.Column(image, pn.bind(get_ds_timeseries, index=stream.param.index))
)

row.servable(title="App")

Do you happen to have a suggestion or hint again?