Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install MathJax using npm and bump version from 2.3 to 2.7.5 #5494

Merged
merged 7 commits into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
vendor
dist
build

Expand Down
2 changes: 1 addition & 1 deletion devtools/test_dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</div>
<div id="snapshot"></div>

<script src="../../vendor/extras/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
<script src="../../node_modules/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
<script id="source" src="../../build/plotly.js" charset="utf-8"></script>
<script src="../../build/test_dashboard-bundle.js" charset="utf-8"></script>
</body>
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"karma-viewport": "^1.0.7",
"lodash": "^4.17.20",
"madge": "^3.12.0",
"mathjax": "2.7.5",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why we stick to 2.7.5 for now.
@nicolaskruchten commented on slack:

Let's target 2.7.5 for MathJax for now
this is what JupyterLab 2.x uses
so it's a good floor IMO
JupyterLab 3.x is on 2.7.9

"minify-stream": "^2.1.0",
"mkdirp": "^1.0.4",
"node-sass": "^5.0.0",
Expand Down
12 changes: 12 additions & 0 deletions tasks/noci_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,21 @@ test_jasmine () {
# since the update to [email protected], we must use orca
# as mapbox-gl versions >0.22.1 aren't supported on [email protected] used in the
# 'old' image server
#
# due to mathjax upgrade to v2.7.5, we are unable to test mathjax mocks in the
# 'old' image server and we use orca
#
test_image () {
$root/../orca/bin/orca.js graph \
$root/test/image/mocks/mapbox_* \
$root/test/image/mocks/mathjax.json \
$root/test/image/mocks/ternary-mathjax.json \
$root/test/image/mocks/table_plain_birds.json \
$root/test/image/mocks/table_wrapped_birds.json \
$root/test/image/mocks/parcats_grid_subplots.json \
$root/test/image/mocks/legend_mathjax_title_and_items.json \
$root/test/image/mocks/table_latex_multitrace_scatter.json \
--mathjax $root/node_modules/mathjax/MathJax.js \
--plotly $root/build/plotly.js \
--mapbox-access-token "pk.eyJ1IjoicGxvdGx5LWpzLXRlc3RzIiwiYSI6ImNrNG9meTJmOTAxa3UzZm10dWdteDQ2eWMifQ.2REjOFyIrleMqwS8H8y1-A" \
--output-dir $root/test/image/baselines/ \
Expand Down
4 changes: 2 additions & 2 deletions tasks/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ function getInfoContent() {
'<script src="mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>',
'```',
'',
'You can get the relevant MathJax files in `./vendor/extras/mathjax/` or from the internet',
'e.g. "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.3/MathJax.js?config=TeX-AMS-MML_SVG.js"',
'You can get the relevant MathJax files from the internet e.g.',
'"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG.js"',
'',
'By default, plotly.js will modify the global MathJax configuration on load.',
'This can lead to undesirable behavior if plotly.js is loaded alongside',
Expand Down
2 changes: 0 additions & 2 deletions tasks/util/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var pathToSrc = path.join(pathToRoot, 'src/');
var pathToLib = path.join(pathToRoot, 'lib/');
var pathToImageTest = path.join(pathToRoot, 'test/image');
var pathToStrictD3Module = path.join(pathToRoot, 'test/strict-d3.js');
var pathToVendor = path.join(pathToRoot, 'vendor/');
var pathToDist = path.join(pathToRoot, 'dist/');
var pathToBuild = path.join(pathToRoot, 'build/');

Expand Down Expand Up @@ -45,7 +44,6 @@ module.exports = {
pathToSrc: pathToSrc,
pathToLib: pathToLib,
pathToBuild: pathToBuild,
pathToVendor: pathToVendor,
pathToDist: pathToDist,

pathToPlotlyIndex: path.join(pathToLib, 'index.js'),
Expand Down
Binary file modified test/image/baselines/legend_mathjax_title_and_items.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/mathjax.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/parcats_grid_subplots.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/table_latex_multitrace_scatter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/table_plain_birds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/table_wrapped_birds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/ternary-mathjax.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions test/image/compare_pixels_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@ function unique(value, index, self) {
}
allMockList = allMockList.filter(unique);

// Skip MathJax mocks that are tested using orca in noci_test
var MATHJAX_LIST = [
'mathjax',
'ternary-mathjax',
'table_plain_birds',
'table_wrapped_birds',
'parcats_grid_subplots',
'legend_mathjax_title_and_items',
'table_latex_multitrace_scatter'
];
allMockList = allMockList.filter(function(e) {
return MATHJAX_LIST.indexOf(e) === -1;
});

// filter out untestable mocks if no pattern is specified (ie. we're testing all mocks)
// or if flag '--filter' is provided
console.log('');
Expand Down
2 changes: 1 addition & 1 deletion test/image/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<body>
<!-- this index file gets copied in to the image server docker -->
<script src="../plotly.js/vendor/extras/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
<script src="../plotly.js/node_modules/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
<script src="../plotly.js/build/plotly.js" charset="utf-8"></script>
<script src="../plotly.js/build/plotly-geo-assets.js" charset="utf-8"></script>
<script src="./main.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/bundle_tests/mathjax_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Test MathJax:', function() {
mathJaxScriptTag.onerror = function() {
fail('MathJax failed to load');
};
mathJaxScriptTag.src = '/base/vendor/extras/mathjax/MathJax.js?config=TeX-AMS-MML_SVG';
mathJaxScriptTag.src = '/base/node_modules/mathjax/MathJax.js?config=TeX-AMS-MML_SVG';
document.body.appendChild(mathJaxScriptTag);
});

Expand Down
4 changes: 2 additions & 2 deletions test/jasmine/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ var pathToJQuery = path.join(__dirname, 'assets', 'jquery-1.8.3.min.js');
var pathToCustomMatchers = path.join(__dirname, 'assets', 'custom_matchers.js');
var pathToUnpolyfill = path.join(__dirname, 'assets', 'unpolyfill.js');
var pathToSaneTopojsonDist = path.join(__dirname, '..', '..', 'node_modules', 'sane-topojson', 'dist');
var pathToMathJax = path.join(constants.pathToVendor, 'extras', 'mathjax');
var pathToMathJax = path.join(__dirname, '..', '..', 'node_modules', 'mathjax');

var reporters = [];
if(argv['report-progress'] || argv['report-spec'] || argv['report-dots']) {
Expand Down Expand Up @@ -180,7 +180,7 @@ func.defaultConfig = {
files: [
pathToCustomMatchers,
pathToUnpolyfill,
// available to fetch from /base/vendor/extras/mathjax/
// available to fetch from /base/node_modules/mathjax/
// more info: http://karma-runner.github.io/3.0/config/files.html
{pattern: pathToMathJax + '/**', included: false, watched: false, served: true},
// available to fetch from /base/node_modules/sane-topojson/dist/
Expand Down
19 changes: 0 additions & 19 deletions vendor/extras/mathjax/MathJax.js

This file was deleted.

52 changes: 0 additions & 52 deletions vendor/extras/mathjax/config/TeX-AMS-MML_SVG.js

This file was deleted.

19 changes: 0 additions & 19 deletions vendor/extras/mathjax/extensions/FontWarnings.js

This file was deleted.

19 changes: 0 additions & 19 deletions vendor/extras/mathjax/extensions/HTML-CSS/handle-floats.js

This file was deleted.

19 changes: 0 additions & 19 deletions vendor/extras/mathjax/extensions/HelpDialog.js

This file was deleted.

Loading