Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Open In Colab Open In Kaggle

Tutorial 2: Rich Interactive Outputs

MyST renders interactive outputs from Altair, Plotly, and ipywidgets natively. These work both in the static build (pre-rendered from stored outputs) and live via JupyterLite when the power button is activated.

Interactive Altair chart

Altair charts are fully interactive in the rendered book — no kernel required. Drag to select points in the scatter plot; the bar chart updates in real time.

ipywidgets slider

With the JupyterLite kernel active, this slider is live and interactive.

JupyterLite uses Pyodide (Python in WebAssembly), which requires packages to be loaded via micropip before importing. The setup cell below handles this — it is hidden from students but runs automatically when the kernel starts.

Pandas DataFrame output

DataFrames render as styled HTML tables in the book:

Labelling outputs for reuse

Label a cell to embed its output on another page:

On any other page in the book, embed this output with:

{embed}`fig-horsepower-scatter`

Summary