manzt / quak

a scalable data profiler
https://manzt.github.io/quak/
MIT License
201 stars 9 forks source link

marimo compatibility: quak Widget missing render function #25

Closed akshayka closed 1 month ago

akshayka commented 1 month ago

First, congratulations on the release of quak. What a slick design! I love the mapping from UI interactions to SQL, not to mention the visual design.

I tried using quak in marimo, via our anywidget adapter (mo.ui.anywidget). Our adapter expects the anywidget to have an exported render function, but it seems like the quak widget might be missing one?

It's possible the error is on our end, but I thought I'd open this issue so we can figure it out together.

image

Other anywidgets, like DrawData, work fine in marimo.

Code to reproduce. To try yourself, save the code below to notebook.py and run pip install marimo and marimo edit notebook.py.

import marimo

__generated_with = "0.7.12"
app = marimo.App(width="medium")

@app.cell
def __():
    import quak
    return quak,

@app.cell
def __():
    import marimo as mo
    return mo,

@app.cell
def __():
    import polars as pl
    return pl,

@app.cell
def __(pl):
    df = pl.read_parquet("~/Downloads/athletes.parquet")
    return df,

@app.cell
def __(df, mo, quak):
    qwidget = quak.Widget(df)
    mo.ui.anywidget(qwidget)
    return qwidget,

if __name__ == "__main__":
    app.run()

cc @mscolnick

manzt commented 1 month ago

I need to document the anywidget esm. Let me take a stab at a patch on your end.

manzt commented 1 month ago

Seems to be working on 0.7.14:

image

Also the UI looks very clean in marimo :)

manzt commented 1 month ago

https://github.com/user-attachments/assets/bb533bdf-098c-4e7b-9cbd-0a0e9d913c30

also kind of cool flow to select a data subset and then render in marimos table...

mscolnick commented 1 month ago

Or even better, putting it into a chart (since you already have the table)

manzt commented 1 month ago

Oh ya, this rules...

https://github.com/user-attachments/assets/362a95b3-6bcf-40c0-b578-5a2246ce3e9e