Skip to content
Next Next commit
Refactored create_hexbin_mapbox to use *_map chart types instead of *…
…_mapbox
  • Loading branch information
ajlien committed Oct 1, 2025
commit 7c589f8852ed58bbc53cec4049614dc0d686a04e
8 changes: 4 additions & 4 deletions plotly/figure_factory/_hexbin_mapbox.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from plotly.express._core import build_dataframe
from plotly.express._doc import make_docstring
from plotly.express._chart_types import choropleth_mapbox, scatter_mapbox
from plotly.express._chart_types import choropleth_map, scatter_map
import narwhals.stable.v1 as nw
import numpy as np

Expand Down Expand Up @@ -446,7 +446,7 @@ def create_hexbin_mapbox(
if range_color is None:
range_color = [agg_data_frame["color"].min(), agg_data_frame["color"].max()]

fig = choropleth_mapbox(
fig = choropleth_map(
data_frame=agg_data_frame.to_native(),
geojson=geojson,
locations="locations",
Expand All @@ -462,15 +462,15 @@ def create_hexbin_mapbox(
opacity=opacity,
zoom=zoom,
center=center,
mapbox_style=mapbox_style,
map_style=mapbox_style,
title=title,
template=template,
width=width,
height=height,
)

if show_original_data:
original_fig = scatter_mapbox(
original_fig = scatter_map(
data_frame=(
args["data_frame"].sort(
by=args["animation_frame"], descending=False, nulls_last=True
Expand Down