Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: altair chart dark mode toggle (#3136)

Myles Scolnickaada9537f440
diff --git a/marimo/_output/formatters/altair_formatters.py b/marimo/_output/formatters/altair_formatters.py
index a0906780d7..f5dae64685 100644
--- a/marimo/_output/formatters/altair_formatters.py
+++ b/marimo/_output/formatters/altair_formatters.py
@@ -86,9 +86,10 @@ class AltairFormatter(FormatterFactory):
return ("application/vnd.vegalite.v5+json", chart.to_json())
def apply_theme(self, theme: Theme) -> None:
- import altair as alt # type: ignore
-
- alt.themes.enable("dark" if theme == "dark" else "default") # type: ignore
+ del theme
+ # We don't need to apply this here because the theme is set in the
+ # vega-lite component
+ pass
# This is only needed since it seems that altair does not