-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Support Altair charts #7
Comments
It looks like the From there, we'll probably add a detect statement to run the necessary setup Python code to include the graphs similar to |
Related to this is a more general issue relating to the rendering of HTML from Eg with import micropip
await micropip.install(["ipyleaflet", "sqlite3"])
from IPython.display import display
from ipyleaflet import Map, Marker, basemaps, basemap_to_tiles
m = Map(
basemap=basemap_to_tiles(
basemaps.NASAGIBS.ModisTerraTrueColorCR, "2017-04-08"
),
center=(52.204793, 360.121558),
zoom=4
)
m.add_layer(Marker(location=(52.204793, 360.121558)))
display(m) returns text.
In an IPython/Jupyter notebook,
|
Great point @psychemedia ! It would be very helpful if it was possible to support the same outputs as jupyter environments (such as I noticed that it seems like these are already support in some cases, for example for pandas data frames where either Likewise I can use So if an object has a @coatless Is the reason for altair charts and similar output not displaying this inabiility to execution JS code (which in the case of altair would prevent loading Vega-Lite from the CDNs)? That could be why the png/svg renderers are not working either since they still require to connect to the VegaLite CDNs to create the charts in the first place. Do you have an idea where to get started with working on this? I'm working on a viz textbook for ggplot and altair and would love to use this extension for the interactive coding exercises in both languages. |
I should also add that altair has a way of forcing the output to be HTML (instead of automatically converting to textual output in unsupported environments) via The content of the output div: |
Is your feature request related to a problem? Please describe.
Currently, altair charts renders as text:
The output from altair is vega-lite specs that can be rendered as interactive HTML. I tried some of the different renderers here https://altair-viz.github.io/user_guide/display_frontends.html, such as PNG and SVG, but none of them display.
Describe the solution you'd like
Chart objects to render by default as they do in a notebook environment.
Describe alternatives you've considered
Not sure what an alternative solution would be here.
Additional context
Code:
Edit: Modified the MWE to include
await
beforemicropip.install()
.The text was updated successfully, but these errors were encountered: