-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbanner.py
125 lines (112 loc) · 5.04 KB
/
banner.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import flask
from flask_caching import Cache
import plotly.graph_objects as go
import plotly.express as px
import dash
import dash_table
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from dash.dependencies import State, Input, Output
import dash_daq as daq
from utils import dash_reusable_components as drc
import numpy as np
import pandas as pd
import json
import os
import random
import base64
from state_list import *
state_list = get_state_list()
state_map = get_state_map()
state_districts_data = get_state_districts_data()
vaccine_list = get_vaccine_list()
logo_png = 'assets/chaos.png'
logo_base64 = base64.b64encode(open(logo_png, 'rb').read()).decode('ascii')
def generate_section_banner(title):
return html.Div(className="section-banner", children=title)
def build_banner():
return html.Div(
id="banner",
className="banner",
children=[
html.Div(
children=[
html.Div(
id="banner-text",
children=[
html.H5("Monitoring CoVID-19 Vaccine campaign"),
# html.H6("Vaccine efficacy and herd immunity predictor"),
# html.H2('CovIntel', style={'font-family' : "'Raleway', sans-serif", 'font-weight' : '900', 'margin-bottom' : '0'})
],
style={'width': '50%', 'display': 'inline-block'}
),
html.Div(
id="banner-logo",
children=[
html.Button(
id="learn-more-button", children="LEARN MORE", n_clicks=0, style={'display' : 'none'}
),
# html.Img(id="logo", src=""),
# html.Img(src='data:image/png;base64,{}'.format(logo_base64), style={'margin-bottom' : '0.5rem'}),
html.H2('CovIntel', style={'font-family' : "'Raleway', sans-serif", 'font-weight' : '900', 'margin-bottom' : '0'})
],
style={'width': '50%', 'display': 'inline-block', 'text-align': 'right'}
)
]
),
html.Div(
id="banner-select-location",
# className="twelve columns",
children=[
# generate_section_banner(),
# html.Div(
# className='section-banner',
# children="Select a State, District & Vaccine",
# style={'text-align': 'center'}
# ),
html.Hr(
style={'margin-top':'0.2rem', 'margin-bottom':'0.5rem'}
),
# Choose State
html.Div(
drc.NamedDropdown(
name="Select State",
id="dropdown-select-state",
options=[{"label": state_map[i]["state"], "value": i} for i in state_list],
clearable=False,
searchable=True,
value="AP",
),
style={'width': '40%', 'display': 'inline-block'}
),
html.Div(
drc.NamedDropdown(
name="Select District",
id="dropdown-select-district",
# options=[{"label": state_map[i]["state"], "value": i} for i in state_list],
options= [ {"label" : i, "value" : i} for i in state_districts_data['states'][0]['districts'] ],
clearable=False,
searchable=True,
value="Chittoor",
),
style={'width': '30%', 'display': 'inline-block'}
),
html.Div(
drc.NamedDropdown(
name="Select Vaccine",
id="dropdown-select-vaccine",
# options=[{"label": state_map[i]["state"], "value": i} for i in state_list],
options= [ {"label" : i, "value" : i} for i in vaccine_list ],
clearable=False,
searchable=True,
value="Chittoor",
),
style={'width': '30%', 'display': 'inline-block'}
)
],
style={'width': '100%', 'display': 'inline-block'}
),
],
style={'width': '100%', 'display': 'inline-block'}
)