-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.py
More file actions
56 lines (50 loc) · 1.94 KB
/
app.py
File metadata and controls
56 lines (50 loc) · 1.94 KB
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
import dash # Servidor Flask
import dash_core_components as dcc # Graficacion
import dash_html_components as html # HTML
from covid import fechas_mexico, casos_mexico
from covid import fechas_peru, casos_peru
from covid import fechas_ecuador, casos_ecuador
from covid import fechas_brasil, casos_brasil
app = dash.Dash(__name__)
server = app.server
colors = {
'background': "#111111",
'text': "#7FDBFF"
}
app.layout = html.Div(style={'backgroundColor': colors['background']}, children=[
html.H1(
children=["Dashboard COVID-19"],
style={
'textAlign': 'center',
'color': colors['text']
}
),
dcc.Graph(
id="graph1",
figure={
'data': [
{'x': fechas_mexico[:-1], 'y': casos_mexico[:-1], 'type': 'line', 'name': 'Mexico'},
{'x': fechas_peru[:-1], 'y': casos_peru[:-1], 'type': 'line', 'name': 'Peru'},
{'x': fechas_ecuador[:-1], 'y': casos_ecuador[:-1], 'type': 'line', 'name': 'Ecuador'},
{'x': fechas_brasil[:-1], 'y': casos_brasil[:-1], 'type': 'line', 'name': 'Brasil'},
],
'layout': {
'plot_bgcolor': colors['background'],
'paper_bgcolor': colors['background'],
'font': {
'color': colors['text']
}
}
}
),
dcc.Markdown(children="""
## Casos de Covid-19
Este es un dashboard de ejemplo donde mostramos la información recogida de la API [covid19api.com](https://api.covid19api.com/) de casos confirmados diferentes países de America Latina.
Para mostrar estos resultados, se utilizó [Dash](https://dash.plotly.com/) y [Heroku](https://dashboard.heroku.com) para subir este código a la nube.
Código fuente: https://github.com/checor/covid-dashboard
""", style={
'color': colors['text']
})
])
if __name__ == "__main__":
app.run_server(debug=True)