-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
68 lines (52 loc) · 1.4 KB
/
main.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from dash import Dash, dcc, html
import plotly.express as px
import pandas as pd
df_airports = pd.read_csv(
"https://raw.githubusercontent.com/plotly/datasets/master/2011_february_us_airport_traffic.csv"
)
app = Dash(__name__)
app.title = "SR Test App"
server = app.server
fig = px.scatter_mapbox(
df_airports,
lat="lat",
lon="long",
hover_data=["airport", "city", "state", "cnt"],
size="cnt",
color="cnt",
zoom=3,
)
fig.update_layout(mapbox_style="open-street-map")
app.layout = html.Div(
[
html.H4("Airports"),
dcc.Graph(id="graph", figure=fig),
]
)
if __name__ == "__main__":
app.run_server(debug=True)
'''
from dash import Dash, dcc, html, Input, Output
import plotly.express as px
import pandas as pd
df_airports = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/2011_february_us_airport_traffic.csv")
app = Dash(__name__)
app.title = "SR Test App"
server = app.server
app.layout = html.Div(
[dcc.Graph(id="graph")],
fig = px.scatter_mapbox(
df_airports,
lat="lat",
lon="long",
hover_data=["airport", "city", "state", "cnt"],
size="cnt",
color="cnt",
zoom=3 )
fig.update_layout(mapbox_style="open-street-map")
# Set the size of the plot
fig.update_layout(width=1500, height=900)
)
'''
if __name__ == "__main__":
app.run_server(debug=True)