Skip to content

add deprecation notice for mapbox traces #4783

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

Closed
wants to merge 10 commits into from
13 changes: 6 additions & 7 deletions packages/javascript/jupyterlab-plotly/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/javascript/jupyterlab-plotly/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@lumino/messaging": "^1.2.3",
"@lumino/widgets": "^1.8.1",
"lodash": "^4.17.4",
"plotly.js": "https://output.circle-artifacts.com/output/job/f0bb742f-5266-49b7-a0f9-60247be3560f/artifacts/0/plotly.js.tgz"
"plotly.js": "https://output.circle-artifacts.com/output/job/d76ad8a3-483d-4333-a853-f0ebb766251d/artifacts/0/plotly.js.tgz"
},
"jupyterlab": {
"extension": "lib/jupyterlab-plugin",
Expand Down
22 changes: 19 additions & 3 deletions packages/python/plotly/codegen/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ def build_datatype_py(node):
)
buffer.write(f"import copy as _copy\n")

if "mapbox" in node.name_property:
buffer.write(f"from warnings import warn\n")

# Write class definition
# ----------------------
buffer.write(
Expand Down Expand Up @@ -158,15 +161,16 @@ def _subplot_re_match(self, prop):
valid_props_list = sorted(
[node.name_property for node in subtype_nodes + literal_nodes]
)
buffer.write(
f"""

str = f"""
# class properties
# --------------------
_parent_path_str = '{node.parent_path_str}'
_path_str = '{node.path_str}'
_valid_props = {{"{'", "'.join(valid_props_list)}"}}
"""
)

buffer.write(str)

# ### Property definitions ###
for subtype_node in subtype_nodes:
Expand Down Expand Up @@ -400,6 +404,18 @@ def __init__(self"""
"""
)

if "mapbox" in node.name_property:
buffer.write(
f"""
warn(
"*{node.name_property}* is deprecated!"
+ " Use *{node.name_property.replace("mapbox", "map")}* instead."
+ " Learn more at: https://plotly.com/python/mapbox-to-maplibre/",
stacklevel=2
)
"""
)

# Return source string
# --------------------
return buffer.getvalue()
Expand Down
Loading