data_grid.children.columnDefs[{'field': 'Province',
'headerName': 'Province',
'filter': True,
'lockPinned': True,
'cellClass': 'lock-pinned'},
{'field': 'Total Households', 'headerName': 'Total Households'}]
Setup some of the key data contiaining objects
Call self as a function.
Create interactivity in the data table
I did this as the array of callbacks are quite complex and others are triggering the maps initial load
show_doc(initial_load_table)
def update_grid(
geo_input:str, # User input from the geography dropdownk
data_type:str, # User input of type of data
measure:str, # A string contiaining the census variable and measure split by ':'
variable:str, # The state of the variable dropdown
measurePop:str, # A string contiaining the population measure
variablePop:str, # The variable to display for population dataset
grid_rows:int, # The number of rows to display
dataset:str, # The dataset to load
)->(<class 'dash_ag_grid.AgGrid.AgGrid'>, <class 'str'>): # Returns a graph object figure after being updated and the dynamic titleUpdates the focus census variable or geography dispalayed on the map
Needs to both: - update max input based on the geography selected - update the dash_grid size based on the selected row count
Updates the page size and max of the input selection based on updated geography
Updates the page size of the grid based on input
On click of download button, return the current csv in the dash grid
Call self as a function.