DynamicMap with .grid() and stream not updating

I am trying to get N simultaneous plots to appear in a grid below a scatter plot when a point on the scatter plot is selected. Each plot corresponds to a field in another data structure (here I’ve mocked up the idea with dummy data), and I’ve used a kdim to represent this dimension. The other input is an index, which is the index of the selected point in the linked hv.Points object. However, the minimal example below doesn’t update the plots when a new point is selected. I am sure I’m doing something simple wrong, but I can’t see what it is.



import numpy as np
import holoviews as hv
from holoviews import opts, dim

npoints = 10

points = hv.Points((np.random.randn(npoints), np.random.randn(npoints)), kdims=['real','imag'])
stream = hv.streams.Selection1D(source=points, name='index',transient=True)

def selected_info(field,index):
    print("index = {}; field = {}".format(index,field))
    selected = points.iloc[index]
    if index:
        label = 'evalue index: {}'.format(index[0])
        zz = np.linspace(0,1,100)
        return (hv.Curve((zz,zz**index),"z",field, label='imag'))
        label = 'No selection'
        return (hv.Points(np.random.rand(0, 2)) * hv.Slope(0, 0)).relabel('No selection')
layout = points.opts(color='k',tools=['tap', 'hover']) * hv.VLine(0) + hv.DynamicMap(selected_info, kdims=hv.Dimension('field',values=['p','u','T']),streams=[stream,]).grid('field')