Skip to content

Commit

Permalink
workaround for displaying xarrays properly - see also #594
Browse files Browse the repository at this point in the history
  • Loading branch information
parmentelat committed Apr 28, 2021
1 parent ebfcb57 commit 539ba41
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/rise.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,13 @@ div.cell.code_cell.rendered, div.input_area {
div.text_cell_render.rendered_html {
color: #5050b0;
}

/*
* this is to void xarray's html output to show the fallback textual representation
* see also
* xarray.md and
* https://github.com/damianavila/RISE/issues/594
*/
.reveal pre.xr-text-repr-fallback {
display: none;
}
28 changes: 28 additions & 0 deletions examples/xarray.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
jupytext:
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.11.1
kernelspec:
display_name: Python 3
language: python
name: python3
---

```{code-cell} ipython3
import xarray as xr
```

this is to illustrate a useful patch for dealing with xarray's `_repr_html_()`

see also

* https://github.com/damianavila/RISE/issues/594
* `rise.css` in this folder

```{code-cell} ipython3
ds = xr.tutorial.open_dataset('air_temperature')
ds
```

0 comments on commit 539ba41

Please sign in to comment.