-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstarter.py
More file actions
61 lines (48 loc) · 1.49 KB
/
starter.py
File metadata and controls
61 lines (48 loc) · 1.49 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
59
60
61
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
from dash.dependencies import Input, Output, State
import plotly.figure_factory as ff
import pandas as pd
import dash_daq as daq
########### Define a few variables ######
tabtitle = 'Dash DAQ'
sourceurl = 'https://dash.plot.ly/dash-daq'
sourceurl2 = 'https://dash.plot.ly/state'
githublink = 'https://github.com/austinlasseter/dash-daq-state'
########### Initiate the app
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
server = app.server
app.title=tabtitle
######### Define the figure
x_list=['monkeys', 'bananas']
y_list=[10,5]
myfavoritecolor=['Tan', 'Yellow']
mytitle='zoo time fun'
mydata = [go.Bar(x=x_list,
y=y_list,
marker=dict(color=myfavoritecolor))]
mylayout = go.Layout(
title = mytitle,
xaxis = dict(title = 'Labels go here!'),
yaxis = dict(title = 'Numbers go here!'))
myfigure = go.Figure(data=mydata, layout=mylayout)
########### Layout
app.layout = html.Div(children=[
html.H1('This is the header'),
dcc.Graph(id='my-graph', figure=myfigure),
# Footer
html.Br(),
html.A('Code on Github', href=githublink),
html.Br(),
html.A("Data Source", href=sourceurl),
html.Br(),
html.A("Data Source", href=sourceurl2),
]
)
########### Callback
############ Deploy
if __name__ == '__main__':
app.run_server(debug=True)