Skip to content

docs: Add plotly.js v4 migration guide - #455

Open
camdecoster wants to merge 25 commits into
masterfrom
cam/add-v4-migration-guide
Open

docs: Add plotly.js v4 migration guide#455
camdecoster wants to merge 25 commits into
masterfrom
cam/add-v4-migration-guide

Conversation

@camdecoster

@camdecoster camdecoster commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

Creates a new Guides section, moves the v3 migration guide, and ddds the plotly.js v4 migration guide.

Closes plotly/plotly.js#7831.
Closes plotly/plotly.js#7841.

Changes

  • Creates Guides section
  • Moves/renames v3 migration guide
  • Adds v4 migration guide
  • Updates existing docs to reflect v4 changes
  • Adds new docs for new features

Testing

  • Be on this branch
  • Build the docs
  • Click around the Guides and make sure everything looks okay

Notes

  • The v3 guide was in the Fundamentals section, which doesn't really fit
  • I added a redirect for the old v3 guide link
  • The styles aren't great, but fixing that will be part of a different project

@camdecoster camdecoster changed the title docs: Add v4 migration guide docs: Add plotly.js v4 migration guide Jul 17, 2026
Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated

@ndrezn ndrezn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest adding some grouping by topic, like for example. Right now it's a just a long, ungrouped list so topics come and go back and forth.

Maybe something like:

  1. Environment & tooling

Setup-level changes that hit before you touch a figure.

  • Minimum Node.js version
  • TypeScript types
  1. Removed features

Things that are simply gone and need code deleted/renamed.

  • Chart Studio APIs removed
  • Mapbox traces and subplots removed (maybe could go in maps section? but it's top item).
  1. Dependency changes

Third-party library swaps whose output shifts even with identical input — the
"your figure looks slightly different and you didn't change anything" bucket.

  • Color library swap (tinycolor2 → color)
  • Country name lookup (country-regex → country-iso-search)
  • Sankey layout algorithm update
  1. Maps & geo

By far the biggest cluster — all the MapLibre/geo framing behavior.

  • Scattermap icon defaults
  • Map subplots auto-frame to data
  • Geo subplots auto-frame by default
  • Geo fitbounds framing for antimeridian features
  • Geo subplot zoom limits
  1. Cartesian & shapes

The remaining rendering-behavior changes that aren't map-related.

  • Shape legend marker outlines honor line.dash
  • Overlaying axis tickmode defaults to 'sync'

Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
`tickmode` continues to default to `'auto'` on the overlaying axis.
Sync'ing tick positions to category slots is almost never the intent.

### Opting out

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a sub header

/ `pitch` in the layout — auto-framing steps aside and preserves the
chosen view across further data changes.

### Opting out

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be one level deeper

Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
Comment on lines +623 to +629
### Antimeridian data

For data that straddles the antimeridian (points on both sides of ±180°),
the auto-frame picks the compact crossing range rather than the
long-way-around view. For example, `lon: [131.8855, -179]` frames as
`[131.8855, 181]` (a ~49° span across the antimeridian) instead of the
naive `[-179, 131.8855]` (~311° the wrong way).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Antimeridian data
For data that straddles the antimeridian (points on both sides of ±180°),
the auto-frame picks the compact crossing range rather than the
long-way-around view. For example, `lon: [131.8855, -179]` frames as
`[131.8855, 181]` (a ~49° span across the antimeridian) instead of the
naive `[-179, 131.8855]` (~311° the wrong way).
### Data that crosses the antimeridian
For data that straddles the antimeridian (points on both sides of ±180°, in the middle of the Pacific Ocean),
the auto-frame picks the compact crossing range rather than the
long-way-around view. For example, `lon: [131.8855, -179]` frames as
`[131.8855, 181]` (a ~49° span across the antimeridian) instead of the
naive `[-179, 131.8855]` (~311° the wrong way).

Would be nice to have a visual example here

Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
Comment thread _posts/plotly_js/guides/migrating-to-v4/2026-07-17-migrating-to-v4.md Outdated
Comment thread _posts/plotly_js/guides/whats-new-in-v4/2026-07-20-whats-new-in-v4.md Outdated
Comment thread _posts/plotly_js/guides/whats-new-in-v4/2026-07-20-whats-new-in-v4.md Outdated
Comment thread _posts/plotly_js/guides/whats-new-in-v4/2026-07-20-whats-new-in-v4.md Outdated
arrangement: horizontal
markdown_content: |
`direction` sets which way flows run along the `orientation` axis, so a diagram can be mirrored without reversing
your `link.source` and `link.target` data. The default, `'forward'`, puts sources first; `'reversed'` puts them last.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
your `link.source` and `link.target` data. The default, `'forward'`, puts sources first; `'reversed'` puts them last.
your `link.source` and `link.target` data. The default, `'forward'`, orders sources left-to-right when horizontal or top-to-bottom when vertical; `'reversed'` is the opposite.

`direction` sets which way flows run along the `orientation` axis, so a diagram can be mirrored without reversing
your `link.source` and `link.target` data. The default, `'forward'`, puts sources first; `'reversed'` puts them last.
Combined with `orientation` (`'h'` or `'v'`) this gives four layouts: sources on the left, right, top, or bottom.
Node labels stay upright in every combination — only the flow geometry mirrors.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Node labels stay upright in every combination — only the flow geometry mirrors.
Node labels stay upright in every combination — only the flow geometry is mirrored.

Comment on lines +11 to +12
chart's visibility. Clicking it first brings up a confirmation dialog naming the destination. A Plotly Cloud account
is required.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
chart's visibility. Clicking it first brings up a confirmation dialog naming the destination. A Plotly Cloud account
is required.
chart's visibility. A confirmation dialog is shown before sending the chart.
Sharing requires a Plotly Cloud account, which can be created during the sharing process.

is required.

The button is shown by default. Set `showSendToCloud: false` to hide it, or set `plotlyServerURL` to send charts to
a self-hosted or alternate server instead of the default `https://cloud.plotly.com/newchart`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
a self-hosted or alternate server instead of the default `https://cloud.plotly.com/newchart`.
an alternate URL instead of the default `https://cloud.plotly.com/newchart`.

Comment on lines +30 to +31
showSendToCloud: true,
plotlyServerURL: "https://cloud.plotly.com/newchart"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
showSendToCloud: true,
plotlyServerURL: "https://cloud.plotly.com/newchart"
// These config options match the defaults
showSendToCloud: true,
plotlyServerURL: "https://cloud.plotly.com/newchart"

The common image formats: 'PNG', 'JPG/JPEG' are supported. In addition, formats like 'EPS', 'SVG' and 'PDF' are also available for user with a Personal or Professional subscription. You can get more details on our [pricing page] (https://plotly.com/products/cloud/)

**Note:** It is important to note that any figures containing WebGL traces (i.e. of type scattergl, heatmapgl, contourgl, scatter3d, surface, mesh3d, scatterpolargl, cone, streamtube, splom, or parcoords) that are exported in a vector format like SVG, EPS or PDF will include encapsulated rasters instead of vectors for some parts of the image.
**Note:** It is important to note that any figures containing WebGL traces (i.e. of type scattergl, scatter3d, surface, mesh3d, scatterpolargl, cone, streamtube, splom, or parcoords) that are exported in a vector format like SVG, EPS or PDF will include encapsulated rasters instead of vectors for some parts of the image.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EPS export is no longer supported

Suggested change
**Note:** It is important to note that any figures containing WebGL traces (i.e. of type scattergl, scatter3d, surface, mesh3d, scatterpolargl, cone, streamtube, splom, or parcoords) that are exported in a vector format like SVG, EPS or PDF will include encapsulated rasters instead of vectors for some parts of the image.
**Note:** It is important to note that any figures containing WebGL traces (i.e. of type scattergl, scatter3d, surface, mesh3d, scatterpolargl, cone, streamtube, splom, or parcoords) that are exported in a vector format like SVG or PDF will include encapsulated rasters instead of vectors for some parts of the image.

Comment on lines +149 to +150
Clicking the button brings up a confirmation dialog, which names the destination
and offers **Cancel** and **Share**:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Clicking the button brings up a confirmation dialog, which names the destination
and offers **Cancel** and **Share**:
Clicking the button brings up a dialog confirming the sharing destination:

| Config option | Default | Purpose |
|---|---|---|
| `showSendToCloud` | `true` | Whether the "Share chart…" modebar button is rendered. |
| `plotlyServerURL` | `'https://cloud.plotly.com/newchart'` | The endpoint the button posts to. Override to point at a self-hosted or alternate server. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `plotlyServerURL` | `'https://cloud.plotly.com/newchart'` | The endpoint the button posts to. Override to point at a self-hosted or alternate server. |
| `plotlyServerURL` | `'https://cloud.plotly.com/newchart'` | The endpoint the button posts to. Override to point at an alternate server. |

---

<p>With the release of Plotly.js v2.35.0, we are introducing a new set of trace types for maps with tile underlays:</p>
<p>Plotly.js v2.35.0 introduced a set of trace types for maps with tile underlays:</p>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>Plotly.js v2.35.0 introduced a set of trace types for maps with tile underlays:</p>
<p>Plotly.js v2.35.0 introduced a new set of trace types for maps with tile underlays:</p>


<p>These traces replace the existing Mapbox traces, <code>Choroplethmapbox</code>, <code>Scattermapbox</code>,
<code>Densitymapbox</code>, but use <a href="https://maplibre.org">MapLibre</a> as the map renderer rather than
<p>These traces replace the Mapbox traces, <code>Choroplethmapbox</code>, <code>Scattermapbox</code>, and

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>These traces replace the Mapbox traces, <code>Choroplethmapbox</code>, <code>Scattermapbox</code>, and
<p>These traces replaced the Mapbox traces, <code>Choroplethmapbox</code>, <code>Scattermapbox</code>, and

Comment on lines +13 to +14
Matching ignores case, accents, and punctuation, so `'Cote d'Ivoire'`, `'Türkiye'`, and `'St. Kitts and Nevis'` all
resolve. See the library's

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be more useful here to give several examples which all resolve to the same country name (but with different case/accents/punctuation)

@@ -0,0 +1,37 @@
---
description: How to make a D3.js-based quiver plot in JavaScript. Quiver plots show a 2D vector field as an array of arrows.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: How to make a D3.js-based quiver plot in JavaScript. Quiver plots show a 2D vector field as an array of arrows.
description: How to make a quiver plot in JavaScript. Quiver plots show a 2D vector field as an array of arrows.

- avoid using random or dummy data as much as humanly possible! Should only be a last resort.
- upload data files to https://github.com/plotly/datasets as importing data rather than pasting a large chunk of data in the tutorial creates a cleaner example.
- use `var config = {mapboxAccessToken: "your access token"};` if your chart requires Mapbox authentication. `"your access token` will replaced by Plotly's private token at build time. In development mode, you will need to create a `_data/mapboxtoken.yml` file and paste Plotly's non-URL restricted Mapbox key into it. This is available in 1Password.
- map examples must not require an API key. The `map` traces (`scattermap`, `choroplethmap`, `densitymap`) use open tile providers, and the `mapboxAccessToken` config option was removed in Plotly.js v4. Keep the example's `layout.map.style` set to a built-in style name or to a keyless style URL, so the chart renders for everyone reading the page. If you want to document a provider that does need a key, put that URL in `markdown_content` as a code snippet for the reader to copy and add their own key to — don't put it in the example itself, where a placeholder key means the rendered chart has no tiles and a real key would be committed to a public repo.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to document a provider that does need a key, put that URL in markdown_content as a code snippet for the reader to copy and add their own key to — don't put it in the example itself, where a placeholder key means the rendered chart has no tiles and a real key would be committed to a public repo.

Not a huge deal, but I don't totally understand these instructions (maybe I would understand better if I worked more closely with the docs).

@emilykl

emilykl commented Aug 7, 2026

Copy link
Copy Markdown

@camdecoster I left a bunch of very minor comments on the new docs pages. Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update docs per v4 changes Add migration guide for v3 to v4

5 participants