-
Notifications
You must be signed in to change notification settings - Fork 793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make altair_viewer
and altair_saver
work with Altair 5
#2866
Comments
Is there any functionality from altair_viewer or altair_saver that we still would like to be usable from altair 5? For altair_saver, I can't think of anything that isn't already covered by vl_convert. Unless I'm missing something, maybe we should add a note to the altair_saver readme that we encourage users to use vl_convert for altair 5 instead? For altair_viewer, we don't yet have a way to support the display/show functionality in altair 5 (and some requests to add it in altair-viz/altair_viewer#59). I wonder if we can lift out the browser opening logic from altair_viewer directly into altair and rely on vl_convert to display the chart in a browser tab either online or offline mode. @jonmmease Do you think this would be possible? |
As I recall, altair_viewer does a bunch of work involving websockets to make repeated chart displays automatically show up in the same browser tab. I'd personally prefer to have each call do I wrote some logic for plotly.py a while back that takes an HTML string and opens it in a new browser tab without writing to a temp file. See https://github.com/plotly/plotly.py/blob/a6662ab48bf0a71f703fac1833a4d7e6c805b805/packages/python/plotly/plotly/io/_base_renderers.py#L655-L709. If this is the behavior we want, then I think it would be pretty straightforward to combine this logic with vl-convert. |
From my side of things, those solutions sounds great! I think the most important part of this feature is to enable an altair workflow from the terminal; it doesn't have to mimic altair saver exactly. I'm in favor of making the behavior easy to implement/maintain and I don't see a noticeable advantage of reusing the same tab (and if someone really wants to, they could write a chart to file and have that filepath open in a single tab that they refresh). You plotly solution sounds like a good approach to me as well. |
If you include save/export options in altair, you might want to support *.pdf as well. |
Hi @stefaneidelloth, PDF export is supported using |
I'm closing this since Altair 5.2 brought in PDF export and mentioned above, and since Altair 5.3 the functionality of Altair Viewer is now available in Altair via the vl-convert package instead. See the docs on how to use the browser renderer to display charts via Immense thanks to @jonmmease for all your work on |
As was pointed out in #2686 (comment). Once Altair 5 RC is released
altair_viewer
andaltair_saver
won't work anymore as they are using the entrypoints of altair vegalite 4.Observe current behaviour using altair from GitHub main branch:
Originally posted by @mattijn in #2599 (comment)
The text was updated successfully, but these errors were encountered: