create_hexbin_mapbox uses *_map chart types instead of *_mapbox#5358
create_hexbin_mapbox uses *_map chart types instead of *_mapbox#5358emilykl merged 10 commits intoplotly:mainfrom
Conversation
|
Build failed on build-doc, but not sure is related? |
|
Looks like they failed on the same Python code block (1), (2): with Did upload.wikimedia.org block the resource request? |
|
Hi @ajlien , thanks for catching this, we should definitely migrate this function to use The doc build failure has been fixed on We should also deprecate
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)
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. |
|
Thanks Emily! Can do today.
…On Wed, Oct 1, 2025, 4:48 PM Emily KL ***@***.***> wrote:
*emilykl* left a comment (plotly/plotly.py#5358)
<#5358 (comment)>
Hi @ajlien <https://github.com/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() to
create_hexbin_map()
- Rename the mapbox_style arg to map_style
- Add a new create_hexbin_mapbox() function which shows a
DeprecationWarning and then calls create_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__.py accordingly
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.
—
Reply to this email directly, view it on GitHub
<#5358 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFOQA5YR7KS3USQPF6KHDAL3VQ4YHAVCNFSM6AAAAACIAXVOCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGNJYGA4DANBTHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Hi @emilykl, just pushed commits reflecting your requested changes. Please note that I did not update the Reference section of |
plotly/figure_factory/__init__.py
Outdated
| if optional_imports.get_module("pandas") is not None: | ||
| from plotly.figure_factory._county_choropleth import create_choropleth | ||
| from plotly.figure_factory._hexbin_mapbox import create_hexbin_mapbox | ||
| from plotly.figure_factory._hexbin_map import create_hexbin_map |
There was a problem hiding this comment.
| from plotly.figure_factory._hexbin_map import create_hexbin_map | |
| from plotly.figure_factory._hexbin_map import create_hexbin_map, create_hexbin_mapbox |
| def create_hexbin_map(*args, **kwargs): | ||
| raise ImportError("Please install pandas to use `create_hexbin_map`") |
There was a problem hiding this comment.
| def create_hexbin_map(*args, **kwargs): | |
| raise ImportError("Please install pandas to use `create_hexbin_map`") | |
| def create_hexbin_map(*args, **kwargs): | |
| raise ImportError("Please install pandas to use `create_hexbin_map`") | |
| def create_hexbin_mapbox(*args, **kwargs): | |
| raise ImportError("Please install pandas to use `create_hexbin_mapbox`") |
|
Thank you @ajlien! Just need to add |
| df = px.data.carshare() | ||
|
|
||
| fig = ff.create_hexbin_mapbox( | ||
| fig = ff.create_hexbin_map( |
There was a problem hiding this comment.
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.
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 orkwarg 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.