Skip to content

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

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

docs: Add plotly.js v4 migration guide#455
camdecoster wants to merge 27 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/basic/sankey/2026-08-04-sankey-direction.html Outdated
Comment thread _posts/plotly_js/basic/sankey/2026-08-04-sankey-direction.html Outdated
Comment thread _posts/plotly_js/fundamentals/static-image-export/2016-05-20-static-image.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 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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think that will be clear if they click on the link.

Comment thread _posts/plotly_js/scientific/quiver/2026-08-04-quiver_plotly_js_index.html Outdated
- 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).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think you'd understand if you reviewed some of the tutorials this statement is referencing.

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

camdecoster and others added 2 commits August 10, 2026 12:11
Co-authored-by: Emily KL <4672118+emilykl@users.noreply.github.com>
Co-authored-by: Emily KL <4672118+emilykl@users.noreply.github.com>
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
Contributor Author

Choose a reason for hiding this comment

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

I think that will be clear if they click on the link.

- 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
Contributor Author

Choose a reason for hiding this comment

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

I think you'd understand if you reviewed some of the tutorials this statement is referencing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This isn't actually a rename, but git is seeing it that way. 🤷

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This isn't actually a rename, but git is seeing it that way. 🤷

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