forked from dollodart/graph-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
layouts.py
67 lines (62 loc) · 3.41 KB
/
layouts.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
import dash_html_components as html
import dash_core_components as dcc
import dash_daq as daq
from data import options, dlists
show = {'height':'auto'}
hide = {'height':'0', 'overflow':'hidden','line-height':0,'display':'block'}
main_layout = html.Div(id='main',children=[
# dependent and independent variables (x- and y-axes)
html.Div(style=dict(columnCount=3), children=[html.H6("Select x-axis"),
html.H6("Select y-axis"),
html.H6("Cartesian product")]),
html.Div(style=dict(columnCount=3), children=[dcc.Dropdown(options=options, id='x-axis', multi=True, value=['dateRep']),
dcc.Dropdown(options=options, id='y-axis', multi=True, value=['cases_weekly']),
daq.ToggleSwitch(id='cartesian-prod',value=False)
]),
# legend options (symbol, size, color)
html.Div(style=dict(columnCount=3), children=[html.H6("Select symbol"),
html.H6("Select size"),
html.H6("Select color")]),
html.Div(style=dict(columnCount=3), children=[
dcc.Dropdown(options=options, id='symbol'),
dcc.Dropdown(options=options, id='size'),
dcc.Dropdown(options=options, id='color')]),
# hover data selection
html.Div([html.H6("Select Hover Data"),
dcc.Dropdown(options=options, id='hover-data', multi=True)]),
html.Div([html.H6("Select smoothing fits"),
dcc.RadioItems(options=[{'label':'Whittaker', 'value':'whittaker'},
{'label':'Moving Average', 'value':'moving-average'},
{'label':'None', 'value':'none'}], value='none', id='smoother'),
html.Div(id='smoother-slider-container',children=[dcc.Slider(min=0,max=100,value=5,step=1,id='smoother-slider')])])
])
aliasing_layout = html.Div(id='aliasing',
children=[html.P(id='aliasing-description',
children="""Add aliases for long or hard to remember column names to
easily enter in the dropdown boxes."""),
html.Div(style=dict(columnCount=3),
children=[html.H6("Name"),
html.H6("Alias"),
html.H6("Alias History")]),
html.Div(style=dict(columnCount=3),
children=[html.Div(children=[dcc.Dropdown(options=options, id='name')]),
html.Div(children=[dcc.Input(id='alias', value='')]),
html.Div(children=[dcc.Textarea(
id='alias-history',
value='',
disabled=True)])
]),
html.Div(html.Button(id='submit-alias', n_clicks=0, children='Submit')),
])
filtering_layout = html.Div(id='filtering',children=[
html.P(id='filtering-description',
children="""Apply filters to the dataset. For discrete
variables, comma separate like "A,B" in the lower bound. For
continuous variables, insert lower and upper bound as
integers or floats."""),
html.Button("Add Filter", id="add-filter", n_clicks=0),
html.Div(id='dropdown-container', children=[]),
html.Div(id='dropdown-container-output', children=[dcc.Textarea(value='',id='current-filters')])
])
for dl in dlists:
filtering_layout.children.append(dl)