Skip to content

Commit

Permalink
fixed switching to 7-day trend bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rhansolo committed Jul 28, 2020
1 parent a0967f1 commit a1a31f6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 24 deletions.
44 changes: 22 additions & 22 deletions src/components/Legend.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -410,28 +410,28 @@
</div>
</div>
</div>
{#if $encoding === 'color'}
{#if $signalType === 'direction'}
<div class="trend-legend-grouping">
<ul class="legend-labels">
<li>
<div class="color-block" style="background-color: {DIRECTION_THEME.increasing}" />
{@html DIRECTION_THEME.increasingIcon}
Increasing
</li>
<li>
<div class="color-block" style="background-color: {DIRECTION_THEME.steady}" />
{@html DIRECTION_THEME.steadyIcon}
Steady
</li>
<li>
<div class="color-block" style="background-color: {DIRECTION_THEME.decreasing}" />
{@html DIRECTION_THEME.decreasingIcon}
Decreasing
</li>
</ul>
</div>
{:else if isCountSignal($currentSensor)}
{#if $signalType === 'direction'}
<div class="trend-legend-grouping">
<ul class="legend-labels">
<li>
<div class="color-block" style="background-color: {DIRECTION_THEME.increasing}" />
{@html DIRECTION_THEME.increasingIcon}
Increasing
</li>
<li>
<div class="color-block" style="background-color: {DIRECTION_THEME.steady}" />
{@html DIRECTION_THEME.steadyIcon}
Steady
</li>
<li>
<div class="color-block" style="background-color: {DIRECTION_THEME.decreasing}" />
{@html DIRECTION_THEME.decreasingIcon}
Decreasing
</li>
</ul>
</div>
{:else if $encoding === 'color'}
{#if isCountSignal($currentSensor)}
<div class="legend-grouping">
<ul class="legend-labels">
{#each labels as [label1, label2]}
Expand Down
12 changes: 10 additions & 2 deletions src/components/MapBox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,11 @@
hideAll([SPIKE_LAYER, outline(SPIKE_LAYER), highlight(SPIKE_LAYER), highlight(outline(SPIKE_LAYER))]);
// show bubble layers
showAll([BUBBLE_LAYER, highlight(BUBBLE_LAYER)]);
if ($signalType === 'direction') {
hideAll([BUBBLE_LAYER, highlight(BUBBLE_LAYER)]);
} else {
showAll([BUBBLE_LAYER, highlight(BUBBLE_LAYER)]);
}
// color scale (color + stroke color)
let flatStops = stops.flat();
Expand Down Expand Up @@ -584,7 +588,11 @@
map.setPaintProperty($currentLevel, 'fill-color', MAP_THEME.countyFill);
hideAll([BUBBLE_LAYER, highlight(BUBBLE_LAYER)]);
showAll([SPIKE_LAYER, outline(SPIKE_LAYER), highlight(SPIKE_LAYER), highlight(outline(SPIKE_LAYER))]);
if ($signalType === 'direction') {
hideAll([SPIKE_LAYER, outline(SPIKE_LAYER), highlight(SPIKE_LAYER), highlight(outline(SPIKE_LAYER))]);
} else {
showAll([SPIKE_LAYER, outline(SPIKE_LAYER), highlight(SPIKE_LAYER), highlight(outline(SPIKE_LAYER))]);
}
const valueMax = valueMinMax[1],
maxHeight = ENCODING_SPIKE_THEME.maxHeight[$currentLevel],
Expand Down

0 comments on commit a1a31f6

Please sign in to comment.