Skip to content

Commit 8c09df4

Browse files
authored
Document how to use itables in Jupyter Lab (#37)
* How to use on Jupyter Lab
1 parent ec38df6 commit 8c09df4

File tree

4 files changed

+144
-72
lines changed

4 files changed

+144
-72
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
0.3.1 (2020-12-??)
1+
0.3.1 (2020-12-24)
22
==================
33

44
Fixed
55
-----
66
- We fixed an issue (`jquery` not found) with the HTML export when using `nbconvert>=6.0` (#21)
77
- We documented how to change the default ordering of rows - with the `order` option (#30)
8+
- We documented how to load `require` in Jupyter Lab (#3)
9+
810

911
Changed
1012
-------

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![codecov.io](https://codecov.io/github/mwouts/itables/coverage.svg?branch=main)](https://codecov.io/github/mwouts/itables?branch=main)
66
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/mwouts/itables.svg)](https://lgtm.com/projects/g/mwouts/itables/context:python)
77
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
8-
[![Binder](https://img.shields.io/badge/Binder-Notebook-blue.svg)](https://mybinder.org/v2/gh/mwouts/itables/main?filepath=README.md)
8+
[![Binder](https://img.shields.io/badge/Binder-Notebook-blue.svg)](https://mybinder.org/v2/gh/mwouts/itables/main?urlpath=lab/tree/README.md)
99
<a class="github-button" href="https://github.com/mwouts/itables" data-icon="octicon-star" data-show-count="true" aria-label="Star mwouts/itables on GitHub">Star</a>
1010

1111
Turn pandas DataFrames and Series into interactive [datatables](https://datatables.net) in both your notebooks and their HTML representation with `import itables.interactive`:
@@ -20,6 +20,22 @@ Install the package with
2020
pip install itables
2121
```
2222

23+
In Jupyter Lab, load the `require` Javascript library (this is not required in Jupyter Notebook):
24+
25+
```python
26+
# This is required only in Jupyter Lab - don't do this in Jupyter Notebook
27+
# A PR is welcome if you know how to avoid this.
28+
# See https://github.com/mwouts/itables/issues/3
29+
from IPython.display import HTML, display
30+
from time import sleep
31+
32+
display(HTML("""
33+
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
34+
"""))
35+
36+
sleep(0.1)
37+
```
38+
2339
Activate the interactive mode for all series and dataframes with
2440

2541
```python

index.html

Lines changed: 123 additions & 69 deletions
Large diffs are not rendered by default.

itables/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""ITables' version number"""
22

3-
__version__ = "0.3.1-dev"
3+
__version__ = "0.3.1"

0 commit comments

Comments
 (0)