Skip to content

Commit 5d139c6

Browse files
committed
0 count is white color and added to legend
1 parent 254532c commit 5d139c6

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/Legend.svelte

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@
109109
</p>
110110
<p>Decreasing</p>
111111
</div>
112+
{:else if $currentSensor.match(/num/)}
113+
<p>{high ? high + '+' : ''}</p>
114+
<div
115+
class="legend-bar"
116+
style="background: linear-gradient(to top, {DIRECTION_THEME.countMin} 2% ,{DIRECTION_THEME.gradientMin} 2%, {DIRECTION_THEME.gradientMiddle}
117+
51%, {DIRECTION_THEME.gradientMax} 100%)" />
118+
<p>{low}</p>
112119
{:else}
113120
<p>{high ? high + '+' : ''}</p>
114121
<div

src/MapBox.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,15 +430,15 @@
430430
valueMinMax[0] = Math.max(0, valueMinMax[0]);
431431
let center = valueMinMax[0] + (valueMinMax[1] - valueMinMax[0]) / 2;
432432
433-
if ($currentSensor.match(/num/)) {
433+
if ($currentSensor.match(/num/) || $currentSensor.match(/prop/)) {
434434
stops = [
435-
[0, DIRECTION_THEME.deathMin],
435+
[0, DIRECTION_THEME.countMin],
436436
[valueMinMax[0], DIRECTION_THEME.gradientMin],
437437
[center, DIRECTION_THEME.gradientMiddle],
438438
[valueMinMax[1], DIRECTION_THEME.gradientMax],
439439
];
440440
stopsMega = [
441-
[0, DIRECTION_THEME.deathMin],
441+
[0, DIRECTION_THEME.countMin],
442442
[valueMinMax[0], DIRECTION_THEME.gradientMinMega],
443443
[center, DIRECTION_THEME.gradientMiddleMega],
444444
[valueMinMax[1], DIRECTION_THEME.gradientMaxMega],

src/theme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const DIRECTION_THEME = {
1414
steadyIcon: '&#9644;',
1515
decreasingIcon: '&#9660;',
1616
max: color_high,
17-
deathMin: '#F2F2F2',
17+
countMin: '#F2F2F2',
1818
gradientMin: color_low,
1919
gradientMiddle: color_medium,
2020
gradientMax: color_high,

0 commit comments

Comments
 (0)