Skip to content

Commit 71a2ff7

Browse files
authored
Merge pull request #7987 from plotly/release-v4.0.0
chore: Release v4.0.0
2 parents b7516d7 + e020cc0 commit 71a2ff7

71 files changed

Lines changed: 201802 additions & 176747 deletions

Some content is hidden

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

CHANGELOG.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,75 @@ 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+
## [X.Y.Z] -- UNRELEASED
13+
14+
15+
## [4.0.0] -- 2026-08-24
16+
17+
### Added
18+
- Add `minscale`, `maxscale` geo plot attributes [[#7371](https://github.com/plotly/plotly.js/pull/7371)], with thanks to @mojoaxel for the contribution!
19+
- Enable TypeScript compatibility within the library and start exporting types [[#7680](https://github.com/plotly/plotly.js/pull/7680)]
20+
- Add `quiver` trace type to visualize vector fields using arrows [[#7710](https://github.com/plotly/plotly.js/pull/7710), [#7945](https://github.com/plotly/plotly.js/issues/7945)], with thanks to @degzhaus for the contribution!
21+
- Use dashed markers in legend for shape traces with dash configured [[#7845](https://github.com/plotly/plotly.js/pull/7845)]
22+
- Add `direction` attribute to the Sankey trace, controlling the flow direction along the `orientation` axis [[#7870](https://github.com/plotly/plotly.js/pull/7870)], with thanks to @wf-r for the contribution!
23+
- `forward` keeps sources on the left (horizontal) or top (vertical)
24+
- `reversed` moves them to the right or bottom
25+
- Add `sort` option to Sankey links and nodes [[#7873](https://github.com/plotly/plotly.js/pull/7873)], with thanks to @adamreeve for the contribution!
26+
- Add support for MathJax v4 [[#7898](https://github.com/plotly/plotly.js/pull/7898)]
27+
- Add top-level `xPixel` and `yPixel` keys to hover and click event data, corresponding to the pixel position of the cursor relative to the top-left corner of the graph div [[#7966](https://github.com/plotly/plotly.js/pull/7966)]
28+
- When `hoveranywhere` is enabled, emit a `plotly_unhover` event when the cursor leaves the plot area [[#7966](https://github.com/plotly/plotly.js/pull/7966)]
29+
30+
### Removed
31+
- **Breaking**: Remove `scattermapbox`, `choroplethmapbox`, `densitymapbox` trace types, the `mapbox` subplot, and the `mapboxAccessToken` config option [[#7860](https://github.com/plotly/plotly.js/pull/7860)]
32+
- These traces have been deprecated since v3. Use the equivalent `*map` traces going forward.
33+
- **Breaking**: Drop support for MathJax v2 [[#7898](https://github.com/plotly/plotly.js/pull/7898)]
34+
- MathJax v3 and v4 are now supported in plotly.js
35+
- Remove config attributes `showLink`, `linkText`, `sendData`, `showSources`, and `showEditInChartStudio`, as well as trace attribute `stream`, since all of these were associated with Chart Studio and are no longer needed [[#7812](https://github.com/plotly/plotly.js/pull/7812)]
36+
- Remove all `*src` attributes, as well as `layout.hidesources` attribute, from the schema [[#7829](https://github.com/plotly/plotly.js/pull/7829)]
37+
- Remove internal `trace._fullInput` property and other dead code related to the removed `transforms` feature. No user-facing changes expected [[#7834](https://github.com/plotly/plotly.js/pull/7834)]
38+
39+
### Changed
40+
- **Breaking**: Switch color processing library from [TinyColor](https://github.com/bgrins/TinyColor) to [culori](https://culorijs.org) [[#7536](https://github.com/plotly/plotly.js/pull/7536)], [#7962](https://github.com/plotly/plotly.js/pull/7962)]
41+
- `rgb()`/`rgba()` strings with decimal 0–1 fractions are no longer interpreted as percentage values (relative to 255)
42+
- `hsv()` color strings are no longer permitted
43+
- New color formats are now supported: `#ff0000aa`, `#f00a`, `rgb(255 0 0)`, `rgba(255 0 0 / 0.5)`, `hsl(0 100% 50% / 0.5)`, `hsla(0, 100%, 50%, 0.5)`, `lab()`, `lch()`, `oklab()`, `oklch()`, `color()`, `hsl(0.5turn 60% 40%)`, `hsl(none 60% 40%)`
44+
- `rgb()` now accepts an optional alpha, so `rgb(255, 0, 0, 0.5)` is no longer opaque (`rgb` and `rgba` are aliases per [spec](https://www.w3.org/TR/css-color-4/#changes-from-3))
45+
- Color strings that are not valid CSS are now rejected, such as `hsl(120, 50% 50%)`
46+
- Contrasting text and border colors are picked by WCAG contrast ratio, so labels on saturated mid-tone fills may switch from dark to white
47+
- **Breaking**: Set default `layout.axis.tickmode` to `'sync'` when axis is overlaying [[#7684](https://github.com/plotly/plotly.js/pull/7684)]
48+
- **Breaking**: Change `splom.axis.matches` default from `false` to `true` [[#7843](https://github.com/plotly/plotly.js/pull/7843)]
49+
- **Breaking**: Replace `country-regex` with `country-iso-search` to search for country names in choropleth, scattergeo traces [[#7856](https://github.com/plotly/plotly.js/pull/7856)]
50+
- The vast majority of country names are handled exactly the same with the new library; a small number of legacy entries have been removed
51+
- **Breaking**: Update minimum required Node version to 22 [[#7861](https://github.com/plotly/plotly.js/pull/7861)]
52+
- **Breaking:** Change `layout.geo.fitbounds` default from `false` to `'locations'` [[#7895](https://github.com/plotly/plotly.js/pull/7895)]
53+
- `geo` subplots will now auto-fit the initial view to the trace data
54+
- Set `fitbounds: false` explicitly to opt out
55+
- **Breaking**: Return actual data values (rather than calcdata values) for `xvals` / `yvals` in `hoveranywhere` and `clickanywhere` events. Date and category axes will now return strings rather than numeric values. Linear and log axis values remain unchanged. [[#7964](https://github.com/plotly/plotly.js/pull/7964)]
56+
- Enable `scattermap` icons to render in color, upgrade Maki icons version to 8.2, and standardize scattermap legend icons to circles [[#7825](https://github.com/plotly/plotly.js/pull/7825)]
57+
- Use plot title as default filename for "Download plot" button [[#7828](https://github.com/plotly/plotly.js/pull/7828)]
58+
- Change signature of `plots.graphJson()` function to remove `mode` argument [[#7829](https://github.com/plotly/plotly.js/pull/7829)]
59+
- Upgrade `plotly/d3-sankey` to 0.12.3. [[#7830](https://github.com/plotly/plotly.js/pull/7830)], with thanks to @adamreeve for the contribution!
60+
- Update `plot_config` to show the "Upload to Cloud" button by default, and set the default server URL to cloud.plotly.com via [[#7909](https://github.com/plotly/plotly.js/pull/7909)]
61+
- Update "Share chart" dialog with more informative wording [[#7928](https://github.com/plotly/plotly.js/pull/7928)]
62+
63+
### Fixed
64+
- Fix `histogram` autobin size for single-point traces in `overlay` mode on data updates via `Plotly.react` [[#7507](https://github.com/plotly/plotly.js/pull/7507)], with thanks to @Lexachoc for the contribution!
65+
- Format tick labels correctly for small numbers in exponential notation [[#7768](https://github.com/plotly/plotly.js/pull/7768)], with thanks to @Hasnaathussain for the contribution!
66+
- Defer automargin during scroll-wheel zoom, to prevent erratic jittering while zooming [[#7815](https://github.com/plotly/plotly.js/pull/7815)], with thanks to @keilogic for the contribution!
67+
- Fix crash when ordering categories by value (e.g. `sum descending`) with `null` coordinates [[#7855](https://github.com/plotly/plotly.js/pull/7855)]
68+
- Prevent outside bar text for zero-length bars from overlapping axis tick labels [[#7872](https://github.com/plotly/plotly.js/pull/7872)], with thanks to @vizansh for the contribution!
69+
- Fix `scattermap`, `densitymap` traces not showing all points by dynamically computing `center`, `zoom` values [[#7884](https://github.com/plotly/plotly.js/pull/7884), [#7913](https://github.com/plotly/plotly.js/pull/7913)], with thanks to @palmerusaf and @DhruvGarg111 for the contributions!
70+
- Fix GeoJSON bounding-box computation for `choropleth` and `scattergeo` traces whose geometry crosses the antimeridian [[#7891](https://github.com/plotly/plotly.js/pull/7891)]
71+
- Fix `hovertemplate`/`texttemplate`/`tickformat`/`hoverformat` improperly handling d3-format specs that start with a sign flag such as `+.2f` [[#7900](https://github.com/plotly/plotly.js/pull/7900)], with thanks to @TemRevil for the contribution!
72+
- Snap cartesian axis tick values to multiple of delta so custom `tickformat` (e.g. `"~r"`) no longer shows floating-point artifacts [[#7901](https://github.com/plotly/plotly.js/pull/7901)], with thanks to @arieleli01212 and @kirthi-b for the contribution!
73+
- Fix `scattermap` box and lasso selection across the antimeridian [[#7905](https://github.com/plotly/plotly.js/pull/7905)], with thanks to @coyaSONG for the contribution!
74+
- Fix crash ("Something went wrong with axis scaling") when a colorbar's title or padding leaves it with a negative domain length [[#7908](https://github.com/plotly/plotly.js/pull/7908)], with thanks to @zeehio for the contribution!
75+
- Prevent MultiPolygon features with no positive-area polygon from aborting choropleth rendering [[#7921](https://github.com/plotly/plotly.js/pull/7921)], with thanks to @swjturay for the contribution!
76+
- Fix `geo.fitbounds: 'locations'` when mixing antimeridian-crossing territories with normal ones [[#7948](https://github.com/plotly/plotly.js/pull/7948)]
77+
- Fix issue where plot fails to render if unsupported MathJax version is present on page [[#7951](https://github.com/plotly/plotly.js/pull/7951)]
78+
- Fix numeric color sorting for bundled parallel-categories (parcats) paths [[#7959](https://github.com/plotly/plotly.js/pull/7959)], with thanks to @CAOShurong for the contribution!
79+
80+
1281
## [4.0.0-rc.0] -- 2026-07-21
1382

1483
### Added

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ authors:
99
- family-names: "Samimi"
1010
given-names: "Mojtaba"
1111
title: "Open source Plotly charting library"
12-
version: 3.7.0
12+
version: 4.0.0
1313
doi: 10.5281/zenodo.13964707
14-
date-released: 2026-07-03
14+
date-released: 2026-08-24
1515
url: "https://github.com/plotly/plotly.js"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo
6262
6363
```html
6464
<head>
65-
<script src="https://cdn.plot.ly/plotly-3.7.0.min.js" charset="utf-8"></script>
65+
<script src="https://cdn.plot.ly/plotly-4.0.0.min.js" charset="utf-8"></script>
6666
</head>
6767
<body>
6868
<div id="gd"></div>
@@ -79,7 +79,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo
7979
Alternatively, you may consider using [native ES6 import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) in the script tag.
8080
```html
8181
<script type="module">
82-
import "https://cdn.plot.ly/plotly-3.7.0.min.js"
82+
import "https://cdn.plot.ly/plotly-4.0.0.min.js"
8383
Plotly.newPlot("gd", [{ y: [1, 2, 3] }])
8484
</script>
8585
```
@@ -89,7 +89,7 @@ Fastly supports Plotly.js with free CDN service. Read more at <https://www.fastl
8989
### Un-minified versions are also available on CDN
9090
While non-minified source files may contain characters outside UTF-8, it is recommended that you specify the `charset` when loading those bundles.
9191
```html
92-
<script src="https://cdn.plot.ly/plotly-3.7.0.js" charset="utf-8"></script>
92+
<script src="https://cdn.plot.ly/plotly-4.0.0.js" charset="utf-8"></script>
9393
```
9494

9595
> 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.

dist/README.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ The main plotly.js bundles weight in at:
4343

4444
| plotly.js | plotly.min.js | plotly.min.js + gzip | plotly-with-meta.js |
4545
|-----------|---------------|----------------------|---------------------|
46-
| 8.9 MB | 3.9 MB | 1.2 MB | 9.3 MB |
46+
| 9.65 MB | 4.29 MB | 1.33 MB | 10 MB |
4747

4848
#### CDN links
49-
> https://cdn.plot.ly/plotly-4.0.0-rc.0.js
49+
> https://cdn.plot.ly/plotly-4.0.0.js
5050
51-
> https://cdn.plot.ly/plotly-4.0.0-rc.0.min.js
51+
> https://cdn.plot.ly/plotly-4.0.0.min.js
5252
5353

5454
#### npm packages
@@ -91,12 +91,12 @@ The `basic` partial bundle contains trace modules `bar`, `pie` and `scatter`.
9191

9292
| Raw size | Minified size | Minified + gzip size |
9393
|------|-----------------|------------------------|
94-
| 2.7 MB | 1.1 MB | 369.7 kB |
94+
| 2.93 MB | 1.18 MB | 397 kB |
9595

9696
#### CDN links
97-
> https://cdn.plot.ly/plotly-basic-4.0.0-rc.0.js
97+
> https://cdn.plot.ly/plotly-basic-4.0.0.js
9898
99-
> https://cdn.plot.ly/plotly-basic-4.0.0-rc.0.min.js
99+
> https://cdn.plot.ly/plotly-basic-4.0.0.min.js
100100
101101

102102
#### npm packages
@@ -114,12 +114,12 @@ The `cartesian` partial bundle contains trace modules `bar`, `box`, `contour`, `
114114

115115
| Raw size | Minified size | Minified + gzip size |
116116
|------|-----------------|------------------------|
117-
| 3.4 MB | 1.4 MB | 468.6 kB |
117+
| 3.69 MB | 1.48 MB | 498 kB |
118118

119119
#### CDN links
120-
> https://cdn.plot.ly/plotly-cartesian-4.0.0-rc.0.js
120+
> https://cdn.plot.ly/plotly-cartesian-4.0.0.js
121121
122-
> https://cdn.plot.ly/plotly-cartesian-4.0.0-rc.0.min.js
122+
> https://cdn.plot.ly/plotly-cartesian-4.0.0.min.js
123123
124124

125125
#### npm packages
@@ -137,12 +137,12 @@ The `geo` partial bundle contains trace modules `choropleth`, `scatter` and `sca
137137

138138
| Raw size | Minified size | Minified + gzip size |
139139
|------|-----------------|------------------------|
140-
| 3.1 MB | 1.3 MB | 435.1 kB |
140+
| 3.37 MB | 1.38 MB | 466 kB |
141141

142142
#### CDN links
143-
> https://cdn.plot.ly/plotly-geo-4.0.0-rc.0.js
143+
> https://cdn.plot.ly/plotly-geo-4.0.0.js
144144
145-
> https://cdn.plot.ly/plotly-geo-4.0.0-rc.0.min.js
145+
> https://cdn.plot.ly/plotly-geo-4.0.0.min.js
146146
147147

148148
#### npm packages
@@ -160,12 +160,12 @@ The `gl3d` partial bundle contains trace modules `cone`, `isosurface`, `mesh3d`,
160160

161161
| Raw size | Minified size | Minified + gzip size |
162162
|------|-----------------|------------------------|
163-
| 4.2 MB | 1.6 MB | 532.5 kB |
163+
| 4.51 MB | 1.74 MB | 560 kB |
164164

165165
#### CDN links
166-
> https://cdn.plot.ly/plotly-gl3d-4.0.0-rc.0.js
166+
> https://cdn.plot.ly/plotly-gl3d-4.0.0.js
167167
168-
> https://cdn.plot.ly/plotly-gl3d-4.0.0-rc.0.min.js
168+
> https://cdn.plot.ly/plotly-gl3d-4.0.0.min.js
169169
170170

171171
#### npm packages
@@ -183,12 +183,12 @@ The `gl2d` partial bundle contains trace modules `parcoords`, `scatter`, `scatte
183183

184184
| Raw size | Minified size | Minified + gzip size |
185185
|------|-----------------|------------------------|
186-
| 3.9 MB | 1.5 MB | 526.5 kB |
186+
| 3.67 MB | 1.47 MB | 497 kB |
187187

188188
#### CDN links
189-
> https://cdn.plot.ly/plotly-gl2d-4.0.0-rc.0.js
189+
> https://cdn.plot.ly/plotly-gl2d-4.0.0.js
190190
191-
> https://cdn.plot.ly/plotly-gl2d-4.0.0-rc.0.min.js
191+
> https://cdn.plot.ly/plotly-gl2d-4.0.0.min.js
192192
193193

194194
#### npm packages
@@ -206,12 +206,12 @@ The `map` partial bundle contains trace modules `choroplethmap`, `densitymap`, `
206206

207207
| Raw size | Minified size | Minified + gzip size |
208208
|------|-----------------|------------------------|
209-
| 4.2 MB | 2 MB | 632.3 kB |
209+
| 4.9 MB | 2.42 MB | 733 kB |
210210

211211
#### CDN links
212-
> https://cdn.plot.ly/plotly-map-4.0.0-rc.0.js
212+
> https://cdn.plot.ly/plotly-map-4.0.0.js
213213
214-
> https://cdn.plot.ly/plotly-map-4.0.0-rc.0.min.js
214+
> https://cdn.plot.ly/plotly-map-4.0.0.min.js
215215
216216

217217
#### npm packages
@@ -229,12 +229,12 @@ The `finance` partial bundle contains trace modules `bar`, `candlestick`, `funne
229229

230230
| Raw size | Minified size | Minified + gzip size |
231231
|------|-----------------|------------------------|
232-
| 2.9 MB | 1.2 MB | 403.5 kB |
232+
| 3.18 MB | 1.28 MB | 431 kB |
233233

234234
#### CDN links
235-
> https://cdn.plot.ly/plotly-finance-4.0.0-rc.0.js
235+
> https://cdn.plot.ly/plotly-finance-4.0.0.js
236236
237-
> https://cdn.plot.ly/plotly-finance-4.0.0-rc.0.min.js
237+
> https://cdn.plot.ly/plotly-finance-4.0.0.min.js
238238
239239

240240
#### npm packages
@@ -252,12 +252,12 @@ The `strict` partial bundle contains trace modules `bar`, `barpolar`, `box`, `ca
252252

253253
| Raw size | Minified size | Minified + gzip size |
254254
|------|-----------------|------------------------|
255-
| 9.7 MB | 4.2 MB | 1.3 MB |
255+
| 10.5 MB | 4.64 MB | 1.43 MB |
256256

257257
#### CDN links
258-
> https://cdn.plot.ly/plotly-strict-4.0.0-rc.0.js
258+
> https://cdn.plot.ly/plotly-strict-4.0.0.js
259259
260-
> https://cdn.plot.ly/plotly-strict-4.0.0-rc.0.min.js
260+
> https://cdn.plot.ly/plotly-strict-4.0.0.min.js
261261
262262

263263
#### npm packages

0 commit comments

Comments
 (0)