Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d6c1188
fix: lab mode in TS
sgratzl Apr 13, 2021
c356f68
feat: simple backfil vis
sgratzl Apr 13, 2021
4282255
build(deps): update
sgratzl Apr 14, 2021
a9eb317
refactor: Vega typings
sgratzl Apr 14, 2021
bf63430
feat: more backfill prototypes
sgratzl Apr 14, 2021
2ec1d39
feat: more backfil protoypes
sgratzl Apr 14, 2021
51b08d0
Merge remote-tracking branch 'origin/sgratzl/typescript' into sgratzl…
sgratzl Apr 19, 2021
570e94c
feat: backfil profile by weekday
sgratzl Apr 19, 2021
37fe752
Merge branch 'sgratzl/restructure2' into sgratzl/backfill
sgratzl Apr 20, 2021
2afa831
feat: prepare for backfill time series
sgratzl Apr 20, 2021
62b6f2d
feat: prepare specific loading example
sgratzl Apr 20, 2021
7febc61
Merge branch 'sgratzl/backfill' into sgratzl/backfill2
sgratzl May 6, 2021
7b585a7
feat: first backfil profile viz
sgratzl May 6, 2021
0c46535
feat: add issue based backfill visz
sgratzl May 6, 2021
6e3cc00
feat: add anchor hint
sgratzl May 7, 2021
effc427
feat: generalized backfill viz
sgratzl May 7, 2021
6b60263
feat: weekday profile
sgratzl May 7, 2021
8d1c29f
feat: delete old component
sgratzl May 7, 2021
505b84e
style: show more indicators in dropdown
sgratzl May 7, 2021
d005e84
refactor: move backfill to own tab
sgratzl May 10, 2021
126b603
feat: add boxplot chart + cleanup ui
sgratzl May 10, 2021
04df99c
Merge remote-tracking branch 'origin/dev' into sgratzl/backfill2
sgratzl May 10, 2021
22772a5
style: small style changes
sgratzl May 10, 2021
ee27075
Merge remote-tracking branch 'origin/dev' into sgratzl/backfill2
sgratzl May 17, 2021
7d99d30
refactor: move to store for persistence
sgratzl May 17, 2021
6973c7b
fix: change texts and labels
sgratzl May 17, 2021
8e9b667
fix: small text changes
sgratzl May 17, 2021
49b5f3c
fix: remove import
sgratzl May 17, 2021
c1d79a9
fix: keep indicator when switching tabs
sgratzl May 19, 2021
2f0b3f5
feat: add tooltip for backfill
sgratzl May 19, 2021
898d5c7
feat: tune day-to-day change legend
sgratzl May 19, 2021
cd2f86f
feat: tune color scale
sgratzl May 20, 2021
680da8c
Merge branch 'bot/update-docs' into sgratzl/backfill2
sgratzl May 21, 2021
bf75af0
Merge branch 'sgratzl/asyncvega' into sgratzl/backfill2
sgratzl May 21, 2021
ef0bb8e
feat: use divergent value color scale
sgratzl May 21, 2021
21f184e
feat: add description texts
sgratzl May 21, 2021
9a7680f
Merge remote-tracking branch 'origin/dev' into sgratzl/backfill2
sgratzl May 25, 2021
f0e467c
refactor: change to day-of-week
sgratzl May 25, 2021
ee9f0a2
docs: fix typo
sgratzl May 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/blocks/HistoryLineTooltip.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { formatDateShortWeekdayAbbr } from '../formats';
import { formatDateShortDayOfWeekAbbr } from '../formats';
import SensorValue from '../components/SensorValue.svelte';

export let hidden = false;
Expand All @@ -22,7 +22,7 @@
</script>

<div aria-label="tooltip" class="tooltip" class:hidden>
<h5>{formatDateShortWeekdayAbbr(item.date_value)}</h5>
<h5>{formatDateShortDayOfWeekAbbr(item.date_value)}</h5>
<table>
{#each items as i}
<tr>
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/IndicatorWarning.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { formatDateYearWeekdayAbbr } from '../formats';
import { formatDateYearDayOfWeekAbbr } from '../formats';
import { getLevelInfo } from '../stores';

/**
Expand All @@ -22,6 +22,6 @@
</div>
{:else if date.sensorTimeFrame.max < date.value}
<div data-uk-alert class="uk-alert-warning">
The indicator "{sensor.name}" is not available for {formatDateYearWeekdayAbbr(date.value)}, yet.
The indicator "{sensor.name}" is not available for {formatDateYearDayOfWeekAbbr(date.value)}, yet.
</div>
{/if}
6 changes: 3 additions & 3 deletions src/blocks/MaxDateHint.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import UIKitHint from '../components/UIKitHint.svelte';
import { formatDateYearWeekdayAbbr } from '../formats';
import { formatDateYearDayOfWeekAbbr } from '../formats';
import { stats } from '../stores';
import { determineStatsInfo } from '../stores/stats';
/**
Expand All @@ -20,9 +20,9 @@

{#if info}
<UIKitHint
title="Most recent available date:<br>&nbsp;{formatDateYearWeekdayAbbr(
title="Most recent available date:<br>&nbsp;{formatDateYearDayOfWeekAbbr(
info.maxTime,
)}<br>Last update on:<br>&nbsp;{formatDateYearWeekdayAbbr(info.maxIssue)}"
)}<br>Last update on:<br>&nbsp;{formatDateYearDayOfWeekAbbr(info.maxIssue)}"
noMargin={suffix.length > 0}
inline={suffix.length === 0}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/RegionMapTooltip.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { formatDateShortWeekdayAbbr } from '../formats';
import { formatDateShortDayOfWeekAbbr } from '../formats';
import { levelMegaCounty } from '../stores/constants';
import { getStateOfCounty } from '../data/regions';
import SensorValue from '../components/SensorValue.svelte';
Expand Down Expand Up @@ -61,7 +61,7 @@
</tr>
{/if}
<tr>
<th>{formatDateShortWeekdayAbbr(item.date_value)}</th>
<th>{formatDateShortDayOfWeekAbbr(item.date_value)}</th>
<td>
<SensorValue {sensor} value={item.value} medium />
</td>
Expand Down
3 changes: 2 additions & 1 deletion src/components/AboutSection.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<script>
export let details = '';
export let className = '';
</script>

<div class="grid-3-11 mobile-invert">
<div class="grid-3-11 mobile-invert {className}">
{#if details}
<details>
<summary>
Expand Down
76 changes: 66 additions & 10 deletions src/components/OptionPicker.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,67 @@
export let value = null;
export let label = 'Options';
/**
* @type {}
* @type {{label: string, value: string}[]}
*/
export let options = [];

/**
* @type {'select' | 'text' | 'number' | 'date'}
*/
export let type = 'select';

export let className = '';
export let style = undefined;

export let modern = false;

export let step = undefined;
export let min = undefined;
export let max = undefined;
export let placeholder = undefined;
</script>

<div class="option-picker {className}" {style}>
<span class="option-picker-label">{label}</span>
<select {name} class="option-picker-input" bind:value on:blur {required}>
<slot>
{#each options as option}
<option value={option.value}>{option.label}</option>
{/each}
</slot>
</select>
<span class="option-picker-label" class:modern>{label}</span>
{#if type === 'select'}
<select {name} class="option-picker-input" class:modern bind:value on:blur {required}>
<slot>
{#each options as option}
<option value={option.value}>{option.label}</option>
{/each}
</slot>
</select>
{:else if type === 'text'}
<input {name} class="option-picker-input" class:modern bind:value on:change {required} {placeholder} />
{:else if type === 'number'}
<input
type="number"
{name}
class="option-picker-input"
class:modern
bind:value
on:change
{required}
{step}
{min}
{max}
{placeholder}
/>
{:else if type === 'date'}
<input
type="date"
{name}
class="option-picker-input"
class:modern
bind:value
on:change
{required}
{step}
{min}
{max}
{placeholder}
/>
{/if}
</div>

<style>
Expand All @@ -35,13 +79,22 @@

.option-picker-input {
display: block;
width: 100%;
padding: 8px 0px 8px 6px;
border: 1px solid #d3d4d8;
background: white;
font-size: 0.875rem;
line-height: 1rem;
border-radius: 4px;
color: inherit;
box-sizing: border-box;
font-weight: 400;
color: #666;
}

.option-picker-input.modern {
padding: 10px 6px;
font-size: 0.75rem;
height: 50px;
}

.option-picker-input > :global(option) {
Expand All @@ -57,4 +110,7 @@
background: white;
line-height: 1;
}
.option-picker-label.modern {
left: 24px;
}
</style>
12 changes: 6 additions & 6 deletions src/components/SensorDatePicker2.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import calendarIcon from '!raw-loader!@fortawesome/fontawesome-free/svgs/solid/calendar.svg';
import { parseAPITime } from '../data';
import { times, stats } from '../stores';
import { formatDateShortWeekdayAbbr, formatDateYearWeekdayAbbr } from '../formats';
import { formatDateShortDayOfWeekAbbr, formatDateYearDayOfWeekAbbr } from '../formats';
import { timeDay } from 'd3-time';
import { determineStatsInfo } from '../stores/stats';

Expand Down Expand Up @@ -54,7 +54,7 @@
bind:selected={value}
start={startEndDates[0]}
end={startEndDates[1]}
formattedSelected={formatDateShortWeekdayAbbr(value)}
formattedSelected={formatDateShortDayOfWeekAbbr(value)}
>
<button
aria-label="selected date"
Expand All @@ -65,7 +65,7 @@
<span class="selected-date-icon">
{@html calendarIcon}
</span>
<span>{formatDateShortWeekdayAbbr(value)}</span>
<span>{formatDateShortDayOfWeekAbbr(value)}</span>
</button>
<svelte:fragment slot="footer">
{#if info}
Expand All @@ -75,9 +75,9 @@
on:click={() => (value = startEndDates[1])}
class="uk-link-muted"
>
{formatDateYearWeekdayAbbr(info.maxTime)}
{formatDateYearDayOfWeekAbbr(info.maxTime)}
</button>
updated on <span class="uk-text-nowrap">{formatDateYearWeekdayAbbr(info.maxIssue)}</span>.
updated on <span class="uk-text-nowrap">{formatDateYearDayOfWeekAbbr(info.maxIssue)}</span>.
</p>
{/if}
</svelte:fragment>
Expand All @@ -87,7 +87,7 @@
<span class="inline-svg-icon">
{@html calendarIcon}
</span>
<span>{formatDateShortWeekdayAbbr(value)}</span>
<span>{formatDateShortDayOfWeekAbbr(value)}</span>
</button>
{/if}
<button
Expand Down
4 changes: 2 additions & 2 deletions src/components/SparkLineTooltip.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { formatDateShortWeekdayAbbr } from '../formats';
import { formatDateShortDayOfWeekAbbr } from '../formats';
import SensorValue from './SensorValue.svelte';

export let hidden = false;
Expand All @@ -15,7 +15,7 @@
</script>

<div aria-label="tooltip" class="tooltip" class:hidden>
<h5>{formatDateShortWeekdayAbbr(item.date_value)}</h5>
<h5>{formatDateShortDayOfWeekAbbr(item.date_value)}</h5>
<table>
<tr>
<th>{item.displayName}</th>
Expand Down
30 changes: 15 additions & 15 deletions src/components/TrendTextSummary.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { formatDateWeekday, formatDateYearWeekdayAbbr } from '../formats';
import { formatDateDayOfWeek, formatDateYearDayOfWeekAbbr } from '../formats';
import { WINDOW_SIZE } from '../stores/params';
import SensorValue from './SensorValue.svelte';
import TrendText from './TrendText.svelte';
Expand Down Expand Up @@ -33,15 +33,15 @@
<slot />
{#await trend}
We don't have data on the historical context for this indicator on
{formatDateWeekday(date.value, true)}.
{formatDateDayOfWeek(date.value, true)}.
{:then d}
{#if d.isUnknown}
We don't have data on the historical context for this indicator on
{formatDateWeekday(date.value, true)}.
{formatDateDayOfWeek(date.value, true)}.
{:else if d.highValuesAre === 'neutral'}
{#if d.isNeutral}
On
{formatDateWeekday(date.value, true)}
{formatDateDayOfWeek(date.value, true)}
<strong>{sensor.value.name}</strong>
has
<strong>
Expand All @@ -54,10 +54,10 @@
<SensorValue {sensor} value={d.min ? d.min.refValue : null} medium /></strong
>
on
<strong>{formatDateYearWeekdayAbbr(d.minDate, true)}</strong>.
<strong>{formatDateYearDayOfWeekAbbr(d.minDate, true)}</strong>.
{:else if +date.value === +d.minDate}
On
{formatDateWeekday(date.value, true)}
{formatDateDayOfWeek(date.value, true)}
<strong>{sensor.value.name}</strong>
has
<strong>
Expand All @@ -70,10 +70,10 @@
<SensorValue {sensor} value={d.max ? d.max.refValue : null} medium /></strong
>
on
<strong>{formatDateYearWeekdayAbbr(d.maxDate, true)}</strong>.
<strong>{formatDateYearDayOfWeekAbbr(d.maxDate, true)}</strong>.
{:else if +date.value === +d.maxDate}
On
{formatDateWeekday(date.value, true)}
{formatDateDayOfWeek(date.value, true)}
<strong>{sensor.value.name}</strong>
has
<strong>
Expand All @@ -86,10 +86,10 @@
<SensorValue {sensor} value={d.min ? d.min.refValue : null} medium /></strong
>
on
<strong>{formatDateYearWeekdayAbbr(d.minDate, true)}</strong>.
<strong>{formatDateYearDayOfWeekAbbr(d.minDate, true)}</strong>.
{:else}
On
{formatDateWeekday(date.value, true)}
{formatDateDayOfWeek(date.value, true)}
<strong>{sensor.value.name}</strong>
has
<strong>
Expand All @@ -102,11 +102,11 @@
<SensorValue {sensor} value={d.min ? d.min.refValue : null} medium /></strong
>
on
<strong>{formatDateYearWeekdayAbbr(d.minDate, true)}</strong>.
<strong>{formatDateYearDayOfWeekAbbr(d.minDate, true)}</strong>.
{/if}
{:else if +date.value === +d.worstDate}
On
{formatDateWeekday(date.value, true)}
{formatDateDayOfWeek(date.value, true)}
<strong>{sensor.value.name}</strong>
was the
{WINDOW_SIZE}
Expand All @@ -118,10 +118,10 @@
<SensorValue {sensor} value={d.best ? d.best.refValue : null} medium /></strong
>
on
<strong>{formatDateYearWeekdayAbbr(d.bestDate, true)}</strong>.
<strong>{formatDateYearDayOfWeekAbbr(d.bestDate, true)}</strong>.
{:else}
On
{formatDateWeekday(date.value, true)}
{formatDateDayOfWeek(date.value, true)}
<strong>{sensor.value.name}</strong>
was
<strong>
Expand All @@ -134,7 +134,7 @@
<SensorValue {sensor} value={d.worst ? d.worst.refValue : null} medium /></strong
>
on
<strong>{formatDateYearWeekdayAbbr(d.worstDate, true)}</strong>.
<strong>{formatDateYearDayOfWeekAbbr(d.worstDate, true)}</strong>.
{/if}
{/await}
</p>
Loading