Skip to content

Commit f4a5dd7

Browse files
committed
remove mapbox references from codegen and rerun codegen
1 parent 38185be commit f4a5dd7

4 files changed

Lines changed: 13 additions & 51 deletions

File tree

codegen/datatypes.py

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
from codegen.utils import CAVEAT, write_source_py
66

77

8-
deprecated_mapbox_traces = [
9-
"scattermapbox",
10-
"choroplethmapbox",
11-
"densitymapbox",
12-
]
138
locationmode_traces = [
149
"choropleth",
1510
"scattergeo",
@@ -103,8 +98,7 @@ def build_datatype_py(node):
10398
buffer.write("import copy as _copy\n")
10499

105100
if (
106-
node.name_property in deprecated_mapbox_traces
107-
or node.name_property in locationmode_traces
101+
node.name_property in locationmode_traces
108102
or node.name_property == "template"
109103
):
110104
buffer.write("import warnings\n")
@@ -375,22 +369,10 @@ def __init__(self"""
375369
buffer.write("\n\n")
376370
for subtype_node in subtype_nodes:
377371
name_prop = subtype_node.name_property
378-
if datatype_class == "Template" and name_prop == "data":
379-
buffer.write(
380-
f"""
381-
# Template.data contains a 'scattermapbox' key, which causes a
382-
# go.Scattermapbox trace object to be created during validation.
383-
# In order to prevent false deprecation warnings from surfacing,
384-
# we suppress deprecation warnings for this line only.
385-
with warnings.catch_warnings():
386-
warnings.filterwarnings("ignore", category=DeprecationWarning)
387-
self._set_property("{name_prop}", arg, {name_prop})"""
388-
)
389-
else:
390-
buffer.write(
391-
f"""
372+
buffer.write(
373+
f"""
392374
self._set_property("{name_prop}", arg, {name_prop})"""
393-
)
375+
)
394376

395377
# Literals
396378
if literal_nodes:
@@ -411,19 +393,6 @@ def __init__(self"""
411393
"""
412394
)
413395

414-
if node.name_property in deprecated_mapbox_traces:
415-
buffer.write(
416-
f"""
417-
warnings.warn(
418-
"*{node.name_property}* is deprecated!"
419-
+ " Use *{node.name_property.replace("mapbox", "map")}* instead."
420-
+ " Learn more at: https://plotly.com/python/mapbox-to-maplibre/",
421-
stacklevel=2,
422-
category=DeprecationWarning,
423-
)
424-
"""
425-
)
426-
427396
# Return source string
428397
return buffer.getvalue()
429398

plotly/graph_objs/layout/_template.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,7 @@ def __init__(self, arg=None, data=None, layout=None, **kwargs):
121121
self._skip_invalid = kwargs.pop("skip_invalid", False)
122122
self._validate = kwargs.pop("_validate", True)
123123

124-
# Template.data contains a 'scattermapbox' key, which causes a
125-
# go.Scattermapbox trace object to be created during validation.
126-
# In order to prevent false deprecation warnings from surfacing,
127-
# we suppress deprecation warnings for this line only.
128-
with warnings.catch_warnings():
129-
warnings.filterwarnings("ignore", category=DeprecationWarning)
130-
self._set_property("data", arg, data)
124+
self._set_property("data", arg, data)
131125
self._set_property("layout", arg, layout)
132126
self._process_kwargs(**dict(arg, **kwargs))
133127
self._skip_invalid = False

templategen/definitions.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ def simple_white():
139139
opts = {"marker": {"line": {"width": 0.6, "color": "white"}}}
140140
template.data.histogram = [opts]
141141

142-
# Mapbox light style
143-
template.layout.mapbox.style = "light"
142+
# Light map style
143+
template.layout.map.style = "light"
144144

145145
# Automargin for pie chart
146146
template.data.pie = [{"automargin": True}]
@@ -407,8 +407,8 @@ def plotly():
407407
template.layout.xaxis.zerolinewidth = 2
408408
template.layout.yaxis.zerolinewidth = 2
409409

410-
# Mapbox light style
411-
template.layout.mapbox.style = "light"
410+
# Light map style
411+
template.layout.map.style = "light"
412412

413413
# Automargin for pie chart
414414
template.data.pie = [{"automargin": True}]
@@ -487,8 +487,8 @@ def plotly_white():
487487
template.layout.xaxis.zerolinewidth = 2
488488
template.layout.yaxis.zerolinewidth = 2
489489

490-
# Mapbox light style
491-
template.layout.mapbox.style = "light"
490+
# Light map style
491+
template.layout.map.style = "light"
492492

493493
# Automargin for pie chart
494494
template.data.pie = [{"automargin": True}]
@@ -575,8 +575,8 @@ def plotly_dark():
575575
template.layout.xaxis.zerolinewidth = 2
576576
template.layout.yaxis.zerolinewidth = 2
577577

578-
# Mapbox light style
579-
template.layout.mapbox.style = "dark"
578+
# Light map style
579+
template.layout.map.style = "dark"
580580

581581
# Set marker outline color
582582
opts = {"marker": {"line": {"color": plotly_clrs["Rhino Darker"]}}}

templategen/utils/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
("scatter3d", "line"),
2121
("scatter3d", "marker"),
2222
("scattermap", "marker"),
23-
("scattermapbox", "marker"),
2423
("scatterternary", "marker"),
2524
("scattercarpet", "marker"),
2625
("scatter", "marker", "line"),

0 commit comments

Comments
 (0)