Py.Cafe

huong-li-nguyen/

dash-carshare-insights

Carshare Insights

DocsPricing
  • assets/
  • 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# check out https://dash.plotly.com/ for documentation
# And check out https://py.cafe/maartenbreddels for more examples
from dash import Dash, Input, Output, callback, dcc, html
import plotly.express as px

carshare = px.data.carshare()

app = Dash(__name__)


app.layout = html.Div(
    children=[
        html.H2("Page Title", className="page-header"),
        html.Div(
            html.Div(
            children = html.Div(
                    children=
                        dcc.Graph(
                            figure=px.scatter_map(
                            carshare,
                            lat="centroid_lat",
                            lon="centroid_lon",
                            color="peak_hour",
                            size="car_hours",
                            color_continuous_scale=px.colors.cyclical.IceFire,
                            size_max=15,
                            zoom=10,
                            map_style="carto-darkmatter"
                            ),
                )
            ,
            className="figure-container"
        ),
        className="grid-layout"
        ), className="page-components")
        ]
)