My lab uses HTML notebooks to communicate information to stakeholders.
I am curious about migrating my workflow from R to Julia but am having trouble replicating an interactive table that I can include in the book like DT
+ bookdown
in R or itables
+ jupyter-book
in Python.
I’ve tried using ipynbs and making an R or Python call via RCall
or PyCall
just for the corresponding table function I need but the table isn’t displayed (I am assuming there a is a type issue here). What I tried:
PyCall
py"""
# example from the docs
import itables
import pandas as pd
import numpy as np
df = pd.DataFrame({
'cups_of_coffee': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
'productivity': [2, 5, 6, 8, 9, 8, 0, 1, 0, -1]
})
itables.show(df)
"""py
This was probably a naive experiment and doesn’t return or display anything in the book.
RCall
using RCall
R"
library(DT)
x <- datatable(mtcars)
"
# this gives me an ordered dict of the dataset (fair enough!)
@rget x
TableView.jl
I’ve also tried TableView.jl
which works great when I’m using the live Jupyter Lab interface…
using RDatasets
using TableView
# great!
mtcars = dataset("datasets", "mtcars");
…but doesn’t appear in the finished book when I compile to jupyter-book
. It gives an error about not detecting the required extension in the environment (again, only when building the book):
WebIO not detected.
Please read the troubleshooting guide for more information on how to resolve this issue.
https://juliagizmos.github.io/WebIO.jl/latest/troubleshooting/not-detected/
This suggests perhaps I could resolve the issue by including the extension in the compilation environment somehow, but before I spent a bunch more time on it I wanted to make sure I hadn’t overlooked an existing solution.
Are there solutions I’m missing, and, if not, what are some steps I might try to get an interactive table compiled into an HTML book?
EDIT: typo and…
NOTE: the issue with TableView.jl
happens when I use jupyter-book
and weave.jl
, so I am guessing it’s just not designed with this in mind.