You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I accidentally mixed up to_html() and save and noticed that when using to_html with the vegafusion data_transformers is enabled, I run into this error:
ValueError: When the "vegafusion" data transformer is enabled, the
to_dict() and to_json() chart methods must be called with format="vega".
For example:
>>> chart.to_dict(format="vega")
>>> chart.to_json(format="vega")
Instead of hardcoding to_dict() without args and mode='vegalite', we could allow to pass arguments for these parameters in the to_html() method. The mode could just be named mode and the dict option could either just be format or dict_kwds similar to what we have for json_kwds. It's possible to override the mode via embed_options but I think an explicit argument would be clearer.
Another option would be to deprecate it. It has been mention in the past that it is no longer used, but not sure if it was reincarnated after that or just never removed #420 (comment)
Which version of Altair are you using?
main
The text was updated successfully, but these errors were encountered:
I think we can dynamically choose the mode based on whether VegaFusion is enabled. The easiest thing might be to reimplement to_html, in terms of save, which already does this.
But this does raise the question of why we have this method in the first place!
I use .to_html() to save multiple charts into a template that holds multiple charts in different tabs, so it would be great for me if we could keep it around!
What happened?
I accidentally mixed up
to_html()
andsave
and noticed that when usingto_html
with the vegafusion data_transformers is enabled, I run into this error:What would you like to happen instead?
Instead of hardcoding
to_dict()
without args andmode='vegalite'
, we could allow to pass arguments for these parameters in theto_html()
method. The mode could just be namedmode
and the dict option could either just beformat
ordict_kwds
similar to what we have forjson_kwds
. It's possible to override themode
viaembed_options
but I think an explicit argument would be clearer.Another option would be to deprecate it. It has been mention in the past that it is no longer used, but not sure if it was reincarnated after that or just never removed #420 (comment)
Which version of Altair are you using?
main
The text was updated successfully, but these errors were encountered: