-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
122 lines (112 loc) · 3.59 KB
/
test.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
import dash
import dash_core_components as dcc
import dash_html_components as html
# external CSS stylesheets
external_stylesheets = [
'https://codepen.io/chriddyp/pen/bWLwgP.css',
{
'href': '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css',
'rel': 'stylesheet',
'id':'bootstrap-css'
},
{
'href': 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css',
'rel': 'stylesheet',
'integrity': 'sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm',
'crossorigin': 'anonymous'
}
]
# external JavaScript files
external_scripts = [
{'src': '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js'},
{'src': '//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'}
]
app = dash.Dash(__name__,
external_scripts=external_scripts,
external_stylesheets=external_stylesheets)
app = dash.Dash(meta_tags=[
# A description of the app, used by e.g.
# search engines when displaying search results.
{
'name': 'description',
'content': 'My description'
},
# A tag that tells Internet Explorer (IE)
# to use the latest renderer version available
# to that browser (e.g. Edge)
{
'http-equiv': 'X-UA-Compatible',
'content': 'IE=edge'
},
# A tag that tells the browser not to scale
# desktop widths to fit mobile screens.
# Sets the width of the viewport (browser)
# to the width of the device, and the zoom level
# (initial scale) to 1.
#
# Necessary for "true" mobile support.
{
'name': 'viewport',
'content': 'width=device-width, initial-scale=1.0'
},
{
'charset':'utf-8'
}
])
app.layout = html.Div(children=[
# html.Div(
# className="app-header",
# children=[
# html.Div('Plotly Dash', className="app-header--title")
# ]
# ),
# html.Div(
# children=html.Div([
# html.H5('Overview'),
# html.Div('''
# This is an example of a simple Dash app with
# local, customized CSS.
# ''')
# ])
# ),
html.Div(
className="page-wrapper chiller-theme toggled",
children=[
html.A(
html.I(
className="fas fa-bars"
),
id="show-sidebar",
className="btn btn-sm btn-dark",
href="#")
],
Children=[
html.Nav(
html.Div(
className="sidebar-content",
Children=[
html.Div(
html.A("pro sidebar",href="#"),
className="sidebar-brand"
),
],
),
id="sidebar" ,
className="sidebar-wrapper"),
],
),
dcc.Graph(
id='example-graph',
figure={
'data': [
{'x': [1, 2, 3], 'y': [4, 1, 2], 'type': 'bar', 'name': 'SF'},
{'x': [1, 2, 3], 'y': [2, 4, 5], 'type': 'bar', 'name': u'Montréal'},
],
'layout': {
'title': 'Dash Data Visualization'
}
}
)
])
if __name__ == '__main__':
app.run_server(debug=True)