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
Jupyter Plotly JSON mime renderer does not update #3053
When displaying some plotly JSON content the viewport does not update on subsequent changes of the data. However closing and reopening the notebook does indeed display the updated plot, suggesting that there might be a problem with the renderer itself.
Example code:
out= {}
out['application/vnd.plotly.v1+json'] = {
"data": [
{
"x": [
"giraffes",
"orangutans",
"monkeys"
],
"y": [
20,
14,
23
],
"type": "bar"
}
]
}
h=display(out, raw=True, display_id=True)
# This does not update the rendered view # however closing and reopening the notebook doesout['application/vnd.plotly.v1+json']['data'][0]['y'][0] =10;
h.update(out, raw=True)
No error is reported in the developer console
Environment:
Output of command jupyter labextension list:
JupyterLab v3.0.6
/usr/share/jupyter/labextensions
@jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK
Other labextensions (built into JupyterLab)
app dir: /home/giulio/.jupyter/lab/appdir
jupyterlab-plotly v4.14.3 enabled OK
Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson
This still happens with jupyterlab-plotly 7.1.0 in JupyterLab 4 (and JupyterLite 0.8), with the example above. The cause is in js/src/mimeExtension.ts: renderModel returns early whenever the widget already has a graph, so an update_display_data never reaches Plotly.react. #5865 redraws when the figure has changed. It also affects the Octave kernel xeus-octave, whose animations stay on their first frame.
Activity
blois commentedon May 18, 2021
Investigated googlecolab/colabtools#2020 which appears to be related.
I believe the root of this is that
_ipython_display_is being used:https://github.com/plotly/plotly.py/blob/master/packages/python/plotly/plotly/basedatatypes.py#L837
That method is deprecated, with
_repr_mimebundle_being the preferred:https://github.com/ipython/ipython/blob/e37bc7afddaf74327eabf661b4ebd4e1047299b5/IPython/core/formatters.py#L898-L900
The issue as far as I can see is that
_ipython_display_does not result in a mime bundle with the display ID set on it.A simplified example which shows the difference between the two mechanisms with display handles in play:
https://colab.research.google.com/gist/blois/88002846ca09081bfab1e87b8592717e/custom-display-formatters.ipynb
gvwilson commentedon Jun 25, 2024
Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson
AllenDowney commentedon Nov 2, 2026
This still happens with jupyterlab-plotly 7.1.0 in JupyterLab 4 (and JupyterLite 0.8), with the example above. The cause is in
js/src/mimeExtension.ts:renderModelreturns early whenever the widget already has a graph, so anupdate_display_datanever reachesPlotly.react. #5865 redraws when the figure has changed. It also affects the Octave kernel xeus-octave, whose animations stay on their first frame.