Map Page
The page of the app that generates the map view of the data.
Setup some of the key data contiaining objects
Customize the Layout
layout
def layout():Call self as a function.
Global Variables
Build callbacks to create interaction
Update Title
For all pages of the dash app
Update location dropdown value based on map click
This callback also will trigger an update to the selected card data
Update map selections
Update the location options based on geography selected
update_geography
def update_geography(
geo_input:str, # User input from the geography dropdown
locations:[<class 'str'>], # Currently selected locations
)->[<class 'str'>]: # Returns a new list of locations to displayUpdates the dropdown_location dropdown based on the currently selected data aggregation. Check to see if current locations are in geography, if they are not then reset them.
Update the variable dropdowns based on the selection of the overall variable
Update the measure selection from clicks on the bar graph
Update map based on inputs
This updates the map for both the census page and the population page
Update the selected part of the map based on the dropdown
Update Selected Bar Graph based on inputs
update_bargraph
def update_bargraph(
data_type:str, # User input of type of data
measure:str, # A string contiaining the census variable and measure split by ':'
loc_selection:[<class 'str'>], # The selected locations, may be none
init_load:{}, # An empty dictionary always, triggers initial load
geo_input:str, # User input from the geography dropdown
variable:str, # The state of the variable dropdown
)->Figure: # Returns a graph object figure after being updated and the dynamic titleUpdates the focus census variable or geography dispalayed on the map
On click, update the contents of the kpi’s