Skip to content

Commit a1a31f6

Browse files
committed
fixed switching to 7-day trend bug
1 parent a0967f1 commit a1a31f6

File tree

2 files changed

+32
-24
lines changed

2 files changed

+32
-24
lines changed

src/components/Legend.svelte

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -410,28 +410,28 @@
410410
</div>
411411
</div>
412412
</div>
413-
{#if $encoding === 'color'}
414-
{#if $signalType === 'direction'}
415-
<div class="trend-legend-grouping">
416-
<ul class="legend-labels">
417-
<li>
418-
<div class="color-block" style="background-color: {DIRECTION_THEME.increasing}" />
419-
{@html DIRECTION_THEME.increasingIcon}
420-
Increasing
421-
</li>
422-
<li>
423-
<div class="color-block" style="background-color: {DIRECTION_THEME.steady}" />
424-
{@html DIRECTION_THEME.steadyIcon}
425-
Steady
426-
</li>
427-
<li>
428-
<div class="color-block" style="background-color: {DIRECTION_THEME.decreasing}" />
429-
{@html DIRECTION_THEME.decreasingIcon}
430-
Decreasing
431-
</li>
432-
</ul>
433-
</div>
434-
{:else if isCountSignal($currentSensor)}
413+
{#if $signalType === 'direction'}
414+
<div class="trend-legend-grouping">
415+
<ul class="legend-labels">
416+
<li>
417+
<div class="color-block" style="background-color: {DIRECTION_THEME.increasing}" />
418+
{@html DIRECTION_THEME.increasingIcon}
419+
Increasing
420+
</li>
421+
<li>
422+
<div class="color-block" style="background-color: {DIRECTION_THEME.steady}" />
423+
{@html DIRECTION_THEME.steadyIcon}
424+
Steady
425+
</li>
426+
<li>
427+
<div class="color-block" style="background-color: {DIRECTION_THEME.decreasing}" />
428+
{@html DIRECTION_THEME.decreasingIcon}
429+
Decreasing
430+
</li>
431+
</ul>
432+
</div>
433+
{:else if $encoding === 'color'}
434+
{#if isCountSignal($currentSensor)}
435435
<div class="legend-grouping">
436436
<ul class="legend-labels">
437437
{#each labels as [label1, label2]}

src/components/MapBox.svelte

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,11 @@
547547
hideAll([SPIKE_LAYER, outline(SPIKE_LAYER), highlight(SPIKE_LAYER), highlight(outline(SPIKE_LAYER))]);
548548
549549
// show bubble layers
550-
showAll([BUBBLE_LAYER, highlight(BUBBLE_LAYER)]);
550+
if ($signalType === 'direction') {
551+
hideAll([BUBBLE_LAYER, highlight(BUBBLE_LAYER)]);
552+
} else {
553+
showAll([BUBBLE_LAYER, highlight(BUBBLE_LAYER)]);
554+
}
551555
552556
// color scale (color + stroke color)
553557
let flatStops = stops.flat();
@@ -584,7 +588,11 @@
584588
map.setPaintProperty($currentLevel, 'fill-color', MAP_THEME.countyFill);
585589
hideAll([BUBBLE_LAYER, highlight(BUBBLE_LAYER)]);
586590
587-
showAll([SPIKE_LAYER, outline(SPIKE_LAYER), highlight(SPIKE_LAYER), highlight(outline(SPIKE_LAYER))]);
591+
if ($signalType === 'direction') {
592+
hideAll([SPIKE_LAYER, outline(SPIKE_LAYER), highlight(SPIKE_LAYER), highlight(outline(SPIKE_LAYER))]);
593+
} else {
594+
showAll([SPIKE_LAYER, outline(SPIKE_LAYER), highlight(SPIKE_LAYER), highlight(outline(SPIKE_LAYER))]);
595+
}
588596
589597
const valueMax = valueMinMax[1],
590598
maxHeight = ENCODING_SPIKE_THEME.maxHeight[$currentLevel],

0 commit comments

Comments
 (0)