Plotly cannot be loaded if Mathjax v3 is already loaded
See original GitHub issueSince MathJax v3, Mathjax.Hub
does not exist anymore. This makes impossible to load PlotlyJS if Mathjax v3 has already been loaded. I get the following error:
TypeError: MathJax.Hub is undefined
I believe the error comes from these lines plotly.js
:
module.exports = function() {
if(typeof MathJax !== 'undefined') {
var globalConfig = (window.PlotlyConfig || {}).MathJaxConfig !== 'local';
if(globalConfig) {
MathJax.Hub.Config({
messageStyle: 'none',
skipStartupTypeset: true,
displayAlign: 'left',
tex2jax: {
inlineMath: [['$', '$'], ['\\(', '\\)']]
}
});
MathJax.Hub.Configured();
}
}
};
A check on MathJax version should probably be made here to use MathJax.Hub
or not?
Here is a short example where plotly failed to be loaded: https://codepen.io/bthierry/pen/PoqwXzm
Many thanks!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:12
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Plotly library interferes with MathJax - Plotly Community Forum
…but if Plotly is loaded after MathJax, MathJax stops working. I have no idea why, but I'm glad I found a workaround. I...
Read more >Using mathjax with anvil
I have placed the CDN link to MathJax in the Native Library: ... Plotly cannot be loaded if Mathjax v3 is already loaded....
Read more >python - Unable to export plotly images to png with Kaleido
1) and an older version (4.14.3), but I've got the same problem. python -m pip install plotly. kaleido is the latest version (0.2....
Read more >Loading and Configuring MathJax
Version 3 is now the current version of MathJax. This document is for version 2. Loading and Configuring MathJax¶. You load MathJax into...
Read more >plotly package — 5.11.0 documentation - Plotly Help Center
If True, the trace will not be added to subplots that don't already have traces ... Specifies how the plotly.js library is included/loaded...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
MathJax v3 and plotly.js can be loaded together as long as the following is set before loading Plotly:
For reference: https://github.com/plotly/plotly.js/blob/master/dist/README.md#to-support-mathjax
Thanks for letting me know. Setting up a dev environment is a bit too much work for me, so I’m good on testing for now. I did give feedback though 😃