Hi!
I am trying to use the Holoviews with Dash and Datashader to display a large dataset. However, when I try to pass the holoviews.HeatMap
object to the holoviews.plotting.plotly.dash.to_dash
method, I get the following error:
AttributeError: 'HeatMap' object has no attribute 'xdensity'
It works to use holoviews.Image
instead of HeatMap
, but interpolation is done on the data, while I want discrete values.
Here is an example, where Image
works but HeatMap
does not:
from dash import Dash, html
import holoviews as hv
from holoviews.plotting.plotly.dash import to_dash
from holoviews.operation.datashader import datashade
app = Dash(__name__)
image = datashade(hv.Image(([0, 1], [0, 1], [[0, 1], [2, 3]])))
heatmap = datashade(hv.HeatMap([(0, 0, 0), (0, 1, 1), (1, 0, 2), (1, 1, 3)]))
plot = to_dash(app, [image], reset_button=True) # or [heatmap]
app.layout = html.Div(plot.children)
if __name__ == '__main__':
app.run(debug=True)