Py.Cafe

adamschroeder.m/

dash-building-permits-visualization

Building Permits Issued Visualization

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# check out https://dash.plotly.com/ for Dash documentation
# check out https://plotly.com/python for Plotly documentation
# check out Plotly High Level refernece docs: https://plotly.com/python-api-reference/plotly.express.html

from dash import Dash, Input, Output, callback, dcc, html
import pandas as pd
import plotly.express as px

# Best to grab the raw csv data link from GitHub
df = pd.read_csv('https://raw.githubusercontent.com/plotly/Figure-Friday/refs/heads/main/2025/week-25/Building_Permits_Issued_Past_180_Days.csv')


# Use this sectiont to slice, clean, filter data to prepare it for the figure
df = df.dropna(subset=['fee'])



# Build the figure
fig = px.scatter_map(df, lat="latitude_perm", lon="longitude_perm", size='fee', color='fee',
                        map_style='carto-voyager',zoom=9, height=550)


app = Dash(__name__)
app.layout = html.Div(
    children=[
        # assign the fig to the 'figure' property to view
        dcc.Graph(figure=fig)
    ]
)