Py.Cafe

banana0000/

nyc-building-energy-water-analysis

NYC Building Energy and Water Analysis

DocsPricing
  • data/
  • 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
30
import dash
import dash_bootstrap_components as dbc
from dash import Dash, html

# Initialize the Dash app with pages support
app = Dash(__name__, external_stylesheets=[dbc.themes.DARKLY], pages_folder="")

# Main layout of the app with a navbar for page navigation
app.layout = html.Div([
    # Navigation Bar with links to different pages
    dbc.Nav(
        children=[
            dbc.NavLink("Postal Codes", href="NYC City Open Map/pages/choropleth"),
            dbc.NavLink("Buildings", href="NYC City Open Map/pages/scatter"),
        ],
        pills=True,
        style={
            "background": "linear-gradient(90deg, red, blue)", 
            "height": "50px"
        },
        className="ms-auto"  # Ez jobbra igazítja az elemeket
    ),
    
    # Page content rendered based on URL
    dash.page_container,
])

if __name__ == "__main__":
    app.run(debug=True)