-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
82 lines (64 loc) · 2.63 KB
/
app.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
# Run this app with `python app.py` and
# visit http://127.0.0.1:8050/ in your web browser.
""" Todo List :
- Load CSV button
- semi-colons separator (change parameter "sep" in pd.to_datetime() )
-
"""
from datetime import date, datetime
import dash
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
# import dash_html_components as html
# import dash_core_components as dcc
from dash import dcc, html
app = dash.Dash(__name__)
df = pd.read_csv('data_29_nov_21_gf1_c1.csv')
#fig = px.scatter(df, x="gdp per capita", y="life expectancy",
unixtime = df.unixtime
date_dfirst = pd.to_datetime(unixtime, dayfirst=True, yearfirst=False, unit="s")
print(date_dfirst)
fig = go.Figure()
fig.add_trace(go.Scatter(x=date_dfirst, y=df.condensing_temp, name='Condensing Temp',
line=dict(color='firebrick', width=1)))
fig.add_trace(go.Scatter(x=date_dfirst, y=df.liquid_temp, name = 'Liquid Temp',
line=dict(color='orange', width=1)))
fig.add_trace(go.Scatter(x=date_dfirst, y=df.subcooling, name='Subcooling',
line=dict(color='limegreen', width=1)))
fig.add_trace(go.Scatter(x=date_dfirst, y=df.evaporating_temp, name='Evaporating Temp',
line = dict(color='royalblue', width=1)))
fig.add_trace(go.Scatter(x=date_dfirst, y=df.suction_temp, name='Suction Temp',
line = dict(color='firebrick', width=1)))
fig.add_trace(go.Scatter(x=date_dfirst, y=df.superheat, name='Superheat',
line=dict(color='darkorchid', width=1)))
# Edit the layout
fig.update_layout(title='Daikin Chiller Trend',
xaxis_title='Time',
yaxis_title='Temperature (degrees C)')
# fig = px.line(df, x="unixtime", y="evaporating_temp")#,
# #size="population", color="continent", hover_name="country",
# #log_x=True #size_max=60)
fig.update_xaxes(
rangeslider_visible=True,
rangeselector=dict(
buttons=list([
dict(count=1, label="1h", step="hour", stepmode="backward"),
dict(count=2, label="2h", step="hour", stepmode="backward"),
dict(count=6, label="6h", step="hour", stepmode="backward"),
dict(count=12, label="12h", step="hour", stepmode="backward"),
dict(count=1, label="1D", step="day", stepmode="todate"),
dict(count=2, label="2D", step="day", stepmode="backward"),
dict(step="all")
])
)
)
fig.show()
app.layout = html.Div([
dcc.Graph(
id='life-exp-vs-gdp',
figure=fig
)
])
if __name__ == '__main__':
app.run_server(debug=True)