streamlit-aggrid icon indicating copy to clipboard operation
streamlit-aggrid copied to clipboard

V.03 theme no longer available in AgGrid

Open nafets33 opened this issue 2 years ago • 2 comments

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
)

nafets33 avatar Dec 19 '22 18:12 nafets33

theme "balham", "alpine", "material", "streamlit" is work, others are not。 looking forward to repair

la2yyu avatar Jan 04 '23 17:01 la2yyu

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.

fplanque avatar Jan 29 '23 16:01 fplanque