Open buckeye17 opened 8 months ago
This seems to be a problem without dash, both with matplotlib
and plotly
backend.
import holoviews as hv
from holoviews.operation.datashader import rasterize
import numpy as np
import pandas as pd
hv.extension("plotly")
X = pd.date_range(start="1/1/2018", end="1/08/2018", periods=100)
Y = np.linspace(1, 100, 100)
Z = np.random.randn(100, 100)
rasterize(hv.QuadMesh((X, Y, Z)))
Datashader cannot natively accept datetime types, so I believe the HoloViews Bokeh backend converts the data to an integer format before sending it out for rendering. So presumably that same code would need to be applied to the other backends as well, hopefully in a way that can be shared between them.
ALL software version info
(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc)
Windows 10 VSCode 1.85.2 Python 3.9.13
bokeh 3.3.4 Interactive plots and applications in the browser from Python dash 2.14.2 A Python framework for building reactive web-apps. Developed by Plotly. dash-bootstrap-components 1.5.0 Bootstrap themed components for use in Plotly Dash dash-core-components 2.0.0 Core component suite for Dash dash-html-components 2.0.0 Vanilla HTML components for Dash datashader 0.16.0 Data visualization toolchain based on aggregating into a grid holoviews 1.18.1 Stop plotting your data - annotate your data and let it visualize itself. jupyter-bokeh 3.0.7 A Jupyter extension for rendering Bokeh content. jupyter-client 8.6.0 Jupyter protocol implementation and client libraries jupyter-core 5.5.1 Jupyter core package. A base package on which Jupyter projects rely. jupyterlab-widgets 3.0.9 Jupyter interactive widgets for JupyterLab numpy 1.26.2 Fundamental package for array computing in Python pandas 2.1.4 Powerful data structures for data analysis, time series, and statistics plotly 5.18.0 An open-source, interactive data visualization library for Python
Description of expected behavior and the observed behavior
To visualize long time series data with Datashader in Dash web app. Note that in a Jupyter notebook, the visualization works without the
rasterize()
wrapper. And the Dash web app graph works if the X-axis is changed from datetimes to integers. So it seems thatrasterize()
does not work with a time series axis sent throughto_dash()
.Complete, minimal, self-contained example code that reproduces the issue
There is an example here: https://community.plotly.com/t/dash-holoviews-datashader-datetime-axes-y-u-no-work/54241
Stack traceback and/or browser JavaScript console output