-
Notifications
You must be signed in to change notification settings - Fork 114
Open
Labels
Description
Seems like there's some kind of conflict between scrolling data grids horizontally and setting the column width, I'd expect the first column in both of these grids to be the same width.
from shiny import App, render, ui
import polars as pl
import numpy as np
# Create a DataFrame with 50 columns
df = pl.DataFrame({f"col_{i}": np.random.randn(100) for i in range(50)})
app_ui = ui.page_fillable(
ui.card(ui.output_data_frame("wide_df")),
ui.card(ui.output_data_frame("narrow_df")),
)
style = [
{
"cols": [0],
"style": {"width": "500px"},
}
]
def server(input, output, session):
@render.data_frame
def wide_df():
return render.DataGrid(
df,
filters=True,
styles=style,
)
@render.data_frame
def narrow_df():
return render.DataGrid(
df.select(pl.col("^col_[0-3]$")), filters=True, styles=style
)
app = App(app_ui, server)