Skip to content

Commit

Permalink
docs: Add examples to deprecation message
Browse files Browse the repository at this point in the history
  • Loading branch information
dangotbanned committed Oct 19, 2024
1 parent 0977228 commit 5a1dc68
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion altair/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,21 @@ def __getattr__(name: str) -> _Any:

if name == "themes":
deprecated_warn(
"Most of the `ThemeRegistry` API is accessible via `altair.theme`.\n"
"Most cases require only the following change:\n\n"
" # Deprecated\n"
" alt.themes.enable('quartz')\n\n"
" # Updated\n"
" alt.theme.enable('quartz')\n\n"
"If your code registers a theme, make the following change:\n\n"
" # Deprecated\n"
" def custom_theme():\n"
" return {'height': 400, 'width': 700}\n"
" alt.themes.register('theme_name', custom_theme)\n"
" alt.themes.enable('theme_name')\n\n"
" # Updated\n"
" @alt.theme.register('theme_name', enable=True)\n"
" def custom_theme() -> alt.theme.ThemeConfig:\n"
" return {'height': 400, 'width': 700}\n\n"
"See the updated User Guide for further details:\n"
" https://altair-viz.github.io/user_guide/api.html#theme\n"
" https://altair-viz.github.io/user_guide/customization.html#chart-themes",
Expand Down

0 comments on commit 5a1dc68

Please sign in to comment.