-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomponents.py
More file actions
39 lines (29 loc) · 1.02 KB
/
Copy pathcomponents.py
File metadata and controls
39 lines (29 loc) · 1.02 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
import dash_core_components as dcc
import dash_html_components as html
from data import getData
data = getData()
def build_figure_grid(layout_grid):
return [html.Div(className='columns',
children=[html.Div(className=f'column is-12-mobile is-{12 / len(row)}', children=[x]) for x in row])
for row in layout_grid]
def selector():
ccaa = data.get_ccaa()
return dcc.Dropdown(
id='selector',
options=[{'label': x, 'value': x} for x in ccaa],
value='Total'
)
def comparator_selector():
ccaa = data.get_ccaa()
return dcc.Dropdown(
id='comporator-selector',
options=[{'label': x, 'value': x} for x in filter(lambda i: i != 'Total', ccaa)],
multi=True,
)
def box(color, value, text):
return html.Div(className=f'column is-3', children=[
html.Div(className=f'notification {color}', children=[
html.H1(className='title', children=text),
html.P(className='subtitle', children=value)
])
])