Skip to content

Commit

Permalink
reuse the quarto_theme if already defined
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonstyle committed Nov 15, 2023
1 parent 3bc0f84 commit f78e1b8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/resources/jupyter/lang/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,17 @@
options.paging = False
except Exception:
pass

try:
import altair as alt

# By default, dashboards will have container sized
# vega visualizations which allows them to flow reasonably
def quarto_dashboard_theme(*args, **kwargs):
return dict(width = 'container', height= 'container')
alt.themes.register('quarto-dashboard-theme', quarto_dashboard_theme)
alt.themes.enable('quarto-dashboard-theme')
if 'quarto-dashboard-theme' not in alt.themes.names():
def quarto_dashboard_theme(*args, **kwargs):
return dict(width = 'container', height= 'container')
alt.themes.register('quarto-dashboard-theme', quarto_dashboard_theme)
alt.themes.enable('quarto-dashboard-theme')

except Exception:
pass
Expand Down

0 comments on commit f78e1b8

Please sign in to comment.