restructure
This commit is contained in:
11
aggrid.py
11
aggrid.py
@ -1,7 +1,5 @@
|
|||||||
from st_aggrid import AgGrid, GridOptionsBuilder
|
from st_aggrid import AgGrid, GridOptionsBuilder
|
||||||
|
|
||||||
from utils import make_key
|
|
||||||
|
|
||||||
|
|
||||||
def aggrid(df, reload_data=False):
|
def aggrid(df, reload_data=False):
|
||||||
df = df[::-1] # display in reversed chronological order
|
df = df[::-1] # display in reversed chronological order
|
||||||
@ -34,3 +32,12 @@ def aggrid(df, reload_data=False):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def make_key(df):
|
||||||
|
"""
|
||||||
|
encode the dataframe's column names into a key,
|
||||||
|
this triggers a hard reload (like F5) of the AgGrid if the columns change
|
||||||
|
"""
|
||||||
|
return "stand:" + "+".join(str(col) for col in df.columns)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
|
|
||||||
from .utils import *
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
|
|
||||||
def make_key(df):
|
|
||||||
"""
|
|
||||||
encode the dataframe's column names into a key,
|
|
||||||
this triggers a hard reload (like F5) of the AgGrid if the columns change
|
|
||||||
"""
|
|
||||||
return "stand:" + "+".join(str(col) for col in df.columns)
|
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user