plotly.js 2.8.3 → 2.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/.circleci/config.yml +39 -1
  2. package/.circleci/env_image.sh +1 -1
  3. package/.circleci/test.sh +14 -1
  4. package/CHANGELOG.md +29 -0
  5. package/CONTRIBUTING.md +1 -1
  6. package/README.md +12 -4
  7. package/dist/README.md +26 -26
  8. package/dist/plot-schema.json +413 -0
  9. package/dist/plotly-basic.js +248 -92
  10. package/dist/plotly-basic.min.js +5 -5
  11. package/dist/plotly-cartesian.js +258 -93
  12. package/dist/plotly-cartesian.min.js +5 -5
  13. package/dist/plotly-finance.js +249 -92
  14. package/dist/plotly-finance.min.js +4 -4
  15. package/dist/plotly-geo-assets.js +3 -3
  16. package/dist/plotly-geo.js +248 -92
  17. package/dist/plotly-geo.min.js +4 -4
  18. package/dist/plotly-gl2d.js +297 -100
  19. package/dist/plotly-gl2d.min.js +8 -8
  20. package/dist/plotly-gl3d.js +298 -100
  21. package/dist/plotly-gl3d.min.js +4 -4
  22. package/dist/plotly-locale-cs.js +1 -1
  23. package/dist/plotly-locale-cy.js +1 -1
  24. package/dist/plotly-locale-de.js +1 -1
  25. package/dist/plotly-locale-es.js +1 -1
  26. package/dist/plotly-locale-fi.js +1 -1
  27. package/dist/plotly-locale-fr.js +1 -1
  28. package/dist/plotly-locale-it.js +1 -1
  29. package/dist/plotly-locale-ja.js +1 -1
  30. package/dist/plotly-locale-ko.js +1 -1
  31. package/dist/plotly-locale-pt-br.js +1 -1
  32. package/dist/plotly-locale-pt-pt.js +1 -1
  33. package/dist/plotly-locale-ru.js +1 -1
  34. package/dist/plotly-locale-sv.js +1 -1
  35. package/dist/plotly-locale-sw.js +1 -1
  36. package/dist/plotly-locale-uk.js +1 -1
  37. package/dist/plotly-locale-zh-cn.js +1 -1
  38. package/dist/plotly-mapbox.js +248 -92
  39. package/dist/plotly-mapbox.min.js +3 -3
  40. package/dist/plotly-strict.js +311 -101
  41. package/dist/plotly-strict.min.js +8 -8
  42. package/dist/plotly-with-meta.js +324 -101
  43. package/dist/plotly.js +312 -101
  44. package/dist/plotly.min.js +11 -11
  45. package/dist/translation-keys.txt +1 -1
  46. package/lib/locales/cs.js +1 -1
  47. package/lib/locales/cy.js +1 -1
  48. package/lib/locales/de.js +1 -1
  49. package/lib/locales/es.js +1 -1
  50. package/lib/locales/fi.js +1 -1
  51. package/lib/locales/fr.js +1 -1
  52. package/lib/locales/it.js +1 -1
  53. package/lib/locales/ja.js +1 -1
  54. package/lib/locales/ko.js +1 -1
  55. package/lib/locales/pt-br.js +1 -1
  56. package/lib/locales/pt-pt.js +1 -1
  57. package/lib/locales/ru.js +1 -1
  58. package/lib/locales/sv.js +1 -1
  59. package/lib/locales/sw.js +1 -1
  60. package/lib/locales/uk.js +1 -1
  61. package/lib/locales/zh-cn.js +1 -1
  62. package/package.json +16 -13
  63. package/src/components/colorbar/attributes.js +1 -0
  64. package/src/components/colorbar/draw.js +1 -0
  65. package/src/components/drawing/index.js +28 -24
  66. package/src/components/legend/draw.js +2 -1
  67. package/src/components/legend/style.js +10 -6
  68. package/src/components/modebar/modebar.js +7 -1
  69. package/src/lib/svg_text_utils.js +106 -21
  70. package/src/plot_api/plot_config.js +9 -0
  71. package/src/plots/cartesian/axes.js +47 -5
  72. package/src/plots/cartesian/layout_attributes.js +14 -0
  73. package/src/plots/cartesian/tick_label_defaults.js +8 -0
  74. package/src/plots/gl3d/layout/axis_defaults.js +1 -0
  75. package/src/plots/polar/layout_attributes.js +1 -0
  76. package/src/plots/smith/layout_defaults.js +1 -0
  77. package/src/plots/ternary/layout_attributes.js +1 -0
  78. package/src/snapshot/tosvg.js +14 -25
  79. package/src/traces/carpet/ab_defaults.js +1 -0
  80. package/src/traces/indicator/attributes.js +1 -0
  81. package/src/traces/scatter/attributes.js +2 -0
  82. package/src/traces/scatter/defaults.js +2 -0
  83. package/src/traces/scatter/plot.js +4 -4
  84. package/src/traces/scatter/style.js +1 -1
  85. package/src/version.js +1 -1
  86. package/stackgl_modules/index.js +49 -8
  87. package/stackgl_modules/package-lock.json +10 -10
  88. package/stackgl_modules/package.json +2 -2
  89. package/tasks/noci_test.sh +1 -1
  90. package/.vscode/launch.json +0 -0
@@ -89,7 +89,7 @@ jobs:
89
89
  environment:
90
90
  # Alaska time (arbitrary timezone to test date logic)
91
91
  TZ: "America/Anchorage"
92
- parallelism: 8
92
+ parallelism: 12
93
93
  working_directory: ~/plotly.js
94
94
  steps:
95
95
  - browser-tools/install-browser-tools: &browser-versions
@@ -216,6 +216,24 @@ jobs:
216
216
  name: Test MathJax on firefox-latest
217
217
  command: .circleci/test.sh mathjax-firefox82+
218
218
 
219
+ make-baselines-mathjax3:
220
+ docker:
221
+ - image: circleci/python:3.8.9
222
+ working_directory: ~/plotly.js
223
+ steps:
224
+ - attach_workspace:
225
+ at: ~/
226
+ - run:
227
+ name: Install kaleido, plotly.io and required fonts
228
+ command: .circleci/env_image.sh
229
+ - run:
230
+ name: Create mathjax v3 png files
231
+ command: .circleci/test.sh make-baselines-mathjax3
232
+ - persist_to_workspace:
233
+ root: ~/
234
+ paths:
235
+ - plotly.js
236
+
219
237
  make-baselines:
220
238
  parallelism: 4
221
239
  docker:
@@ -249,6 +267,20 @@ jobs:
249
267
  path: build
250
268
  destination: /
251
269
 
270
+ test-baselines-mathjax3:
271
+ docker:
272
+ - image: circleci/node:16.8.0
273
+ working_directory: ~/plotly.js
274
+ steps:
275
+ - attach_workspace:
276
+ at: ~/
277
+ - run:
278
+ name: Compare pixels of mathjax v3 baselines
279
+ command: .circleci/test.sh test-image-mathjax3
280
+ - store_artifacts:
281
+ path: build
282
+ destination: /
283
+
252
284
  make-exports:
253
285
  docker:
254
286
  - image: circleci/python:3.8.9
@@ -413,6 +445,12 @@ workflows:
413
445
  - flaky-no-gl-jasmine:
414
446
  requires:
415
447
  - install-and-cibuild
448
+ - make-baselines-mathjax3:
449
+ requires:
450
+ - install-and-cibuild
451
+ - test-baselines-mathjax3:
452
+ requires:
453
+ - make-baselines-mathjax3
416
454
  - make-baselines:
417
455
  requires:
418
456
  - install-and-cibuild
@@ -5,4 +5,4 @@ sudo python3 .circleci/download_google_fonts.py && \
5
5
  sudo cp -r .circleci/fonts/ /usr/share/ && \
6
6
  sudo fc-cache -f && \
7
7
  # install kaleido & plotly
8
- sudo python3 -m pip install kaleido==0.2.1 plotly==5.2.1 --progress-bar off
8
+ sudo python3 -m pip install kaleido==0.2.1 plotly==5.5.0 --progress-bar off
package/.circleci/test.sh CHANGED
@@ -75,7 +75,15 @@ case $1 in
75
75
  ;;
76
76
 
77
77
  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=$?
79
87
  exit $EXIT_STATE
80
88
  ;;
81
89
 
@@ -90,6 +98,11 @@ case $1 in
90
98
  exit $EXIT_STATE
91
99
  ;;
92
100
 
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
+
93
106
  source-syntax)
94
107
  npm run lint || EXIT_STATE=$?
95
108
  npm run test-syntax || EXIT_STATE=$?
package/CHANGELOG.md CHANGED
@@ -9,6 +9,35 @@ To see all merged commits on the master branch that will be part of the next plo
9
9
 
10
10
  where X.Y.Z is the semver of most recent plotly.js release.
11
11
 
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
+
12
41
  ## [2.8.3] -- 2021-12-20
13
42
 
14
43
  ### Fixed
package/CONTRIBUTING.md CHANGED
@@ -118,7 +118,7 @@ npm start
118
118
 
119
119
  This command bundles up the source files with source maps using
120
120
  [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
122
122
  dev plotly.js bundle update every time a source file is saved) and opens up a
123
123
  tab in your browser.
124
124
 
package/README.md CHANGED
@@ -55,7 +55,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo
55
55
 
56
56
  ```html
57
57
  <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>
59
59
  </head>
60
60
  <body>
61
61
  <div id="gd"></div>
@@ -72,7 +72,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo
72
72
  Alternatively you may consider using [native ES6 import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) in the script tag.
73
73
  ```html
74
74
  <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"
76
76
  Plotly.newPlot("gd", [{ y: [1, 2, 3] }])
77
77
  </script>
78
78
  ```
@@ -82,16 +82,24 @@ Fastly supports Plotly.js with free CDN service. Read more at <https://www.fastl
82
82
  ### Un-minified versions are also available on CDN
83
83
  While non-minified source files may contain characters outside UTF-8, it is recommended that you specify the `charset` when loading those bundles.
84
84
  ```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>
86
86
  ```
87
87
 
88
88
  > 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.
89
89
 
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:
91
91
  ```html
92
92
  <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG.js"></script>
93
93
  ```
94
94
 
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
+
95
103
  ## Bundles
96
104
  There are two kinds of plotly.js bundles:
97
105
  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).
package/dist/README.md CHANGED
@@ -46,9 +46,9 @@ The main plotly.js bundles weight in at:
46
46
  | 8.3 MB | 3.5 MB | 1 MB | 8.6 MB |
47
47
 
48
48
  #### CDN links
49
- > https://cdn.plot.ly/plotly-2.8.3.js
49
+ > https://cdn.plot.ly/plotly-2.10.1.js
50
50
 
51
- > https://cdn.plot.ly/plotly-2.8.3.min.js
51
+ > https://cdn.plot.ly/plotly-2.10.1.min.js
52
52
 
53
53
 
54
54
  #### npm packages
@@ -91,12 +91,12 @@ The `basic` partial bundle contains trace modules `bar`, `pie` and `scatter`.
91
91
 
92
92
  | Raw size | Minified size | Minified + gzip size |
93
93
  |------|-----------------|------------------------|
94
- | 2.7 MB | 976.6 kB | 318.1 kB |
94
+ | 2.7 MB | 977.9 kB | 318.5 kB |
95
95
 
96
96
  #### CDN links
97
- > https://cdn.plot.ly/plotly-basic-2.8.3.js
97
+ > https://cdn.plot.ly/plotly-basic-2.10.1.js
98
98
 
99
- > https://cdn.plot.ly/plotly-basic-2.8.3.min.js
99
+ > https://cdn.plot.ly/plotly-basic-2.10.1.min.js
100
100
 
101
101
 
102
102
  #### npm packages
@@ -114,12 +114,12 @@ The `cartesian` partial bundle contains trace modules `bar`, `box`, `contour`, `
114
114
 
115
115
  | Raw size | Minified size | Minified + gzip size |
116
116
  |------|-----------------|------------------------|
117
- | 3.3 MB | 1.2 MB | 391 kB |
117
+ | 3.3 MB | 1.2 MB | 391.5 kB |
118
118
 
119
119
  #### CDN links
120
- > https://cdn.plot.ly/plotly-cartesian-2.8.3.js
120
+ > https://cdn.plot.ly/plotly-cartesian-2.10.1.js
121
121
 
122
- > https://cdn.plot.ly/plotly-cartesian-2.8.3.min.js
122
+ > https://cdn.plot.ly/plotly-cartesian-2.10.1.min.js
123
123
 
124
124
 
125
125
  #### npm packages
@@ -137,12 +137,12 @@ The `geo` partial bundle contains trace modules `choropleth`, `scatter` and `sca
137
137
 
138
138
  | Raw size | Minified size | Minified + gzip size |
139
139
  |------|-----------------|------------------------|
140
- | 3 MB | 1.1 MB | 360.7 kB |
140
+ | 3.1 MB | 1.1 MB | 361.2 kB |
141
141
 
142
142
  #### CDN links
143
- > https://cdn.plot.ly/plotly-geo-2.8.3.js
143
+ > https://cdn.plot.ly/plotly-geo-2.10.1.js
144
144
 
145
- > https://cdn.plot.ly/plotly-geo-2.8.3.min.js
145
+ > https://cdn.plot.ly/plotly-geo-2.10.1.min.js
146
146
 
147
147
 
148
148
  #### npm packages
@@ -160,12 +160,12 @@ The `gl3d` partial bundle contains trace modules `cone`, `isosurface`, `mesh3d`,
160
160
 
161
161
  | Raw size | Minified size | Minified + gzip size |
162
162
  |------|-----------------|------------------------|
163
- | 3.9 MB | 1.5 MB | 480.8 kB |
163
+ | 3.9 MB | 1.5 MB | 482.2 kB |
164
164
 
165
165
  #### CDN links
166
- > https://cdn.plot.ly/plotly-gl3d-2.8.3.js
166
+ > https://cdn.plot.ly/plotly-gl3d-2.10.1.js
167
167
 
168
- > https://cdn.plot.ly/plotly-gl3d-2.8.3.min.js
168
+ > https://cdn.plot.ly/plotly-gl3d-2.10.1.min.js
169
169
 
170
170
 
171
171
  #### npm packages
@@ -183,12 +183,12 @@ The `gl2d` partial bundle contains trace modules `heatmapgl`, `parcoords`, `poin
183
183
 
184
184
  | Raw size | Minified size | Minified + gzip size |
185
185
  |------|-----------------|------------------------|
186
- | 4.4 MB | 1.8 MB | 571.5 kB |
186
+ | 4.4 MB | 1.8 MB | 572.8 kB |
187
187
 
188
188
  #### CDN links
189
- > https://cdn.plot.ly/plotly-gl2d-2.8.3.js
189
+ > https://cdn.plot.ly/plotly-gl2d-2.10.1.js
190
190
 
191
- > https://cdn.plot.ly/plotly-gl2d-2.8.3.min.js
191
+ > https://cdn.plot.ly/plotly-gl2d-2.10.1.min.js
192
192
 
193
193
 
194
194
  #### npm packages
@@ -206,12 +206,12 @@ The `mapbox` partial bundle contains trace modules `choroplethmapbox`, `densitym
206
206
 
207
207
  | Raw size | Minified size | Minified + gzip size |
208
208
  |------|-----------------|------------------------|
209
- | 4.3 MB | 1.7 MB | 514.9 kB |
209
+ | 4.3 MB | 1.7 MB | 515.4 kB |
210
210
 
211
211
  #### CDN links
212
- > https://cdn.plot.ly/plotly-mapbox-2.8.3.js
212
+ > https://cdn.plot.ly/plotly-mapbox-2.10.1.js
213
213
 
214
- > https://cdn.plot.ly/plotly-mapbox-2.8.3.min.js
214
+ > https://cdn.plot.ly/plotly-mapbox-2.10.1.min.js
215
215
 
216
216
 
217
217
  #### npm packages
@@ -229,12 +229,12 @@ The `finance` partial bundle contains trace modules `bar`, `candlestick`, `funne
229
229
 
230
230
  | Raw size | Minified size | Minified + gzip size |
231
231
  |------|-----------------|------------------------|
232
- | 2.9 MB | 1.1 MB | 350.8 kB |
232
+ | 2.9 MB | 1.1 MB | 351.2 kB |
233
233
 
234
234
  #### CDN links
235
- > https://cdn.plot.ly/plotly-finance-2.8.3.js
235
+ > https://cdn.plot.ly/plotly-finance-2.10.1.js
236
236
 
237
- > https://cdn.plot.ly/plotly-finance-2.8.3.min.js
237
+ > https://cdn.plot.ly/plotly-finance-2.10.1.min.js
238
238
 
239
239
 
240
240
  #### npm packages
@@ -252,12 +252,12 @@ The `strict` partial bundle contains trace modules `bar`, `barpolar`, `box`, `ca
252
252
 
253
253
  | Raw size | Minified size | Minified + gzip size |
254
254
  |------|-----------------|------------------------|
255
- | 7.7 MB | 3.2 MB | 958.7 kB |
255
+ | 7.7 MB | 3.2 MB | 960.1 kB |
256
256
 
257
257
  #### CDN links
258
- > https://cdn.plot.ly/plotly-strict-2.8.3.js
258
+ > https://cdn.plot.ly/plotly-strict-2.10.1.js
259
259
 
260
- > https://cdn.plot.ly/plotly-strict-2.8.3.min.js
260
+ > https://cdn.plot.ly/plotly-strict-2.10.1.min.js
261
261
 
262
262
 
263
263
  #### npm packages