Skip to content
Snippets Groups Projects
Commit fc7b63e9 authored by Anthony Horton's avatar Anthony Horton
Browse files

Slightly more responsive plot size, add data picker

parent 1501a985
Branches
No related tags found
No related merge requests found
......@@ -73,6 +73,6 @@ def make_plotly_plots(data_frame):
fig.update_yaxes(title_text="hPa", row=3, col=1)
fig.update_yaxes(title_text="μg/m³", row=4, col=1)
fig.update_layout(height=810, showlegend=False)
fig.update_layout(autosize=True, showlegend=False)
return fig
""" Runs the web dashboard. """
import datetime
import dash
import dash_core_components as dcc
import dash_html_components as html
......@@ -47,7 +49,7 @@ app.layout = html.Div(children=[
className='three columns'),
html.Div(daq.Gauge(id='pressure_gauge',
label="Pressure (hPa)",
scale={'start': 900, 'interval': 10, 'labelInterval': 2},
scale={'start': 900, 'interval': 10, 'labelInterval': 5},
min=900,
max=1100,
showCurrentValue=True),
......@@ -68,8 +70,17 @@ app.layout = html.Div(children=[
'marginBottom': '0'},
className='row'),
html.Div(dcc.Graph(id='live-plots')
html.Div(["Plot date range: ",
dcc.DatePickerRange(id='plot-date-range',
display_format='YYYY-MM-DD',
start_date=datetime.date.today() - datetime.timedelta(days=1))
], style={'textAlign': 'center'}),
html.Div(dcc.Graph(id='live-plots',
style={'height': '55vh',
'minHeight': '550px'})
),
dcc.Interval(id='interval-component',
interval=60*1000, # in milliseconds
n_intervals=0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment