You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bad plotly figures rendering in the examples gallery #30279
Currently, I found 2 examples in the examples gallery of the scikit-learn documentation that use plotly instead of matplotlib for plots, for interactivity purposes:
The PyData Sphinx Theme, such as the scikit-learn documentation, does not display plotly figures properly. Indeed, plotly figures are cropped and you have to zoom in / out for proper rendering):
plotly.mov
This plotly rendering issue appears also in the official Sphinx doc.
Hopefully this can be fixed in plotly: I think plotly/plotly.py#4828 is the relevant one.
I agree with this, I'm not sure this is a kaleido issue, but just to clarify, there is a new version of kaleido out which requires chrome/chromium to be installed separately.
I implemented a workaround that we could have also in scikit-learn: probabl-ai/skore#748
It seems that there is a side-effect with the secondary sidebar of pydata-sphinx-theme.
It seems that the plotly figure get loaded first ignoring the size of the right-hand sidebar (because it is not loaded/toggle yet?).
So the workaround is to make a final resizing of all the plotly figure once the HTML page is ready.
I'm not sure what would be the right fix here because but it might be an interaction between plotly/pydata-sphinx-theme/bootstrap.
And this is where my knowledge in the triptych HTML/CSS/JS is ending :)
Activity
lesteve commentedon Nov 15, 2024
Hopefully this can be fixed in plotly: I think plotly/plotly.py#4828 is the relevant one.
ayjayt commentedon Nov 15, 2024
I agree with this, I'm not sure this is a kaleido issue, but just to clarify, there is a new version of kaleido out which requires chrome/chromium to be installed separately.
glemaitre commentedon Nov 15, 2024
I implemented a workaround that we could have also in scikit-learn: probabl-ai/skore#748
It seems that there is a side-effect with the secondary sidebar of
pydata-sphinx-theme.It seems that the plotly figure get loaded first ignoring the size of the right-hand sidebar (because it is not loaded/toggle yet?).
So the workaround is to make a final resizing of all the plotly figure once the HTML page is ready.
I'm not sure what would be the right fix here because but it might be an interaction between plotly/pydata-sphinx-theme/bootstrap.
And this is where my knowledge in the triptych HTML/CSS/JS is ending :)