streamlit-aggrid
streamlit-aggrid copied to clipboard
V.03 theme no longer available in AgGrid
Code works fine in 2.3 but not in 3 .. can you theme to the config file in V3?
ValueError: light is not valid. Available options: {'STREAMLIT': <AgGridTheme.STREAMLIT: 'streamlit'>, 'ALPINE': <AgGridTheme.ALPINE: 'alpine'>, 'BALHAM': <AgGridTheme.BALHAM: 'balham'>, 'MATERIAL': <AgGridTheme.MATERIAL: 'material'>} File "C:\Users\sstapinski\pollen\lib\site-packages\st_aggrid__init.py", line 295, in AgGrid raise ValueError(f"{theme} is not valid. Available options: {AgGridTheme.members__}") streamlit-aggrid==0.3.3
import streamlit as st
import pandas as pd
import numpy as np
from st_aggrid import AgGrid, GridOptionsBuilder
df = pd.DataFrame(
np.random.randint(0, 100, 50).reshape(-1, 5),
index=range(10),
columns=list("abcde"),
)
available_themes = ["streamlit", "light", "dark", "blue", "fresh", "material"]
selected_theme = st.selectbox("Theme", available_themes)
gb = GridOptionsBuilder.from_dataframe(df)
if st.checkbox('Pre-select rows 4 and 6 when loading.'):
gb.configure_selection('multiple', pre_selected_rows=[3,5])
response = AgGrid(
df,
editable=True,
gridOptions=gb.build(),
data_return_mode="filtered_and_sorted",
update_mode="no_update",
fit_columns_on_grid_load=True,
theme=selected_theme
)
theme "balham", "alpine", "material", "streamlit" is work, others are not。 looking forward to repair
I think this issue is fixed on v 0.3.2 . I remember that the light theme was broken at some point but now I can use it again.