Open Jhsmit opened 2 weeks ago
Hi @Jhsmit, could you try applying the theme with alt.themes.enable
following Changing the Theme docs?
What's happening is that the VegaFusion data transformer converts the Vega-Lite spec to Vega using vl-convert in Python (because VegaFusion operates on Vega specifications) and this Vega specification is what is sent to the browser for display. But Vega-Embed themes (supplied to embed_options
) are applied only in the browser at display time, and they only apply to Vega-Lite charts (not Vega). By using alt.themes.enable
, the theme gets applied in Python before the conversion to Vega.
All that said, I think it would make sense for us to look for a theme in embed_options
when VegaFusion is enabled and do this automatically.
That works! thanks also works without embed options
alt.themes.enable('dark')
alt.data_transformers.enable("vegafusion")
alt.JupyterChart(chart)
What happened?
I'm trying to make a JupyterChart in dark theme with the vegafusion transformed enabled. code:
with default transformer:
with vegafusion:
When I click "Open in Vega Editor" I see the same behavior, so my reasoning was therefore the vega-lite spec generated has a bug and the issue should be reported here.
What would you like to happen instead?
Expected behavior is the graph to look the same as with the default transformer
Which version of Altair are you using?
5.4.1