-
-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't export HTML with Plotly backend #3683
Comments
I accidentally found out some plots can be exported to html using plotly backend. It seems that export works when there is extra key dimensions. In this case, when I plot using ds.to, the extra key dimension will be shown as drop down menu or slider. (I think holoviews automatically draws HoloMap instead of simple curve). Export works for this kind of plots. # imports
import numpy as np
import pandas as pd
import holoviews as hv
from holoviews import opts
hv.extension('plotly')
# create a dataframe
df = pd.DataFrame()
df['x'] = np.arange(10)
df['y'] = np.arange(10)
df.loc[0:4,'handle']=0
df.loc[5:9,'handle']=1
# convert dataframe to holoviews dataset
x = hv.Dimension('x')
y = hv.Dimension('y')
handle = hv.Dimension('handle')
ds_with_handle = hv.Dataset(df, [x, handle], y)
ds_without_handle = hv.Dataset(df, x, y)
# plot using dataset.to
plot_with_handle = ds_with_handle.to(hv.Curve, 'x','y')
plot_without_handle = ds_without_handle.to(hv.Curve, 'x','y')
#export
hv.save(plot_with_handle, 'plot_with_handle.html')
hv.save(plot_without_handle, 'plot_without_handle.html') type(plot_with_handle)
Output: holoviews.core.spaces.HoloMap type(plot_without_handle)
Output: holoviews.element.chart.Curve The exported htmls: Hope this information helps to fix the bug. |
Thanks @HuangJunye these detailed bug reports will indeed be very helpful. |
Fixed on master. |
@philippjfr That's great to know! Thanks! |
Will this be in the next release? |
Yes, that should be in the next release. In the meantime, you can install from master using something like |
Hi, |
That comment doesn't seem related to this issue...? |
When I use Plotly as backend, the exported HTML does not shows the plot correctly. When I click on the exported HTML file, only ''Drawing..." is displayed.
This is the python code I used in Jupyter notebook
This is the source code of the exported HTML
It seems the data is included in the HTML file but for some reasons it is not shown.
The text was updated successfully, but these errors were encountered: