Error saving a mapbox element to png
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 498
- Forks
- 62
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 2
Description
Hello, recently the option of saving a fig with a mapbox element to a png file started to fail with the error:
ValueError: Transform failed with error code 525: Mapbox error.
The funny thing is that this exact same option worked just fine until a few days ago. The same error occurs when passing a mapbox token (even though the token is not mandatory for mapbox_style="open-street-map").
When trying to figure out what was the problem I reached this line in the source code, but I have no idea what is the solution.
Bellow a code block from the examples page that raises the same error:
import pandas as pd
us_cities = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/us-cities-top-1k.csv")
import plotly.express as px
fig = px.scatter_mapbox(us_cities, lat="lat", lon="lon", hover_name="City", hover_data=["State", "Population"],
color_discrete_sequence=["fuchsia"], zoom=3, height=300)
fig.update_layout(mapbox_style="open-street-map")
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
# fig.show()
fig.write_image('/tmp/test.jpg')
Using:
plotly.version: 4.14.3
kaleido.version: 0.2.1
Thank you.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with repos/kaleido/py/kaleido/scopes/base.py at line 308 and run the supplied Plotly Express reproduction using Plotly 4.14.3 and Kaleido 0.2.1. Compare the open-street-map case with and without a Mapbox token; done means fig.write_image succeeds for the reported example without the Mapbox error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100