Skip to content

Commit 1ae7aad

Browse files
committed
update test dashboard, plot schema, package.json and make_baselines script to reference mathjax v3/v4 instead of v2/v3
1 parent 2646ffd commit 1ae7aad

7 files changed

Lines changed: 31 additions & 22 deletions

File tree

‎devtools/test_dashboard/index-mathjax3chtml.html‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,7 @@
4949
options.format = svgDocument.inputJax[0].name;
5050
return svgDocument.convert(math, options);
5151
};
52-
/*
53-
MathJax.tex2svgPromise = (math, options = {}) => {
54-
options.format = svgDocument.inputJax[0].name;
55-
return mathjax.handleRetriesFor(() => svgDocument.convert(math, options));
56-
};
57-
*/
52+
5853
MathJax.svgStylesheet = () => svgOutput.styleSheet(svgDocument);
5954
}
6055
}

‎devtools/test_dashboard/index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<!-- Update UI elements if strict mode is enabled -->
2828
<script src="./strict.js"></script>
2929

30-
<script src="../../node_modules/@plotly/mathjax-v2/MathJax.js?config=TeX-AMS-MML_SVG"></script>
30+
<script src="../../node_modules/@plotly/mathjax-v4/tex-svg.js"></script>
3131
<script charset="utf-8" id="source" src="../../build/plotly.js"></script>
3232
<script charset="utf-8" src="../../build/test_dashboard-bundle.js"></script>
3333
</body>

‎package-lock.json‎

Lines changed: 20 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@
115115
},
116116
"devDependencies": {
117117
"@biomejs/biome": "2.2.0",
118-
"@plotly/mathjax-v2": "npm:mathjax@2.7.5",
119-
"@plotly/mathjax-v3": "npm:mathjax@^3.2.2",
118+
"@plotly/mathjax-v3": "npm:mathjax@3.2.2",
119+
"@plotly/mathjax-v4": "npm:mathjax@^4.1.2",
120120
"@types/d3": "3.5.34",
121121
"@types/node": "^24.10.0",
122122
"amdefine": "^1.0.1",

‎src/types/generated/schema.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16375,7 +16375,7 @@ export interface ConfigBase {
1637516375
*/
1637616376
topojsonURL?: string;
1637716377
/**
16378-
* Determines whether math should be typeset or not, when MathJax (either v2 or v3) is present on the page.
16378+
* Determines whether math should be typeset or not, when MathJax (either v3 or v4) is present on the page.
1637916379
* @default true
1638016380
*/
1638116381
typesetMath?: boolean;

‎test/image/make_baseline.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636

3737
print("output to", dirOut)
3838

39-
mathjax_version = 2
40-
mathjax = None
4139
if "mathjax3" in sys.argv or "mathjax3=" in sys.argv:
4240
# until https://github.com/plotly/Kaleido/issues/124 is addressed
4341
# we are uanble to use local mathjax v3 installed in node_modules
@@ -46,6 +44,11 @@
4644

4745
mathjax_version = 3
4846
print("Kaleido using MathJax v3")
47+
else:
48+
mathjax_version = 4
49+
# Kaleido still defaults to MathJax v2, so we need to explicitly specify the path to MathJax v4
50+
mathjax = "https://cdn.jsdelivr.net/npm/mathjax@4.1.2/tex-svg.js"
51+
print("Kaleido using MathJax v4")
4952

5053
virtual_webgl_version = 0 # i.e. virtual-webgl is not used
5154
if "virtual-webgl" in sys.argv or "virtual-webgl=" in sys.argv:

‎test/plot-schema.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@
340340
"valType": "string"
341341
},
342342
"typesetMath": {
343-
"description": "Determines whether math should be typeset or not, when MathJax (either v2 or v3) is present on the page.",
343+
"description": "Determines whether math should be typeset or not, when MathJax (either v3 or v4) is present on the page.",
344344
"dflt": true,
345345
"valType": "boolean"
346346
},

0 commit comments

Comments
 (0)