Skip to content

Commit cfa7720

Browse files
authored
Merge pull request #5494 from plotly/mathjax-v2.7.9
Install MathJax using npm and bump version from 2.3 to 2.7.5
2 parents f125c24 + 219b48e commit cfa7720

File tree

415 files changed

+40
-7548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

415 files changed

+40
-7548
lines changed

Diff for: .eslintignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
node_modules
2-
vendor
32
dist
43
build
54

Diff for: devtools/test_dashboard/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</div>
2020
<div id="snapshot"></div>
2121

22-
<script src="../../vendor/extras/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
22+
<script src="../../node_modules/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
2323
<script id="source" src="../../build/plotly.js" charset="utf-8"></script>
2424
<script src="../../build/test_dashboard-bundle.js" charset="utf-8"></script>
2525
</body>

Diff for: package-lock.json

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
"karma-viewport": "^1.0.7",
165165
"lodash": "^4.17.20",
166166
"madge": "^3.12.0",
167+
"mathjax": "2.7.5",
167168
"minify-stream": "^2.1.0",
168169
"mkdirp": "^1.0.4",
169170
"node-sass": "^5.0.0",

Diff for: tasks/noci_test.sh

+12
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,21 @@ test_jasmine () {
2626
# since the update to [email protected], we must use orca
2727
# as mapbox-gl versions >0.22.1 aren't supported on [email protected] used in the
2828
# 'old' image server
29+
#
30+
# due to mathjax upgrade to v2.7.5, we are unable to test mathjax mocks in the
31+
# 'old' image server and we use orca
32+
#
2933
test_image () {
3034
$root/../orca/bin/orca.js graph \
3135
$root/test/image/mocks/mapbox_* \
36+
$root/test/image/mocks/mathjax.json \
37+
$root/test/image/mocks/ternary-mathjax.json \
38+
$root/test/image/mocks/table_plain_birds.json \
39+
$root/test/image/mocks/table_wrapped_birds.json \
40+
$root/test/image/mocks/parcats_grid_subplots.json \
41+
$root/test/image/mocks/legend_mathjax_title_and_items.json \
42+
$root/test/image/mocks/table_latex_multitrace_scatter.json \
43+
--mathjax $root/node_modules/mathjax/MathJax.js \
3244
--plotly $root/build/plotly.js \
3345
--mapbox-access-token "pk.eyJ1IjoicGxvdGx5LWpzLXRlc3RzIiwiYSI6ImNrNG9meTJmOTAxa3UzZm10dWdteDQ2eWMifQ.2REjOFyIrleMqwS8H8y1-A" \
3446
--output-dir $root/test/image/baselines/ \

Diff for: tasks/stats.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ function getInfoContent() {
5858
'<script src="mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>',
5959
'```',
6060
'',
61-
'You can get the relevant MathJax files in `./vendor/extras/mathjax/` or from the internet',
62-
'e.g. "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.3/MathJax.js?config=TeX-AMS-MML_SVG.js"',
61+
'You can get the relevant MathJax files from the internet e.g.',
62+
'"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG.js"',
6363
'',
6464
'By default, plotly.js will modify the global MathJax configuration on load.',
6565
'This can lead to undesirable behavior if plotly.js is loaded alongside',

Diff for: tasks/util/constants.js

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ var pathToSrc = path.join(pathToRoot, 'src/');
66
var pathToLib = path.join(pathToRoot, 'lib/');
77
var pathToImageTest = path.join(pathToRoot, 'test/image');
88
var pathToStrictD3Module = path.join(pathToRoot, 'test/strict-d3.js');
9-
var pathToVendor = path.join(pathToRoot, 'vendor/');
109
var pathToDist = path.join(pathToRoot, 'dist/');
1110
var pathToBuild = path.join(pathToRoot, 'build/');
1211

@@ -45,7 +44,6 @@ module.exports = {
4544
pathToSrc: pathToSrc,
4645
pathToLib: pathToLib,
4746
pathToBuild: pathToBuild,
48-
pathToVendor: pathToVendor,
4947
pathToDist: pathToDist,
5048

5149
pathToPlotlyIndex: path.join(pathToLib, 'index.js'),
-2.58 KB
Loading

Diff for: test/image/baselines/mathjax.png

-1.77 KB
Loading

Diff for: test/image/baselines/parcats_grid_subplots.png

2.13 KB
Loading
2.37 KB
Loading

Diff for: test/image/baselines/table_plain_birds.png

-84 Bytes
Loading

Diff for: test/image/baselines/table_wrapped_birds.png

-117 Bytes
Loading

Diff for: test/image/baselines/ternary-mathjax.png

-2.12 KB
Loading

Diff for: test/image/compare_pixels_test.js

+14
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,20 @@ function unique(value, index, self) {
8080
}
8181
allMockList = allMockList.filter(unique);
8282

83+
// Skip MathJax mocks that are tested using orca in noci_test
84+
var MATHJAX_LIST = [
85+
'mathjax',
86+
'ternary-mathjax',
87+
'table_plain_birds',
88+
'table_wrapped_birds',
89+
'parcats_grid_subplots',
90+
'legend_mathjax_title_and_items',
91+
'table_latex_multitrace_scatter'
92+
];
93+
allMockList = allMockList.filter(function(e) {
94+
return MATHJAX_LIST.indexOf(e) === -1;
95+
});
96+
8397
// filter out untestable mocks if no pattern is specified (ie. we're testing all mocks)
8498
// or if flag '--filter' is provided
8599
console.log('');

Diff for: test/image/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<body>
44
<!-- this index file gets copied in to the image server docker -->
5-
<script src="../plotly.js/vendor/extras/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
5+
<script src="../plotly.js/node_modules/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
66
<script src="../plotly.js/build/plotly.js" charset="utf-8"></script>
77
<script src="../plotly.js/build/plotly-geo-assets.js" charset="utf-8"></script>
88
<script src="./main.js"></script>

Diff for: test/jasmine/bundle_tests/mathjax_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('Test MathJax:', function() {
2424
mathJaxScriptTag.onerror = function() {
2525
fail('MathJax failed to load');
2626
};
27-
mathJaxScriptTag.src = '/base/vendor/extras/mathjax/MathJax.js?config=TeX-AMS-MML_SVG';
27+
mathJaxScriptTag.src = '/base/node_modules/mathjax/MathJax.js?config=TeX-AMS-MML_SVG';
2828
document.body.appendChild(mathJaxScriptTag);
2929
});
3030

Diff for: test/jasmine/karma.conf.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ var pathToJQuery = path.join(__dirname, 'assets', 'jquery-1.8.3.min.js');
122122
var pathToCustomMatchers = path.join(__dirname, 'assets', 'custom_matchers.js');
123123
var pathToUnpolyfill = path.join(__dirname, 'assets', 'unpolyfill.js');
124124
var pathToSaneTopojsonDist = path.join(__dirname, '..', '..', 'node_modules', 'sane-topojson', 'dist');
125-
var pathToMathJax = path.join(constants.pathToVendor, 'extras', 'mathjax');
125+
var pathToMathJax = path.join(__dirname, '..', '..', 'node_modules', 'mathjax');
126126

127127
var reporters = [];
128128
if(argv['report-progress'] || argv['report-spec'] || argv['report-dots']) {
@@ -180,7 +180,7 @@ func.defaultConfig = {
180180
files: [
181181
pathToCustomMatchers,
182182
pathToUnpolyfill,
183-
// available to fetch from /base/vendor/extras/mathjax/
183+
// available to fetch from /base/node_modules/mathjax/
184184
// more info: http://karma-runner.github.io/3.0/config/files.html
185185
{pattern: pathToMathJax + '/**', included: false, watched: false, served: true},
186186
// available to fetch from /base/node_modules/sane-topojson/dist/

Diff for: vendor/extras/mathjax/MathJax.js

-19
This file was deleted.

Diff for: vendor/extras/mathjax/config/TeX-AMS-MML_SVG.js

-52
This file was deleted.

Diff for: vendor/extras/mathjax/extensions/FontWarnings.js

-19
This file was deleted.

Diff for: vendor/extras/mathjax/extensions/HTML-CSS/handle-floats.js

-19
This file was deleted.

Diff for: vendor/extras/mathjax/extensions/HelpDialog.js

-19
This file was deleted.

0 commit comments

Comments
 (0)