-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdashtest.py
More file actions
58 lines (49 loc) · 1.34 KB
/
dashtest.py
File metadata and controls
58 lines (49 loc) · 1.34 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
57
58
# -*- coding: utf-8 -*-
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import pandas as pd
app = dash.Dash()
df = pd.read_csv('vote.csv', error_bad_lines=False)
print('****************************************')
print(df)
print('****************************************')
colors = {
'background': '#4e4e4e',
'text': '#e7ff6e'
}
app.layout = html.Div(style={'backgroundColor': colors['background']}, children=[
html.H1(
children='Australian Marriage Law Postal Survey',
style={
'textAlign': 'center',
'color': colors['text'],
'font-family': 'Helvetica'
}
),
html.Div(children='A Quick Introduction to Dash', style={
'textAlign': 'center',
'color': colors['text'],
'font-family': 'Helvetica'
}),
dcc.Graph(
id='same-sex-vote',
figure={
'data': [
go.Bar(
x=['Yes', 'No'],
y=[69, 44]
)],
'layout': {
'plot_bgcolor': colors['background'],
'paper_bgcolor': colors['background'],
'font': {
'color': colors['text']
}
}
}
)
])
if __name__ == '__main__':
app.run_server(debug=True)