PablocFonseca / streamlit-aggrid

Implementation of Ag-Grid component for Streamlit
https://pypi.org/project/streamlit-aggrid/
MIT License
1.05k stars 199 forks source link

V.03 theme no longer available in AgGrid #174

Closed nafets33 closed 6 months ago

nafets33 commented 1 year ago

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_aggridinit.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
)
la2yyu commented 1 year ago

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

fplanque commented 1 year ago

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.