-
-
Notifications
You must be signed in to change notification settings - Fork 416
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
xarray repr_html is not displayed correctly in RISE #594
Comments
Hi @parmentelat and thanks for your quick response. Xarray is an analysis library for n-dimensional lableled data, comparable to pandas. I'm sorry this example did work for you. Can you try with ds = xr.tutorial.open_dataset('air_temperature') |
Thanks a lot for your helpful suggestion! Your explanation makes total sense. I am already trying the custom CSS solution, but unfortunately the binder I'm running on appears to have some issues with that as well (pangeo-data/pangeo-binder#189). I will close this when I can post a css hack to work around the problem. |
all right; you can also embed the css in a |
Did not know that! It is not mentioned on https://rise.readthedocs.io/en/stable/customize.html#adding-custom-css. |
I believe that the |
ah! you're right, inserting css this way seems to be blocked - I thought I had seen that working at some point, sorry (note that, had it worked, it would have belonged in the notebook's documentation as interpreting html fragments has nothing to do with rise specifically :) |
There is a flag But I don't know how to turn it on. 😞 |
Finally got something working! style = """
<style>
.reveal pre.xr-text-repr-fallback {
display: none;
}
</style>
"""
from IPython.core.display import HTML
HTML(style) |
When something is broken in RISE and working in the notebook view, there is a 95% chance the problem is the reveal.js CSS 😉 |
Just wanted to drop an update here, as I had to add two more rules to fix the xarray's html output within RISE. It seems that reveal's defaults for .reveal pre.xr-text-repr-fallback {
display: none;
}
.reveal .xr-wrap {
max-width: 90%;
}
.reveal li.xr-var-item {
display: grid;
grid-template-columns: 150px auto auto 1fr 20px 20px;
}
.reveal ul.xr-var-list {
margin: 0;
padding: 0;
} |
Xarray has a nice
_repr_html_
that shows up fine in notebook and labHowever, when I look at this in RISE, it first shows a plain-text
__repr__
. Then the HTML that I do see is a bit distorted.Any ideas how to make it show up correctly in slideshow mode?
The text was updated successfully, but these errors were encountered: