I’m wondering if I’m doing something wrong or if this is a bug?
I am following the example from the Holoviz website, but I have modified it to include datashade. When I zoom in on the chart, using the source chart, the target chart does not update - it scrolls but the datashade never updates the bitmap.
import pandas as pd
import holoviews as hv
from holoviews import opts
from holoviews.plotting.links import RangeToolLink
hv.extension('bokeh')
# Need to do this once
#import bokeh
#bokeh.sampledata.download()
import holoviews.operation.datashader as hd
from bokeh.sampledata.stocks import AAPL
aapl_df = pd.DataFrame(AAPL['close'], columns=['close'], index=pd.to_datetime(AAPL['date']))
aapl_df.index.name = 'Date'
aapl_curve = hv.Curve(aapl_df, 'Date', ('close', 'Price ($)'))
aapl_curve = hd.datashade(aapl_curve)
tgt = aapl_curve.relabel('AAPL close price').opts(width=800, height=400, labelled=['y'], toolbar='disable')
src = aapl_curve.opts(width=800, height=100, yaxis=None, default_tools=[])
RangeToolLink(src, tgt)
layout = (tgt + src).cols(1)
layout.opts(opts.Layout(shared_axes=False, merge_tools=False))
Version doesn’t seem to matter, but I’m running:
python 3.9.13
holoviews 1.15.0
datashader 0.14.2
pandas 1.4.3
bokeh 2.4.3
Here is what it looks like when I zoom in with datashade:
Actually I think there still might be a problem. Datashade updates both the target and source plots, which results in only partial display of the data in the lower plot. This wasn’t obvious with the AAPL data because of the tiny size of the line, but if I change to dense data, it is very blatant: