Skip to content

Commit dd2cc84

Browse files
committed
Removed 'similar' logic from higher/lower values in charts
1 parent 73f3d17 commit dd2cc84

2 files changed

Lines changed: 1 addition & 9 deletions

File tree

‎app/app.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,7 @@ def _metric_comparison(entity_key):
199199
results[period] = (None, None)
200200
else:
201201
pct = (curr_val - prev_val) / prev_val * 100
202-
if abs(pct) < 2:
203-
results[period] = ('similar', None)
204-
elif pct > 0:
202+
if pct > 0:
205203
results[period] = ('up', round(abs(pct)))
206204
else:
207205
results[period] = ('down', round(abs(pct)))

‎app/static/metric/index.html‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ <h1><a href="/">Air Quality Monitor</a></h1>
9494
<div class="comparison-line"><span style="color:#ef4444;">▲ {{ day_delta }}%</span> higher than the past 24h</div>
9595
{% elif day_direction == 'down' %}
9696
<div class="comparison-line"><span style="color:#22c55e;">▼ {{ day_delta }}%</span> lower than the past 24h</div>
97-
{% elif day_direction == 'similar' %}
98-
<div class="comparison-line" style="color:#888;">≈ similar to the past 24h</div>
9997
{% endif %}
10098
<div class="chart-container">
10199
<canvas id="chart"></canvas>
@@ -114,8 +112,6 @@ <h1><a href="/">Air Quality Monitor</a></h1>
114112
<div class="comparison-line"><span style="color:#ef4444;">▲ {{ week_delta }}%</span> higher than the past 7d</div>
115113
{% elif week_direction == 'down' %}
116114
<div class="comparison-line"><span style="color:#22c55e;">▼ {{ week_delta }}%</span> lower than the past 7d</div>
117-
{% elif week_direction == 'similar' %}
118-
<div class="comparison-line" style="color:#888;">≈ similar to the past 7d</div>
119115
{% endif %}
120116
<div class="chart-container">
121117
<canvas id="chart7d"></canvas>
@@ -133,8 +129,6 @@ <h1><a href="/">Air Quality Monitor</a></h1>
133129
<div class="comparison-line"><span style="color:#ef4444;">▲ {{ month_delta }}%</span> higher than the past 30d</div>
134130
{% elif month_direction == 'down' %}
135131
<div class="comparison-line"><span style="color:#22c55e;">▼ {{ month_delta }}%</span> lower than the past 30d</div>
136-
{% elif month_direction == 'similar' %}
137-
<div class="comparison-line" style="color:#888;">≈ similar to the past 30d</div>
138132
{% endif %}
139133
<div class="chart-container">
140134
<canvas id="chart30d"></canvas>

0 commit comments

Comments
 (0)