Describe the bug
Rendering a dataframe with on the order of 1,000 columns makes my browser tab sluggish, and 10,000 columns crashes the browser tab, regardless of how many rows the dataframe has.
It may make sense to reintroduce a limit on the number of columns that ui.table can display.
Related to: #2899 (comment)
Environment
0.9.27, Chrome
Code to reproduce
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "marimo",
# "numpy==2.1.3",
# "pandas==2.2.3",
# ]
# ///
import marimo
__generated_with = "0.9.27"
app = marimo.App(width="medium")
@app.cell
def __():
import pandas as pd
return (pd,)
@app.cell
def __():
import numpy as np
return (np,)
@app.cell
def __():
import marimo as mo
return (mo,)
@app.cell(hide_code=True)
def __(mo):
mo.md("""Set cols to 10000 to crash the frontend. Number of rows appears to have no effect.""")
return
@app.cell
def __(mo):
rows = mo.ui.number(start=1, value=10, label="rows")
columns = mo.ui.number(start=1, value=10, label="cols")
mo.hstack([rows, columns], justify="start")
return columns, rows
@app.cell
def __(columns, np, rows):
data = np.zeros((rows.value, columns.value))
return (data,)
@app.cell
def __(data, pd):
df = pd.DataFrame(data, columns=[str(i) for i in range(data.shape[1])])
return (df,)
@app.cell
def __(df):
df
return
if __name__ == "__main__":
app.run()
Describe the bug
Rendering a dataframe with on the order of 1,000 columns makes my browser tab sluggish, and 10,000 columns crashes the browser tab, regardless of how many rows the dataframe has.
It may make sense to reintroduce a limit on the number of columns that
ui.tablecan display.Related to: #2899 (comment)
Environment
0.9.27, Chrome
Code to reproduce