Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Add conveniences for working with the data_server backend #103

Closed
joelostblom opened this issue May 18, 2022 · 1 comment
Closed

Add conveniences for working with the data_server backend #103

joelostblom opened this issue May 18, 2022 · 1 comment

Comments

@joelostblom
Copy link
Member

Currenlty, to show Altair plots created with the data_server enabled in other environments such as JupyterBook, I put something like this in my notebooks to fall back to an svg representation of the plot:

alt.renderers.enable('altair_saver', fmts=['vega-lite', 'svg'])

The downside with this is that it makes subsequent plots static, even if I switch from the data_server transformer to the default one and I need to manually change the renderer back with alt.renderers.enable('default') or alt.renderers.enable('altair_saver', fmts=['vega-lite', 'svg']) to show these plots.

I think it would be neat with a renderer format that inserts an html blurb only if the data_server is not activated (by checking alt.data_transformers.active and otherwise uses another format (could be called something like html_data_server). Even better would be if the default html format could somehow detect if there is not a live Python kernel running and if data_server was used, and if both those are true, remove the HTML spec instead of showing the empty chart)

@joelostblom
Copy link
Member Author

Since Altair 5.2, the functionality of Altair Saver is now available in Altair via the vl-convert package. Most of the functionality has been available since 5.0, and the main addition in 5.2 was PDF export. See the docs on how to save charts for more details

We are going to archive this repo, so I'm closing all the open issues and PRs before doing so. Try out the new options for saving charts mentioned above and if you run into issues, please open an issue directly in the altair or vl-convert repo.

@joelostblom joelostblom closed this as not planned Won't fix, can't repro, duplicate, stale Mar 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant