-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Updates for maplibre maps #4706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
a4a785e
remove mapbox reference
LiamConnors a913463
update to new map types
LiamConnors 76f6756
fix typo
LiamConnors 608d114
update choropleth for maplibre changes
LiamConnors 9dc8202
add new map types
LiamConnors 4a70af6
update density heatmaps + fix typo
LiamConnors 2e0f184
Update scattermapbox.md
LiamConnors 3b581e6
various updates for new map traces
LiamConnors b90f6ea
small edits
LiamConnors 8e2538d
update map layers doc
LiamConnors 671c80d
add stamen example
LiamConnors 4b382e3
updates for new maps
LiamConnors b849b38
add deprecation notice
LiamConnors 58b3e61
Update doc/python/scattermapbox.md
LiamConnors bce8097
fix code errors
LiamConnors fdae821
Update datashader.md
LiamConnors 022b995
Update filled-area-on-mapbox.md
LiamConnors 7983874
Update line-charts.md
LiamConnors 614e37e
Update doc/python/map-configuration.md
LiamConnors 31fde09
update symbol
LiamConnors ef80408
Update heatmaps.md
LiamConnors 8fcb2bf
Update hover-text-and-formatting.md
LiamConnors fa931e4
Update hover-text-and-formatting.md
LiamConnors 1ffb776
add links
LiamConnors 10c5104
Merge branch 'master' into maplibre-tests
LiamConnors 155f434
add map to doc/apidoc/plotly.express.rst
archmoj 72bacb5
new map subplots & traces to px, etc.
archmoj ba9c413
update plotly.js v2.34.0-327-g056799dfc
archmoj e994f13
Update doc/python/mapbox-density-heatmaps.md
LiamConnors b7aff21
Update doc/python/mapbox-density-heatmaps.md
LiamConnors b0c45b3
Add migration guide
ndrezn e243e6d
Update packages/python/plotly/plotly/express/_doc.py
archmoj 7e2eefc
update descriptions
archmoj 8872f0b
Update doc/python/figure-structure.md
LiamConnors 792a5e9
Update doc/python/migrate-to-maplibre.md
ndrezn af83303
Update doc/python/migrate-to-maplibre.md
ndrezn 376c6db
Remove redirect
ndrezn fd12157
Update doc/python/axes.md
LiamConnors 2bd7dc6
Add perma links for style comparisons
ndrezn 4fc6d81
Revert "update plotly.js v2.34.0-327-g056799dfc"
LiamConnors 24730c3
Merge pull request #4726 from plotly/maplibre-tests_with-px
LiamConnors 38afbf0
Merge branch 'master' into maplibre-tests
LiamConnors a1c7f88
Merge branch 'master' into maplibre-tests
LiamConnors f34d599
fix metadata
LiamConnors 65d97a0
Merge branch 'maplibre-tests' of https://github.com/plotly/plotly.py …
LiamConnors File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
jupyter: | ||
jupytext: | ||
notebook_metadata_filter: all | ||
text_representation: | ||
extension: .md | ||
format_name: markdown | ||
format_version: '1.3' | ||
jupytext_version: 1.16.1 | ||
kernelspec: | ||
display_name: Python 3 (ipykernel) | ||
language: python | ||
name: python3 | ||
language_info: | ||
codemirror_mode: | ||
name: ipython | ||
version: 3 | ||
file_extension: .py | ||
mimetype: text/x-python | ||
name: python | ||
nbconvert_exporter: python | ||
pygments_lexer: ipython3 | ||
version: 3.10.11 | ||
plotly: | ||
description: Migrating from Mapbox traces to MapLibre traces. | ||
display_as: basic | ||
language: python | ||
layout: base | ||
name: MapLibre Migration | ||
order: 1 | ||
page_type: example_index | ||
permalink: python/mapbox-to-maplibre/ | ||
redirect_from: python/mapbox-migration/ | ||
thumbnail: thumbnail/line-and-scatter.jpg | ||
--- | ||
|
||
## Migrating from Mapbox traces to MapLibre traces | ||
|
||
With the release of Plotly.py v5.24.0, we are introducing a new set of trace types for maps with tile underlays, including from Plotly Express: | ||
- `px.scatter_map` | ||
- `px.line_map` | ||
- `px.choropleth_map` | ||
- `px.density_map` | ||
|
||
as well as Plotly Graph Objects: | ||
- `go.Choroplethmap` | ||
- `go.Scattermap` | ||
- `go.Densitymap` | ||
|
||
These traces replace the existing Mapbox traces, `px.scatter_mapbox`, `px.line_mapbox`, etc., but use [MapLibre](https://maplibre.org) as the map renderer rather than Mapbox. | ||
|
||
When switching to the new traces, keep an eye out for improved rendering performance, WebGL2 support, and over time, improved features in the Plotly map traces inherited from the MapLibre renderer, including projection support, globe views, terrain support, and support for modern mapping standards. | ||
|
||
You can learn more about the motivations for this change in our [announcement post](https://plotly.com/blog/plotly-is-switching-to-maplibre/). | ||
ndrezn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
As a result of removing Mapbox as the rendering engine, we're also removing the Mapbox branding from these trace names. This means that migrating from Mapbox traces to MapLibre traces will require some code changes in your projects. | ||
archmoj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
1. Change trace names from `*mapbox` to `*map`. For any existing trace name ending in `*mapbox`, ensure you've removed the "`box`" suffix. | ||
2. If in use, update `layout.mapbox` argument in your layout configuration to `layout.map`. The nested properties are identical in the new map traces, so no other changes should be required. | ||
3. If in use, update `mapbox_style` to `map_style`. | ||
4. Verify your `map_style` settings. With `mapbox` traces, we bundle `basic`, `streets`, `outdoors`, `light`, `dark`, `satellite`, and `satellite-streets` styles, using Mapbox styling. These style names are still available, but they now reference slightly different styles provided by other tools. | ||
|
||
Note that Mapbox API keys are no longer required for Plotly-provided styles, but using external styles in your Plotly maps, remains supported with the existing API. | ||
ndrezn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
ndrezn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
### Style changes | ||
Built-in styles in map traces are free styles from [Carto](https://carto.com) and [ESRI](https://www.esri.com/en-us/home). Several names are re-used from the previous Mapbox styles. | ||
<p align="center"> | ||
<img src="https://raw.githubusercontent.com/plotly/plotly.js/master/test/image/baselines/map_predefined-styles1.png" alt="Style comparison part 1" width="45%" /> | ||
<img src="https://raw.githubusercontent.com/plotly/plotly.js/master/test/image/baselines/map_predefined-styles2.png" alt="Style comparison part 2" width="45%" /> | ||
</p> | ||
LiamConnors marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.