Skip to content

Commit 63882d0

Browse files
committed
Fixed deprecation warning for 'type' found when county-choropleth.md is executed.
1 parent 883c0d9 commit 63882d0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

plotly/figure_factory/_county_choropleth.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def _calculations(
327327
):
328328
# 0-pad FIPS code to ensure exactly 5 digits
329329
padded_f = str(f).zfill(5)
330-
if fips_polygon_map[f].type == "Polygon":
330+
if fips_polygon_map[f].geom_type == "Polygon":
331331
x = fips_polygon_map[f].simplify(simplify_county).exterior.xy[0].tolist()
332332
y = fips_polygon_map[f].simplify(simplify_county).exterior.xy[1].tolist()
333333

@@ -354,7 +354,7 @@ def _calculations(
354354

355355
x_traces[level] = x_traces[level] + x + [np.nan]
356356
y_traces[level] = y_traces[level] + y + [np.nan]
357-
elif fips_polygon_map[f].type == "MultiPolygon":
357+
elif fips_polygon_map[f].geom_type == "MultiPolygon":
358358
x = [
359359
poly.simplify(simplify_county).exterior.xy[0].tolist()
360360
for poly in fips_polygon_map[f].geoms
@@ -771,7 +771,7 @@ def create_choropleth(
771771
for index, f in enumerate(fips):
772772
level = values[index]
773773
try:
774-
fips_polygon_map[f].type
774+
fips_polygon_map[f].geom_type
775775

776776
(
777777
x_traces,
@@ -805,7 +805,7 @@ def create_choropleth(
805805
level = LEVELS[j]
806806

807807
try:
808-
fips_polygon_map[f].type
808+
fips_polygon_map[f].geom_type
809809

810810
(
811811
x_traces,
@@ -844,12 +844,12 @@ def create_choropleth(
844844
x_states = []
845845
y_states = []
846846
for index, row in df_state.iterrows():
847-
if df_state["geometry"][index].type == "Polygon":
847+
if df_state["geometry"][index].geom_type == "Polygon":
848848
x = row.geometry.simplify(simplify_state).exterior.xy[0].tolist()
849849
y = row.geometry.simplify(simplify_state).exterior.xy[1].tolist()
850850
x_states = x_states + x
851851
y_states = y_states + y
852-
elif df_state["geometry"][index].type == "MultiPolygon":
852+
elif df_state["geometry"][index].geom_type == "MultiPolygon":
853853
x = [
854854
poly.simplify(simplify_state).exterior.xy[0].tolist()
855855
for poly in df_state["geometry"][index].geoms

0 commit comments

Comments
 (0)