I saw an X by Trevor Manz announcing the scalable data profiler Quak. I wanted to test that it works with Panel. And it does.
Please note that Quak is not yet (2024-08-04) ready for production and its height is fixed at 10 rows/ 273px. I have a request for making the height customizable here.
Panel Quak Tutorial
Quak can be integrated with Panel to create dynamic reports, tools for notebooks, and live data apps.
First, install the necessary packages:
pip install quak polars panel ipywidgets_bokeh
Now, let’s get quaking:
import polars as pl
import quak
QUAK_LOGO = "https://github.com/manzt/quak/raw/main/assets/logo-color.svg"
df = pl.read_parquet("https://github.com/uwdata/mosaic/raw/main/data/athletes.parquet")
quack_widget = quak.Widget(df)
Next, integrate Quak with Panel:
import panel as pn
# Add support for quak/anywidget/ ipywidgets
pn.extension("ipywidgets")
# Create a Panel component
quack_component = pn.panel(quack_widget, sizing_mode="stretch_both")
# Create and serve the app
pn.template.FastListTemplate(
logo=QUAK_LOGO,
site="Quak",
title="Works with Panel",
main=[quack_component],
accent="#FFA700",
).servable()
To launch your app, use the following command in a terminal:
panel serve app.py
Your app should now look like this: