marimo-team / marimo

A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.
https://marimo.io
Apache License 2.0
5.44k stars 165 forks source link

feat: mo.ui.table() column chart previews #1553

Closed mscolnick closed 1 month ago

mscolnick commented 1 month ago

📝 Summary

Add columns previews to the top of each column.

Bug fixes:

🔍 Description of Changes

Screenshot 2024-06-04 at 10 33 31 AM Screenshot 2024-06-04 at 10 30 51 AM

Future ideas:

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 7:53pm
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 7:53pm
akshayka commented 1 month ago

This appears to regress mo.ui.dataframe (doesn't render):

Error in console:

image

Code repro:

import marimo

__generated_with = "0.6.13"
app = marimo.App()

@app.cell
def __():
    from vega_datasets import data
    return data,

@app.cell
def __(data):
    cars = data.cars()
    return cars,

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

@app.cell
def __(cars, mo):
    mo.ui.dataframe(cars)
    return

if __name__ == "__main__":
    app.run()
akshayka commented 1 month ago

For dataframes truncated by mo.ui.table, the chart preview and column summaries in mo.ui.table appear to show a preview of the truncated data instead of the original data. The data explorer panel in contrast correctly shows a preview of the original data.

Here, notice that the chart preview stops at "9,999", even though the max value is "30,000". image

Code repro:

import marimo

__generated_with = "0.6.13"
app = marimo.App()

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

@app.cell
def __():
    import pandas as pd
    return pd,

@app.cell
def __(pd):
    df = pd.DataFrame({"data": list(range(30000))})
    return df,

@app.cell
def __(df, mo):
    mo.ui.table(df)
    return

if __name__ == "__main__":
    app.run()
mscolnick commented 1 month ago
  1. First issue is fixed
  2. The min/max/unique are now operating on the full (non-clipped) dataframe, but we hide the charts when above >20k