Skip to content
Permalink
Browse files
Merge branch 'master' into regl-build-setup
  • Loading branch information
yujin-wu committed Mar 8, 2022
2 parents f8548e1 + c988437 commit 80f6f9e94f79cd109e796bdbb9eda8bf730696ff
Showing with 5,777 additions and 2,553 deletions.
  1. +39 −1 .circleci/config.yml
  2. +14 −1 .circleci/test.sh
  3. +29 −0 CHANGELOG.md
  4. +1 −1 CONTRIBUTING.md
  5. +12 −4 README.md
  6. +43 −0 devtools/test_dashboard/index-mathjax3.html
  7. +67 −0 devtools/test_dashboard/index-mathjax3chtml.html
  8. +1 −1 devtools/test_dashboard/index-strict.html
  9. +2 −2 devtools/test_dashboard/index.html
  10. +7 −1 devtools/test_dashboard/server.js
  11. +26 −26 dist/README.md
  12. +413 −0 dist/plot-schema.json
  13. +248 −92 dist/plotly-basic.js
  14. +5 −5 dist/plotly-basic.min.js
  15. +258 −93 dist/plotly-cartesian.js
  16. +5 −5 dist/plotly-cartesian.min.js
  17. +249 −92 dist/plotly-finance.js
  18. +4 −4 dist/plotly-finance.min.js
  19. +3 −3 dist/plotly-geo-assets.js
  20. +248 −92 dist/plotly-geo.js
  21. +4 −4 dist/plotly-geo.min.js
  22. +297 −100 dist/plotly-gl2d.js
  23. +8 −8 dist/plotly-gl2d.min.js
  24. +298 −100 dist/plotly-gl3d.js
  25. +4 −4 dist/plotly-gl3d.min.js
  26. +1 −1 dist/plotly-locale-cs.js
  27. +1 −1 dist/plotly-locale-cy.js
  28. +1 −1 dist/plotly-locale-de.js
  29. +1 −1 dist/plotly-locale-es.js
  30. +1 −1 dist/plotly-locale-fi.js
  31. +1 −1 dist/plotly-locale-fr.js
  32. +1 −1 dist/plotly-locale-it.js
  33. +1 −1 dist/plotly-locale-ja.js
  34. +1 −1 dist/plotly-locale-ko.js
  35. +1 −1 dist/plotly-locale-pt-br.js
  36. +1 −1 dist/plotly-locale-pt-pt.js
  37. +1 −1 dist/plotly-locale-ru.js
  38. +1 −1 dist/plotly-locale-sv.js
  39. +1 −1 dist/plotly-locale-sw.js
  40. +1 −1 dist/plotly-locale-uk.js
  41. +1 −1 dist/plotly-locale-zh-cn.js
  42. +248 −92 dist/plotly-mapbox.js
  43. +3 −3 dist/plotly-mapbox.min.js
  44. +311 −101 dist/plotly-strict.js
  45. +8 −8 dist/plotly-strict.min.js
  46. +324 −101 dist/plotly-with-meta.js
  47. +312 −101 dist/plotly.js
  48. +11 −11 dist/plotly.min.js
  49. +1 −1 dist/translation-keys.txt
  50. +0 −1 draftlogs/6077_change.md
  51. +768 −1,309 package-lock.json
  52. +16 −13 package.json
  53. +1 −0 src/components/colorbar/attributes.js
  54. +1 −0 src/components/colorbar/draw.js
  55. +28 −24 src/components/drawing/index.js
  56. +2 −1 src/components/legend/draw.js
  57. +10 −6 src/components/legend/style.js
  58. +106 −21 src/lib/svg_text_utils.js
  59. +9 −0 src/plot_api/plot_config.js
  60. +47 −5 src/plots/cartesian/axes.js
  61. +14 −0 src/plots/cartesian/layout_attributes.js
  62. +8 −0 src/plots/cartesian/tick_label_defaults.js
  63. +1 −0 src/plots/gl3d/layout/axis_defaults.js
  64. +1 −0 src/plots/polar/layout_attributes.js
  65. +1 −0 src/plots/smith/layout_defaults.js
  66. +1 −0 src/plots/ternary/layout_attributes.js
  67. +14 −25 src/snapshot/tosvg.js
  68. +1 −0 src/traces/carpet/ab_defaults.js
  69. +1 −0 src/traces/indicator/attributes.js
  70. +2 −0 src/traces/scatter/attributes.js
  71. +2 −0 src/traces/scatter/defaults.js
  72. +4 −4 src/traces/scatter/plot.js
  73. +1 −1 src/traces/scatter/style.js
  74. +1 −1 src/version.js
  75. +49 −8 stackgl_modules/index.js
  76. +10 −10 stackgl_modules/package-lock.json
  77. +2 −2 stackgl_modules/package.json
  78. +1 −1 tasks/noci_test.sh
  79. BIN test/image/baselines/date_axes-ticklabelstep.png
  80. BIN test/image/baselines/gl3d_alphahull5.png
  81. BIN test/image/baselines/h-colorbar05.png
  82. BIN test/image/baselines/indicator_attrs.png
  83. BIN test/image/baselines/legend-row-group-height.png
  84. BIN test/image/baselines/mathjax3___legend_mathjax_title_and_items.png
  85. BIN test/image/baselines/mathjax3___mathjax.png
  86. BIN test/image/baselines/mathjax3___parcats_grid_subplots.png
  87. BIN test/image/baselines/mathjax3___table_latex_multitrace_scatter.png
  88. BIN test/image/baselines/mathjax3___table_plain_birds.png
  89. BIN test/image/baselines/mathjax3___table_wrapped_birds.png
  90. BIN test/image/baselines/mathjax3___ternary-mathjax.png
  91. BIN test/image/baselines/pattern_bars.png
  92. BIN test/image/baselines/pattern_fgcolor_overlay_fillmode.png
  93. BIN test/image/baselines/period_positioning7.png
  94. BIN test/image/baselines/{z-pie_negative_values.png → pie_negative_values.png}
  95. BIN test/image/baselines/pie_textpad_radial.png
  96. BIN test/image/baselines/polar_ticks.png
  97. BIN test/image/baselines/scatter_fill_pattern.png
  98. BIN test/image/baselines/sunburst_packages_colorscale_novalue.png
  99. BIN test/image/baselines/ternary_array_styles.png
  100. +31 −12 test/image/compare_pixels_test.js
  101. +28 −8 test/image/make_baseline.js
  102. +23 −5 test/image/make_baseline.py
  103. +91 −0 test/image/mocks/date_axes-ticklabelstep.json
  104. +332 −0 test/image/mocks/gl3d_alphahull5.json
  105. +2 −0 test/image/mocks/h-colorbar05.json
  106. +1 −0 test/image/mocks/indicator_attrs.json
  107. +32 −0 test/image/mocks/legend-row-group-height.json
  108. +1 −0 test/image/mocks/period_positioning7.json
  109. 0 test/image/mocks/{z-pie_negative_values.json → pie_negative_values.json}
  110. +1 −0 test/image/mocks/polar_ticks.json
  111. +69 −0 test/image/mocks/scatter_fill_pattern.json
  112. +7 −0 test/image/mocks/ternary_array_styles.json
  113. +11 −0 test/jasmine/assets/load_script.js
  114. +88 −0 test/jasmine/bundle_tests/mathjax_config_test.js
  115. +17 −20 test/jasmine/bundle_tests/mathjax_test.js
  116. +9 −3 test/jasmine/karma.conf.js
  117. +413 −0 test/plot-schema.json
@@ -73,7 +73,7 @@ jobs:
environment:
# Alaska time (arbitrary timezone to test date logic)
TZ: "America/Anchorage"
parallelism: 8
parallelism: 12
working_directory: ~/plotly.js
steps:
- browser-tools/install-browser-tools: &browser-versions
@@ -200,6 +200,24 @@ jobs:
name: Test MathJax on firefox-latest
command: .circleci/test.sh mathjax-firefox82+

make-baselines-mathjax3:
docker:
- image: circleci/python:3.8.9
working_directory: ~/plotly.js
steps:
- attach_workspace:
at: ~/
- run:
name: Install kaleido, plotly.io and required fonts
command: .circleci/env_image.sh
- run:
name: Create mathjax v3 png files
command: .circleci/test.sh make-baselines-mathjax3
- persist_to_workspace:
root: ~/
paths:
- plotly.js

make-baselines:
parallelism: 4
docker:
@@ -233,6 +251,20 @@ jobs:
path: build
destination: /

test-baselines-mathjax3:
docker:
- image: circleci/node:16.8.0
working_directory: ~/plotly.js
steps:
- attach_workspace:
at: ~/
- run:
name: Compare pixels of mathjax v3 baselines
command: .circleci/test.sh test-image-mathjax3
- store_artifacts:
path: build
destination: /

make-exports:
docker:
- image: circleci/python:3.8.9
@@ -395,6 +427,12 @@ workflows:
- flaky-no-gl-jasmine:
requires:
- install-and-cibuild
- make-baselines-mathjax3:
requires:
- install-and-cibuild
- test-baselines-mathjax3:
requires:
- make-baselines-mathjax3
- make-baselines:
requires:
- install-and-cibuild
@@ -75,7 +75,15 @@ case $1 in
;;

mathjax-firefox82+)
./node_modules/karma/bin/karma start test/jasmine/karma.conf.js --FF --skip-tags=noFF82 --bundleTest=mathjax --nowatch || EXIT_STATE=$?
./node_modules/karma/bin/karma start test/jasmine/karma.conf.js --FF --bundleTest=mathjax --skip-tags=noFF82 --nowatch &&
./node_modules/karma/bin/karma start test/jasmine/karma.conf.js --FF --bundleTest=mathjax --mathjax3 --skip-tags=noFF82 --nowatch &&
./node_modules/karma/bin/karma start test/jasmine/karma.conf.js --FF --bundleTest=mathjax_config --mathjax3 --nowatch &&
./node_modules/karma/bin/karma start test/jasmine/karma.conf.js --FF --bundleTest=mathjax_config --nowatch || EXIT_STATE=$?
exit $EXIT_STATE
;;

make-baselines-mathjax3)
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=$?
exit $EXIT_STATE
;;

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

test-image-mathjax3)
node test/image/compare_pixels_test.js mathjax3 || { tar -cvf build/baselines.tar build/test_images/*.png ; exit 1 ; } || EXIT_STATE=$?
exit $EXIT_STATE
;;

source-syntax)
npm run lint || EXIT_STATE=$?
npm run test-syntax || EXIT_STATE=$?
@@ -9,6 +9,35 @@ To see all merged commits on the master branch that will be part of the next plo

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

## [2.10.1] -- 2022-03-08

### Fixed
- Fix `mesh3d` generation when `alphahull` is a positive number (regression introduced in 2.5.1) [[#6133](https://github.com/plotly/plotly.js/pull/6133)]


## [2.10.0] -- 2022-03-04

### Added
- Add support to use version 3 of MathJax and add `typesetMath` attribute to config [[#6073](https://github.com/plotly/plotly.js/pull/6073)],
with thanks to [Equinor](https://www.equinor.com) for sponsoring the related development!
- Add `fillpattern` options to `scatter` trace [[#6101](https://github.com/plotly/plotly.js/pull/6101)],
with thanks to @s417-lama for the contribution!


## [2.9.0] -- 2022-02-04

### Added
- Implement `ticklabelstep` to reduce labels on 2D axes and colorbars [[#6088](https://github.com/plotly/plotly.js/pull/6088)],
this feature was anonymously sponsored: thank you to our sponsor!

### Changed
- Display the version of plotly.js when hovering over the modebar [[#6077](https://github.com/plotly/plotly.js/pull/6077)]
- Various dependency updates as listed under [the v2.9.0 milestone](https://github.com/plotly/plotly.js/milestone/69?closed=1)

### Fixed
- Fix vertical spacing of legend items in horizontal mode [[#6094](https://github.com/plotly/plotly.js/pull/6094)]


## [2.8.3] -- 2021-12-20

### Fixed
@@ -118,7 +118,7 @@ npm start

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

@@ -55,7 +55,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo
```html
<head>
<script src="https://cdn.plot.ly/plotly-2.8.3.min.js"></script>
<script src="https://cdn.plot.ly/plotly-2.10.1.min.js"></script>
</head>
<body>
<div id="gd"></div>
@@ -72,7 +72,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo
Alternatively you may consider using [native ES6 import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) in the script tag.
```html
<script type="module">
import "https://cdn.plot.ly/plotly-2.8.3.min.js"
import "https://cdn.plot.ly/plotly-2.10.1.min.js"
Plotly.newPlot("gd", [{ y: [1, 2, 3] }])
</script>
```
@@ -82,16 +82,24 @@ Fastly supports Plotly.js with free CDN service. Read more at <https://www.fastl
### Un-minified versions are also available on CDN
While non-minified source files may contain characters outside UTF-8, it is recommended that you specify the `charset` when loading those bundles.
```html
<script src="https://cdn.plot.ly/plotly-2.8.3.js" charset="utf-8"></script>
<script src="https://cdn.plot.ly/plotly-2.10.1.js" charset="utf-8"></script>
```

> 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.
To support MathJax, you need to load version two of MathJax e.g. `v2.7.5` files from CDN or npm.
To support MathJax, you could load either version two or version three of MathJax files, for example:
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG.js"></script>
```

```html
<script src="https://cdn.jsdelivr.net/npm/mathjax@3.2.0/es5/tex-svg.js"></script>
```

> 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.
Please refer to `devtools/test_dashboard/index-mathjax3chtml.html` to see an example.

## Bundles
There are two kinds of plotly.js bundles:
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).
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<title>Plotly.js Devtools - MathJax v3 loaded with svg output</title>
<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"/>
<link rel="stylesheet" type="text/css" href="./style.css">
</head>
<body>
<header>
<img src="http://images.plot.ly/logo/plotlyjs-logo@2x.png" onClick="Tabs.reload();" />
<span id="reload-time"></span>

<input id="mocks-search" type="text" placeholder="mocks search" />
<input id="css-transform" type="text" placeholder="css transform" />
</header>

<section id="mocks-list"></section>

<p id="pWithMathJax">MathJax $V^3$ with $svg$ output on the page as well as plotly graphs</p>
<h4>no MathJax: Apple: $2, Orange: $3</h4>

<div id="plots">
<div id="graph"></div>
</div>
<div id="snapshot"></div>

<script>
window.MathJax = {
startup: {
elements: [
document.getElementById('pWithMathJax')
],
// typeset: false,
// in case the elements array is empty one could disable startup typeset
// https://docs.mathjax.org/en/latest/options/startup/startup.html#the-configuration-block
}
};
</script>
<script src="../../node_modules/mathjax-v3/es5/tex-svg.js"></script>
<script charset="utf-8" id="source" src="../../build/plotly.js" type="module"></script>
<script charset="utf-8" src="../../build/test_dashboard-bundle.js"></script>
</body>
</html>
@@ -0,0 +1,67 @@
<!DOCTYPE html>
<html>
<head>
<title>Plotly.js Devtools - MathJax v3 loaded with chtml output</title>
<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"/>
<link rel="stylesheet" type="text/css" href="./style.css">
</head>
<body>
<header>
<img src="http://images.plot.ly/logo/plotlyjs-logo@2x.png" onClick="Tabs.reload();" />
<span id="reload-time"></span>

<input id="mocks-search" type="text" placeholder="mocks search" />
<input id="css-transform" type="text" placeholder="css transform" />
</header>

<section id="mocks-list"></section>

<p>MathJax $V^3$ with $chtml$ output on the page and <b>svg</b> output on the plotly graphs</p>
<div id="plots">
<div id="graph"></div>
</div>
<div id="snapshot"></div>

<script>
window.MathJax = window.MathJax || {
// see https://github.com/mathjax/MathJax/issues/2705#issuecomment-859742446
loader: {load: ['output/svg']},
startup: {
ready() {
// Get the MathJax modules that we need.
const {mathjax} = MathJax._.mathjax;
const {SVG} = MathJax._.output.svg_ts;

// Do the normal setup
MathJax.startup.defaultReady();

// Create an SVG output jax and a new MathDocument that uses it.
const svgOutput = new SVG(MathJax.config.svg);
const svgDocument = mathjax.document(document, {
...MathJax.config.options,
InputJax: MathJax.startup.input,
OutputJax: svgOutput
});

// Define the SVG-based conversion methods
MathJax.tex2svg = (math, options = {}) => {
options.format = svgDocument.inputJax[0].name;
return svgDocument.convert(math, options);
};
/*
MathJax.tex2svgPromise = (math, options = {}) => {
options.format = svgDocument.inputJax[0].name;
return mathjax.handleRetriesFor(() => svgDocument.convert(math, options));
};
*/
MathJax.svgStylesheet = () => svgOutput.styleSheet(svgDocument);
}
}
};
</script>
<script src="../../node_modules/mathjax-v3/es5/tex-chtml.js"></script>

<script charset="utf-8" id="source" src="../../build/plotly.js" type="module"></script>
<script charset="utf-8" src="../../build/test_dashboard-bundle.js"></script>
</body>
</html>
@@ -22,7 +22,7 @@
</div>
<div id="snapshot"></div>

<script src="../../node_modules/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
<script src="../../node_modules/mathjax-v2/MathJax.js?config=TeX-AMS-MML_SVG"></script>
<script charset="utf-8" id="source" src="../../build/plotly.js"></script>
<script charset="utf-8" src="../../build/test_dashboard-bundle.js"></script>
</body>
@@ -20,8 +20,8 @@
</div>
<div id="snapshot"></div>

<script src="../../node_modules/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
<script charset="utf-8" id="source" type="module">import "../../build/plotly.js"</script>
<script src="../../node_modules/mathjax-v2/MathJax.js?config=TeX-AMS-MML_SVG"></script>
<script charset="utf-8" id="source" src="../../build/plotly.js" type="module"></script>
<script charset="utf-8" src="../../build/test_dashboard-bundle.js"></script>
</body>
</html>
@@ -13,6 +13,8 @@ var shortcutPaths = require('../../tasks/util/shortcut_paths');
var args = minimist(process.argv.slice(2), {});
var PORT = args.port || 3000;
var strict = args.strict;
var mathjax3 = args.mathjax3;
var mathjax3chtml = args.mathjax3chtml;

// Create server
var server = http.createServer(ecstatic({
@@ -25,7 +27,11 @@ var server = http.createServer(ecstatic({
// Make watchified bundle for plotly.js
var bundlePlotly = makeWatchifiedBundle(strict, function() {
// open up browser window on first bundle callback
open('http://localhost:' + PORT + '/devtools/test_dashboard/index' + (strict ? '-strict' : '') + '.html');
open('http://localhost:' + PORT + '/devtools/test_dashboard/index' + (
strict ? '-strict' :
mathjax3 ? '-mathjax3' :
mathjax3chtml ? '-mathjax3chtml' : ''
) + '.html');
});

// Bundle devtools code

0 comments on commit 80f6f9e

Please sign in to comment.