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
18 changes: 16 additions & 2 deletions packages/python/plotly/codegen/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,29 @@ 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)}"}}
"""

trace = node.name_property
if "mapbox" in trace:
str = (
f"""
print(
"*{trace}* trace is deprecated!",
"Please consider switching to *{trace.replace("mapbox", "map")}* trace type and `map` subplots.",
"Learn more at: https://plotly.com/python/maplibre-migration/",
)
"""
+ str
)

buffer.write(str)

# ### Property definitions ###
for subtype_node in subtype_nodes:
Expand Down
Loading