plotly.js 2.9.0 → 2.10.0

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 (39) hide show
  1. package/.circleci/config.yml +39 -1
  2. package/.circleci/test.sh +14 -1
  3. package/CHANGELOG.md +11 -1
  4. package/CONTRIBUTING.md +1 -1
  5. package/README.md +12 -4
  6. package/dist/README.md +26 -26
  7. package/dist/plot-schema.json +98 -0
  8. package/dist/plotly-basic.js +174 -83
  9. package/dist/plotly-basic.min.js +3 -3
  10. package/dist/plotly-cartesian.js +174 -83
  11. package/dist/plotly-cartesian.min.js +4 -4
  12. package/dist/plotly-finance.js +174 -83
  13. package/dist/plotly-finance.min.js +3 -3
  14. package/dist/plotly-geo-assets.js +2 -2
  15. package/dist/plotly-geo.js +174 -83
  16. package/dist/plotly-geo.min.js +3 -3
  17. package/dist/plotly-gl2d.js +174 -83
  18. package/dist/plotly-gl2d.min.js +6 -6
  19. package/dist/plotly-gl3d.js +174 -83
  20. package/dist/plotly-gl3d.min.js +8 -8
  21. package/dist/plotly-mapbox.js +174 -83
  22. package/dist/plotly-mapbox.min.js +2 -2
  23. package/dist/plotly-strict.js +174 -83
  24. package/dist/plotly-strict.min.js +6 -6
  25. package/dist/plotly-with-meta.js +178 -83
  26. package/dist/plotly.js +174 -83
  27. package/dist/plotly.min.js +2 -2
  28. package/package.json +6 -3
  29. package/src/components/drawing/index.js +28 -24
  30. package/src/components/legend/style.js +10 -6
  31. package/src/lib/svg_text_utils.js +106 -21
  32. package/src/plot_api/plot_config.js +9 -0
  33. package/src/snapshot/tosvg.js +14 -25
  34. package/src/traces/scatter/attributes.js +2 -0
  35. package/src/traces/scatter/defaults.js +2 -0
  36. package/src/traces/scatter/plot.js +4 -4
  37. package/src/traces/scatter/style.js +1 -1
  38. package/src/version.js +1 -1
  39. package/tasks/noci_test.sh +1 -1
@@ -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
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,10 +9,20 @@ 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.0] -- 2022-03-04
13
+
14
+ ### Added
15
+ - Add support to use version 3 of MathJax and add `typesetMath` attribute to config [[#6073](https://github.com/plotly/plotly.js/pull/6073)],
16
+ with thanks to [Equinor](https://www.equinor.com) for sponsoring the related development!
17
+ - Add `fillpattern` options to `scatter` trace [[#6101](https://github.com/plotly/plotly.js/pull/6101)],
18
+ with thanks to @s417-lama for the contribution!
19
+
20
+
12
21
  ## [2.9.0] -- 2022-02-04
13
22
 
14
23
  ### Added
15
- - Implement `ticklabelstep` to reduce labels on 2D axes and colorbars [[#6088](https://github.com/plotly/plotly.js/pull/6088)]
24
+ - Implement `ticklabelstep` to reduce labels on 2D axes and colorbars [[#6088](https://github.com/plotly/plotly.js/pull/6088)],
25
+ this feature was anonymously sponsored: thank you to our sponsor!
16
26
 
17
27
  ### Changed
18
28
  - Display the version of plotly.js when hovering over the modebar [[#6077](https://github.com/plotly/plotly.js/pull/6077)]
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.9.0.min.js"></script>
58
+ <script src="https://cdn.plot.ly/plotly-2.10.0.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.9.0.min.js"
75
+ import "https://cdn.plot.ly/plotly-2.10.0.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.9.0.js" charset="utf-8"></script>
85
+ <script src="https://cdn.plot.ly/plotly-2.10.0.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.9.0.js
49
+ > https://cdn.plot.ly/plotly-2.10.0.js
50
50
 
51
- > https://cdn.plot.ly/plotly-2.9.0.min.js
51
+ > https://cdn.plot.ly/plotly-2.10.0.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 | 977.2 kB | 318.3 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.9.0.js
97
+ > https://cdn.plot.ly/plotly-basic-2.10.0.js
98
98
 
99
- > https://cdn.plot.ly/plotly-basic-2.9.0.min.js
99
+ > https://cdn.plot.ly/plotly-basic-2.10.0.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.3 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.9.0.js
120
+ > https://cdn.plot.ly/plotly-cartesian-2.10.0.js
121
121
 
122
- > https://cdn.plot.ly/plotly-cartesian-2.9.0.min.js
122
+ > https://cdn.plot.ly/plotly-cartesian-2.10.0.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.9 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.9.0.js
143
+ > https://cdn.plot.ly/plotly-geo-2.10.0.js
144
144
 
145
- > https://cdn.plot.ly/plotly-geo-2.9.0.min.js
145
+ > https://cdn.plot.ly/plotly-geo-2.10.0.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 | 481.1 kB |
163
+ | 3.9 MB | 1.5 MB | 481.3 kB |
164
164
 
165
165
  #### CDN links
166
- > https://cdn.plot.ly/plotly-gl3d-2.9.0.js
166
+ > https://cdn.plot.ly/plotly-gl3d-2.10.0.js
167
167
 
168
- > https://cdn.plot.ly/plotly-gl3d-2.9.0.min.js
168
+ > https://cdn.plot.ly/plotly-gl3d-2.10.0.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.7 kB |
186
+ | 4.4 MB | 1.8 MB | 571.9 kB |
187
187
 
188
188
  #### CDN links
189
- > https://cdn.plot.ly/plotly-gl2d-2.9.0.js
189
+ > https://cdn.plot.ly/plotly-gl2d-2.10.0.js
190
190
 
191
- > https://cdn.plot.ly/plotly-gl2d-2.9.0.min.js
191
+ > https://cdn.plot.ly/plotly-gl2d-2.10.0.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 | 515.1 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.9.0.js
212
+ > https://cdn.plot.ly/plotly-mapbox-2.10.0.js
213
213
 
214
- > https://cdn.plot.ly/plotly-mapbox-2.9.0.min.js
214
+ > https://cdn.plot.ly/plotly-mapbox-2.10.0.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 | 351 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.9.0.js
235
+ > https://cdn.plot.ly/plotly-finance-2.10.0.js
236
236
 
237
- > https://cdn.plot.ly/plotly-finance-2.9.0.min.js
237
+ > https://cdn.plot.ly/plotly-finance-2.10.0.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.9 kB |
255
+ | 7.7 MB | 3.2 MB | 959.2 kB |
256
256
 
257
257
  #### CDN links
258
- > https://cdn.plot.ly/plotly-strict-2.9.0.js
258
+ > https://cdn.plot.ly/plotly-strict-2.10.0.js
259
259
 
260
- > https://cdn.plot.ly/plotly-strict-2.9.0.min.js
260
+ > https://cdn.plot.ly/plotly-strict-2.10.0.min.js
261
261
 
262
262
 
263
263
  #### npm packages
@@ -365,6 +365,11 @@
365
365
  "noBlank": true,
366
366
  "valType": "string"
367
367
  },
368
+ "typesetMath": {
369
+ "description": "Determines whether math should be typeset or not, when MathJax (either v2 or v3) is present on the page.",
370
+ "dflt": true,
371
+ "valType": "boolean"
372
+ },
368
373
  "watermark": {
369
374
  "description": "watermark the images with the company's logo",
370
375
  "dflt": false,
@@ -42269,6 +42274,99 @@
42269
42274
  "editType": "style",
42270
42275
  "valType": "color"
42271
42276
  },
42277
+ "fillpattern": {
42278
+ "bgcolor": {
42279
+ "arrayOk": true,
42280
+ "description": "When there is no colorscale sets the color of background pattern fill. Defaults to a `marker.color` background when `fillmode` is *overlay*. Otherwise, defaults to a transparent background.",
42281
+ "editType": "style",
42282
+ "valType": "color"
42283
+ },
42284
+ "bgcolorsrc": {
42285
+ "description": "Sets the source reference on Chart Studio Cloud for `bgcolor`.",
42286
+ "editType": "none",
42287
+ "valType": "string"
42288
+ },
42289
+ "description": "Sets the pattern within the marker.",
42290
+ "editType": "style",
42291
+ "fgcolor": {
42292
+ "arrayOk": true,
42293
+ "description": "When there is no colorscale sets the color of foreground pattern fill. Defaults to a `marker.color` background when `fillmode` is *replace*. Otherwise, defaults to dark grey or white to increase contrast with the `bgcolor`.",
42294
+ "editType": "style",
42295
+ "valType": "color"
42296
+ },
42297
+ "fgcolorsrc": {
42298
+ "description": "Sets the source reference on Chart Studio Cloud for `fgcolor`.",
42299
+ "editType": "none",
42300
+ "valType": "string"
42301
+ },
42302
+ "fgopacity": {
42303
+ "description": "Sets the opacity of the foreground pattern fill. Defaults to a 0.5 when `fillmode` is *overlay*. Otherwise, defaults to 1.",
42304
+ "editType": "style",
42305
+ "max": 1,
42306
+ "min": 0,
42307
+ "valType": "number"
42308
+ },
42309
+ "fillmode": {
42310
+ "description": "Determines whether `marker.color` should be used as a default to `bgcolor` or a `fgcolor`.",
42311
+ "dflt": "replace",
42312
+ "editType": "style",
42313
+ "valType": "enumerated",
42314
+ "values": [
42315
+ "replace",
42316
+ "overlay"
42317
+ ]
42318
+ },
42319
+ "role": "object",
42320
+ "shape": {
42321
+ "arrayOk": true,
42322
+ "description": "Sets the shape of the pattern fill. By default, no pattern is used for filling the area.",
42323
+ "dflt": "",
42324
+ "editType": "style",
42325
+ "valType": "enumerated",
42326
+ "values": [
42327
+ "",
42328
+ "/",
42329
+ "\\",
42330
+ "x",
42331
+ "-",
42332
+ "|",
42333
+ "+",
42334
+ "."
42335
+ ]
42336
+ },
42337
+ "shapesrc": {
42338
+ "description": "Sets the source reference on Chart Studio Cloud for `shape`.",
42339
+ "editType": "none",
42340
+ "valType": "string"
42341
+ },
42342
+ "size": {
42343
+ "arrayOk": true,
42344
+ "description": "Sets the size of unit squares of the pattern fill in pixels, which corresponds to the interval of repetition of the pattern.",
42345
+ "dflt": 8,
42346
+ "editType": "style",
42347
+ "min": 0,
42348
+ "valType": "number"
42349
+ },
42350
+ "sizesrc": {
42351
+ "description": "Sets the source reference on Chart Studio Cloud for `size`.",
42352
+ "editType": "none",
42353
+ "valType": "string"
42354
+ },
42355
+ "solidity": {
42356
+ "arrayOk": true,
42357
+ "description": "Sets the solidity of the pattern fill. Solidity is roughly the fraction of the area filled by the pattern. Solidity of 0 shows only the background color without pattern and solidty of 1 shows only the foreground color without pattern.",
42358
+ "dflt": 0.3,
42359
+ "editType": "style",
42360
+ "max": 1,
42361
+ "min": 0,
42362
+ "valType": "number"
42363
+ },
42364
+ "soliditysrc": {
42365
+ "description": "Sets the source reference on Chart Studio Cloud for `solidity`.",
42366
+ "editType": "none",
42367
+ "valType": "string"
42368
+ }
42369
+ },
42272
42370
  "groupnorm": {
42273
42371
  "description": "Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used - including if `visible` is *legendonly* but not if it is `false`. Sets the normalization for the sum of this `stackgroup`. With *fraction*, the value of each trace at each location is divided by the sum of all trace values at that location. *percent* is the same but multiplied by 100 to show percentages. If there are multiple subplots, or multiple `stackgroup`s on one subplot, each will be normalized within its own set.",
42274
42372
  "dflt": "",