Skip to content

nryabykh/streamlit-aggrid-hints

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

streamlit-aggrid-hints

Open in Streamlit

This repo contains a source code for a Streamlit application that illustrates some tips and tricks for using AgGrid in Streamlit apps, as well as some non-AgGrid related hints.

Blog posts referenced this repo:

Data source: https://data.fivethirtyeight.com/

Example of usage of agstyler

import agstyler
from agstyler import PINLEFT, PRECISION_TWO

formatter = {
    'player_name': ('Player', PINLEFT),
    'team': ('Team', {'width': 80}),
    'poss': ('Possessions', {'width': 110}),
    'mp': ('mp', {'width': 80}),
    'raptor_total': ('RAPTOR', {**PRECISION_TWO, 'width': 100}),
    'war_total': ('WAR', {**PRECISION_TWO, 'width': 80}),
    'pace_impact': ('Pace Impact', {**PRECISION_TWO, 'width': 120})
}

row_number = st.number_input('Number of rows', min_value=0, value=20)
data = agstyler.draw_grid(
    df.head(row_number),
    formatter=formatter,
    fit_columns=True,
    selection='multiple',  # or 'single', or None
    use_checkbox='True',  # or False by default
    max_height=300
)

About

Some extra hints for using AgGrid in Streamlit apps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published