started working on a website dashboard

This commit is contained in:
Remy Moll 2020-10-29 12:27:08 +01:00
parent c134135d4e
commit d4764515af
4 changed files with 44 additions and 1 deletions

View File

@ -14,7 +14,7 @@ import persistence.rw
class ClockFace(object):
"""Actual functions one might need for a clock"""
def __init__(self, text_speed=15):
def __init__(self, text_speed=18):
self.IO = led.OutputHandler(32,16)
self.tspeed = text_speed

1
dashboard/__init__.py Normal file
View File

@ -0,0 +1 @@
# Placeholder

0
dashboard/main.py Normal file
View File

42
dashboard_wrapper.py Normal file
View File

@ -0,0 +1,42 @@
import dash
from flask import Flask
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import numpy as np
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
server = Flask(__name__)
app = dash.Dash(__name__, server=server, external_stylesheets = external_stylesheets)
np.random.seed(101)
random_x = np.linspace(1,5,20)
random_y = np.exp(random_x)
app.layout = html.Div(children = [
html.H1("Hello wolrd!"),
dcc.Graph(
id="scatter",
figure = {
"data" : [
go.Scatter(
x = random_x,
y = random_y,
mode="markers"
)
],
"layout" : go.Layout(
title="This is a test",
xaxis={"title" : "x"},
yaxis={"title" : "y"}
)
}
),
])
if __name__ == "__main__":
app.run_server(host="0.0.0.0")