Skip to content

Commit 80f6f9e

Browse files
committed
Merge branch 'master' into regl-build-setup
2 parents f8548e1 + c988437 commit 80f6f9e

File tree

117 files changed

+5777
-2553
lines changed

Some content is hidden

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

117 files changed

+5777
-2553
lines changed

.circleci/config.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
environment:
7474
# Alaska time (arbitrary timezone to test date logic)
7575
TZ: "America/Anchorage"
76-
parallelism: 8
76+
parallelism: 12
7777
working_directory: ~/plotly.js
7878
steps:
7979
- browser-tools/install-browser-tools: &browser-versions
@@ -200,6 +200,24 @@ jobs:
200200
name: Test MathJax on firefox-latest
201201
command: .circleci/test.sh mathjax-firefox82+
202202

203+
make-baselines-mathjax3:
204+
docker:
205+
- image: circleci/python:3.8.9
206+
working_directory: ~/plotly.js
207+
steps:
208+
- attach_workspace:
209+
at: ~/
210+
- run:
211+
name: Install kaleido, plotly.io and required fonts
212+
command: .circleci/env_image.sh
213+
- run:
214+
name: Create mathjax v3 png files
215+
command: .circleci/test.sh make-baselines-mathjax3
216+
- persist_to_workspace:
217+
root: ~/
218+
paths:
219+
- plotly.js
220+
203221
make-baselines:
204222
parallelism: 4
205223
docker:
@@ -233,6 +251,20 @@ jobs:
233251
path: build
234252
destination: /
235253

254+
test-baselines-mathjax3:
255+
docker:
256+
- image: circleci/node:16.8.0
257+
working_directory: ~/plotly.js
258+
steps:
259+
- attach_workspace:
260+
at: ~/
261+
- run:
262+
name: Compare pixels of mathjax v3 baselines
263+
command: .circleci/test.sh test-image-mathjax3
264+
- store_artifacts:
265+
path: build
266+
destination: /
267+
236268
make-exports:
237269
docker:
238270
- image: circleci/python:3.8.9
@@ -395,6 +427,12 @@ workflows:
395427
- flaky-no-gl-jasmine:
396428
requires:
397429
- install-and-cibuild
430+
- make-baselines-mathjax3:
431+
requires:
432+
- install-and-cibuild
433+
- test-baselines-mathjax3:
434+
requires:
435+
- make-baselines-mathjax3
398436
- make-baselines:
399437
requires:
400438
- install-and-cibuild

.circleci/test.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,15 @@ case $1 in
7575
;;
7676

7777
mathjax-firefox82+)
78-
./node_modules/karma/bin/karma start test/jasmine/karma.conf.js --FF --skip-tags=noFF82 --bundleTest=mathjax --nowatch || EXIT_STATE=$?
78+
./node_modules/karma/bin/karma start test/jasmine/karma.conf.js --FF --bundleTest=mathjax --skip-tags=noFF82 --nowatch &&
79+
./node_modules/karma/bin/karma start test/jasmine/karma.conf.js --FF --bundleTest=mathjax --mathjax3 --skip-tags=noFF82 --nowatch &&
80+
./node_modules/karma/bin/karma start test/jasmine/karma.conf.js --FF --bundleTest=mathjax_config --mathjax3 --nowatch &&
81+
./node_modules/karma/bin/karma start test/jasmine/karma.conf.js --FF --bundleTest=mathjax_config --nowatch || EXIT_STATE=$?
82+
exit $EXIT_STATE
83+
;;
84+
85+
make-baselines-mathjax3)
86+
python3 test/image/make_baseline.py mathjax3 legend_mathjax_title_and_items mathjax parcats_grid_subplots table_latex_multitrace_scatter table_plain_birds table_wrapped_birds ternary-mathjax || EXIT_STATE=$?
7987
exit $EXIT_STATE
8088
;;
8189

@@ -90,6 +98,11 @@ case $1 in
9098
exit $EXIT_STATE
9199
;;
92100

101+
test-image-mathjax3)
102+
node test/image/compare_pixels_test.js mathjax3 || { tar -cvf build/baselines.tar build/test_images/*.png ; exit 1 ; } || EXIT_STATE=$?
103+
exit $EXIT_STATE
104+
;;
105+
93106
source-syntax)
94107
npm run lint || EXIT_STATE=$?
95108
npm run test-syntax || EXIT_STATE=$?

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,35 @@ To see all merged commits on the master branch that will be part of the next plo
99

1010
where X.Y.Z is the semver of most recent plotly.js release.
1111

12+
## [2.10.1] -- 2022-03-08
13+
14+
### Fixed
15+
- Fix `mesh3d` generation when `alphahull` is a positive number (regression introduced in 2.5.1) [[#6133](https://github.com/plotly/plotly.js/pull/6133)]
16+
17+
18+
## [2.10.0] -- 2022-03-04
19+
20+
### Added
21+
- Add support to use version 3 of MathJax and add `typesetMath` attribute to config [[#6073](https://github.com/plotly/plotly.js/pull/6073)],
22+
with thanks to [Equinor](https://www.equinor.com) for sponsoring the related development!
23+
- Add `fillpattern` options to `scatter` trace [[#6101](https://github.com/plotly/plotly.js/pull/6101)],
24+
with thanks to @s417-lama for the contribution!
25+
26+
27+
## [2.9.0] -- 2022-02-04
28+
29+
### Added
30+
- Implement `ticklabelstep` to reduce labels on 2D axes and colorbars [[#6088](https://github.com/plotly/plotly.js/pull/6088)],
31+
this feature was anonymously sponsored: thank you to our sponsor!
32+
33+
### Changed
34+
- Display the version of plotly.js when hovering over the modebar [[#6077](https://github.com/plotly/plotly.js/pull/6077)]
35+
- Various dependency updates as listed under [the v2.9.0 milestone](https://github.com/plotly/plotly.js/milestone/69?closed=1)
36+
37+
### Fixed
38+
- Fix vertical spacing of legend items in horizontal mode [[#6094](https://github.com/plotly/plotly.js/pull/6094)]
39+
40+
1241
## [2.8.3] -- 2021-12-20
1342

1443
### Fixed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ npm start
118118

119119
This command bundles up the source files with source maps using
120120
[browserify](https://github.com/substack/node-browserify), starts a
121-
[watchify](https://github.com/substack/watchify) file watcher (making the your
121+
[watchify](https://github.com/substack/watchify) file watcher (making your
122122
dev plotly.js bundle update every time a source file is saved) and opens up a
123123
tab in your browser.
124124

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo
5555
5656
```html
5757
<head>
58-
<script src="https://cdn.plot.ly/plotly-2.8.3.min.js"></script>
58+
<script src="https://cdn.plot.ly/plotly-2.10.1.min.js"></script>
5959
</head>
6060
<body>
6161
<div id="gd"></div>
@@ -72,7 +72,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo
7272
Alternatively you may consider using [native ES6 import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) in the script tag.
7373
```html
7474
<script type="module">
75-
import "https://cdn.plot.ly/plotly-2.8.3.min.js"
75+
import "https://cdn.plot.ly/plotly-2.10.1.min.js"
7676
Plotly.newPlot("gd", [{ y: [1, 2, 3] }])
7777
</script>
7878
```
@@ -82,16 +82,24 @@ Fastly supports Plotly.js with free CDN service. Read more at <https://www.fastl
8282
### Un-minified versions are also available on CDN
8383
While non-minified source files may contain characters outside UTF-8, it is recommended that you specify the `charset` when loading those bundles.
8484
```html
85-
<script src="https://cdn.plot.ly/plotly-2.8.3.js" charset="utf-8"></script>
85+
<script src="https://cdn.plot.ly/plotly-2.10.1.js" charset="utf-8"></script>
8686
```
8787

8888
> Please note that as of v2 the "plotly-latest" outputs (e.g. https://cdn.plot.ly/plotly-latest.min.js) will no longer be updated on the CDN, and will stay at the last v1 patch v1.58.5. Therefore, to use the CDN with plotly.js v2 and higher, you must specify an exact plotly.js version.
8989
90-
To support MathJax, you need to load version two of MathJax e.g. `v2.7.5` files from CDN or npm.
90+
To support MathJax, you could load either version two or version three of MathJax files, for example:
9191
```html
9292
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG.js"></script>
9393
```
9494

95+
```html
96+
<script src="https://cdn.jsdelivr.net/npm/mathjax@3.2.0/es5/tex-svg.js"></script>
97+
```
98+
99+
> When using MathJax version 3, it is also possible to use `chtml` output on the other parts of the page in addition to `svg` output for the plotly graph.
100+
Please refer to `devtools/test_dashboard/index-mathjax3chtml.html` to see an example.
101+
102+
95103
## Bundles
96104
There are two kinds of plotly.js bundles:
97105
1. Complete and partial official bundles that are distributed to `npm` and the `CDN`, described in [the dist README](https://github.com/plotly/plotly.js/blob/master/dist/README.md).
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Plotly.js Devtools - MathJax v3 loaded with svg output</title>
5+
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:600,400,300,200|Droid+Sans|PT+Sans+Narrow|Gravitas+One|Droid+Sans+Mono|Droid+Serif|Raleway|Old+Standard+TT"/>
6+
<link rel="stylesheet" type="text/css" href="./style.css">
7+
</head>
8+
<body>
9+
<header>
10+
<img src="http://images.plot.ly/logo/plotlyjs-logo@2x.png" onClick="Tabs.reload();" />
11+
<span id="reload-time"></span>
12+
13+
<input id="mocks-search" type="text" placeholder="mocks search" />
14+
<input id="css-transform" type="text" placeholder="css transform" />
15+
</header>
16+
17+
<section id="mocks-list"></section>
18+
19+
<p id="pWithMathJax">MathJax $V^3$ with $svg$ output on the page as well as plotly graphs</p>
20+
<h4>no MathJax: Apple: $2, Orange: $3</h4>
21+
22+
<div id="plots">
23+
<div id="graph"></div>
24+
</div>
25+
<div id="snapshot"></div>
26+
27+
<script>
28+
window.MathJax = {
29+
startup: {
30+
elements: [
31+
document.getElementById('pWithMathJax')
32+
],
33+
// typeset: false,
34+
// in case the elements array is empty one could disable startup typeset
35+
// https://docs.mathjax.org/en/latest/options/startup/startup.html#the-configuration-block
36+
}
37+
};
38+
</script>
39+
<script src="../../node_modules/mathjax-v3/es5/tex-svg.js"></script>
40+
<script charset="utf-8" id="source" src="../../build/plotly.js" type="module"></script>
41+
<script charset="utf-8" src="../../build/test_dashboard-bundle.js"></script>
42+
</body>
43+
</html>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Plotly.js Devtools - MathJax v3 loaded with chtml output</title>
5+
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:600,400,300,200|Droid+Sans|PT+Sans+Narrow|Gravitas+One|Droid+Sans+Mono|Droid+Serif|Raleway|Old+Standard+TT"/>
6+
<link rel="stylesheet" type="text/css" href="./style.css">
7+
</head>
8+
<body>
9+
<header>
10+
<img src="http://images.plot.ly/logo/plotlyjs-logo@2x.png" onClick="Tabs.reload();" />
11+
<span id="reload-time"></span>
12+
13+
<input id="mocks-search" type="text" placeholder="mocks search" />
14+
<input id="css-transform" type="text" placeholder="css transform" />
15+
</header>
16+
17+
<section id="mocks-list"></section>
18+
19+
<p>MathJax $V^3$ with $chtml$ output on the page and <b>svg</b> output on the plotly graphs</p>
20+
<div id="plots">
21+
<div id="graph"></div>
22+
</div>
23+
<div id="snapshot"></div>
24+
25+
<script>
26+
window.MathJax = window.MathJax || {
27+
// see https://github.com/mathjax/MathJax/issues/2705#issuecomment-859742446
28+
loader: {load: ['output/svg']},
29+
startup: {
30+
ready() {
31+
// Get the MathJax modules that we need.
32+
const {mathjax} = MathJax._.mathjax;
33+
const {SVG} = MathJax._.output.svg_ts;
34+
35+
// Do the normal setup
36+
MathJax.startup.defaultReady();
37+
38+
// Create an SVG output jax and a new MathDocument that uses it.
39+
const svgOutput = new SVG(MathJax.config.svg);
40+
const svgDocument = mathjax.document(document, {
41+
...MathJax.config.options,
42+
InputJax: MathJax.startup.input,
43+
OutputJax: svgOutput
44+
});
45+
46+
// Define the SVG-based conversion methods
47+
MathJax.tex2svg = (math, options = {}) => {
48+
options.format = svgDocument.inputJax[0].name;
49+
return svgDocument.convert(math, options);
50+
};
51+
/*
52+
MathJax.tex2svgPromise = (math, options = {}) => {
53+
options.format = svgDocument.inputJax[0].name;
54+
return mathjax.handleRetriesFor(() => svgDocument.convert(math, options));
55+
};
56+
*/
57+
MathJax.svgStylesheet = () => svgOutput.styleSheet(svgDocument);
58+
}
59+
}
60+
};
61+
</script>
62+
<script src="../../node_modules/mathjax-v3/es5/tex-chtml.js"></script>
63+
64+
<script charset="utf-8" id="source" src="../../build/plotly.js" type="module"></script>
65+
<script charset="utf-8" src="../../build/test_dashboard-bundle.js"></script>
66+
</body>
67+
</html>

devtools/test_dashboard/index-strict.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</div>
2323
<div id="snapshot"></div>
2424

25-
<script src="../../node_modules/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
25+
<script src="../../node_modules/mathjax-v2/MathJax.js?config=TeX-AMS-MML_SVG"></script>
2626
<script charset="utf-8" id="source" src="../../build/plotly.js"></script>
2727
<script charset="utf-8" src="../../build/test_dashboard-bundle.js"></script>
2828
</body>

devtools/test_dashboard/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
</div>
2121
<div id="snapshot"></div>
2222

23-
<script src="../../node_modules/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
24-
<script charset="utf-8" id="source" type="module">import "../../build/plotly.js"</script>
23+
<script src="../../node_modules/mathjax-v2/MathJax.js?config=TeX-AMS-MML_SVG"></script>
24+
<script charset="utf-8" id="source" src="../../build/plotly.js" type="module"></script>
2525
<script charset="utf-8" src="../../build/test_dashboard-bundle.js"></script>
2626
</body>
2727
</html>

devtools/test_dashboard/server.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ var shortcutPaths = require('../../tasks/util/shortcut_paths');
1313
var args = minimist(process.argv.slice(2), {});
1414
var PORT = args.port || 3000;
1515
var strict = args.strict;
16+
var mathjax3 = args.mathjax3;
17+
var mathjax3chtml = args.mathjax3chtml;
1618

1719
// Create server
1820
var server = http.createServer(ecstatic({
@@ -25,7 +27,11 @@ var server = http.createServer(ecstatic({
2527
// Make watchified bundle for plotly.js
2628
var bundlePlotly = makeWatchifiedBundle(strict, function() {
2729
// open up browser window on first bundle callback
28-
open('http://localhost:' + PORT + '/devtools/test_dashboard/index' + (strict ? '-strict' : '') + '.html');
30+
open('http://localhost:' + PORT + '/devtools/test_dashboard/index' + (
31+
strict ? '-strict' :
32+
mathjax3 ? '-mathjax3' :
33+
mathjax3chtml ? '-mathjax3chtml' : ''
34+
) + '.html');
2935
});
3036

3137
// Bundle devtools code

0 commit comments

Comments
 (0)