Hello,
Im using holoviews in a Bokeh serve to plot a big database, the thing is that the user can filter or even change the database for different variables and plot according to that filter. I’ve done this via DynamicMap
Example code:
import holoviews as hv
...
renderer = hv.renderer('bokeh').instance(mode='server')
hv.extension('bokeh')
hover = HoverTool(tooltips=[('index', '$index'), ('datetime', '@Date{%Y-%m-%d:%H:%M:%S}'),
('Valor', '@Value{0.00}')],
formatters={'@Date': 'datetime'},
mode='mouse')
pipe = Pipe(data=np.array([[], [], 'Var']))
dmap = hv.DynamicMap(timeseries, streams=[pipe])
hvplot = renderer.get_plot(dmap, curdoc())
....
def timeseries(data):
return hv.Curve(dict(Date=data[0], Value=data[1]), 'Date', (('Value', data[2]))).opts(width=1200,
height=600, tools=['xwheel_zoom', 'pan'], active_tools=['xwheel_zoom', 'pan'],
default_tools= ['reset', 'save', hover])
This works perfectly as expected when pipe.send(…) the curve changes as expected (also whit hv.scatter). The problem is that the interactivity is reduced when a lot of points are plotted over 1 million. So what I am wanting to do is change the following (returning a datashade):
def timeseries(data):
return datashade(hv.Curve(dict(Date=data[0], Value=data[1]), 'Date', (('Value',
data[2]))).opts(width=1200, height=600, tools=['xwheel_zoom', 'pan'], active_tools=
['xwheel_zoom', 'pan'], default_tools= ['reset', 'save', hover]))
But I get the following error:
Exception: Nesting a DynamicMap inside a DynamicMap is not supported. Ensure that the DynamicMap callback returns an Element or (Nd)Overlay. If you have applied an operation ensure it is not dynamic by setting dynamic=False.
I would like a workaround or alternative to this, HoloMap i think wouldnt work because the user can change and filter the whole database whit continuous values.
Setting dynamic to False is not a solution as user can zoom in the data
Thank You in advice.
Josu Catalina