Closed
Description
I recently upgraded to jupyter notebook v7 and I noticed that some plotly plots that previously rendered flawlessly now fail to render. I get the following output:
After some exploration I found out that it comes from an error using MathJax in jupyterlab-plotly
. It tries to access MathJax.config.startup.output
, but MathJax.config.startup
is undefined
.
It is very easy to reproduce this error:
- Create a new python environment (I tried with python 3.8).
pip install jupyter plotly
- Open a jupyter notebook with
jupyter notebook
. - Run a cell with the following code:
from plotly.graph_objects import Figure
Figure().update_layout(title="$Title$")
Activity
pfebrer commentedon Aug 22, 2023
Ok, I installed the
jupyterlab-plotly
extension withjupyter labextension install plotlywidget
and it works, so I guess this will be fixed in the next python package release (?)pfebrer commentedon Aug 22, 2023
No, sorry it also doesn't work, the previous code snippet just literally shows
"$Title$"
as a title, but prepending the string with 'r' makes the issue show again:zhimin-z commentedon Aug 27, 2023
Hi, I faced the same issue, any update?
pfebrer commentedon Aug 27, 2023
No, I still need some solution for this 😅
newville commentedon Nov 14, 2023
@zhimin-z @pfebrer I've been seeing this issue for a while too. Is there any understanding of the cause and what might be done to fix it?
zhimin-z commentedon Nov 14, 2023
Yeah, still there... @newville

newville commentedon Nov 14, 2023
@zhimin-z Yes, the problem still exists. Is there any understanding of the cause of the problem? Has anyone investigated what is going on in the code? I'm afraid this is a bit outside of my area of expertise.
zhimin-z commentedon Nov 14, 2023
I have no idea...anyone who is in charge of latex functionality in this repo?
pfebrer commentedon Nov 14, 2023
I'm tagging @alexcjohnson since he seems to be the last to have committed something to jupyterlab-plotly other than version changes :)
It looks like this is an easy fix that just needs an update to use the latest MathJax version, or somehow forcing jupyterlab to use an oldest one, I don't know if that's possible.
newville commentedon Nov 20, 2023
@pfebrer @alexcjohnson Thanks for looking into this. Is there anything the rest of us can do to help further troubleshoot or fix this issue? I'll admit that I do not have a deep understanding of how plotply.py and plotly.js interact or which version of mathjax
is actually being used.
pfebrer commentedon Nov 22, 2023
I don't know, everything I know is that jupyterlab uses MathJax
3.2
and plotly's docs use2.7
, but in principle version3
should work as well according to plotly/plotly.js#6073I don't even know how to modify
jupyterlab-plotly
and use a modified version of the extension. I have tried topip install -e .
the plotly repo to play a little bit with it but then jupyter doesn't render anything.newville commentedon Nov 26, 2023
@pfebrer Thanks, sorry to be dense, but what precisely would one have to do to make it work? Could that be folded into the plotly-py code?
The issue is kind of 3 months old, and it seems that there has been no explanation or acknowledgment of this issue.
But, I don't really know what that means. Maybe the solution is obvious to someone?
55 remaining items