-
-
Couldn't load subscription status.
- Fork 2.7k
create_hexbin_mapbox uses *_map chart types instead of *_mapbox #5358
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
Conversation
Build failed on build-doc, but not sure is related?
Looks like they failed on the same Python code block (1), (2):
import plotly.express as px
from skimage import io
img = io.imread('https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Crab_Nebula.jpg/240px-Crab_Nebula.jpg')
fig = px.imshow(img)
fig.show()
with
HTTPError: HTTP Error 403: Forbidden
Did upload.wikimedia.org block the resource request?
Hi @ajlien , thanks for catching this, we should definitely migrate this function to use _map traces.
The doc build failure has been fixed on main, if you merge main into your branch the issue should be resolved.
We should also deprecate create_hexbin_mapbox() and rename it to create_hexbin_map(). Could you add the following changes to this branch?
- Rename the function from
create_hexbin_mapbox()tocreate_hexbin_map() - Rename the
mapbox_stylearg tomap_style - Add a new
create_hexbin_mapbox()function which shows a DeprecationWarning and then callscreate_hexbin_map(), i.e. something like this:
def create_hexbin_mapbox(*args, **kwargs): warnings.warn( "create_hexbin_mapbox() is deprecated and will be removed in the next major version. " + "Please use create_hexbin_map() instead. " + "Learn more at: https://plotly.com/python/mapbox-to-maplibre/", stacklevel=2, category=DeprecationWarning, ) if "mapbox_style" in kwargs: kwargs["map_style"] = kwargs.pop("mapbox_style") return create_hexbin_map(*args, **kwargs)
- Update
plotly/figure_factory/__init__.pyaccordingly
I'm happy to take over this branch if you don't have the bandwidth, but if you get around to it first, go for it! Thanks again.
...y.py into update-hexbin-map-no-mapbox
Hi @emilykl, just pushed commits reflecting your requested changes.
Please note that I did not update the Reference section of doc/python/hexbin-mapbox.md, as I'm not sure whether this would break existing URLs.
plotly/figure_factory/__init__.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ajlien! Just need to add create_hexbin_mapbox in a few places in the figure_factory/__init__.py (see suggestions), otherwise LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove the px.set_mapbox_access_token(open(".mapbox_token").read()) lines in these examples and the information about mapbox tokens in the introduction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 9773b5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @ajlien ! 🚀
Uh oh!
There was an error while loading. Please reload this page.
plotly.graph_objects, my modifications concern the code generator and not the generated files.Small change to remove mapbox references from figure factory's hexbin map. See #5081 in particular @danielsaaf's comment.
No
(削除) docstrings or (削除ここまで)kwarg names needed to be changed, this is just a substitution.As a side effect (and the reason I originally came across this issue), currrently if you construct a figure with
create_hexbin_mapboxthen add anothergo.Scattermaptrace to it, any maki symbols in the scattermap will not render. This PR also fixes that.