defaults
This commit is contained in:
@@ -46,14 +46,7 @@
|
|||||||
|
|
||||||
let params = $state({
|
let params = $state({
|
||||||
...defaultParameters,
|
...defaultParameters,
|
||||||
hourly: [
|
hourly: ['temperature_2m', 'precipitation', 'wind_speed_10m', 'cloud_cover', 'pressure_msl'],
|
||||||
'temperature_2m',
|
|
||||||
'precipitation',
|
|
||||||
'wind_speed_10m',
|
|
||||||
'relative_humidity_2m',
|
|
||||||
'cloud_cover',
|
|
||||||
'pressure_msl'
|
|
||||||
],
|
|
||||||
models: ['ncep_gefs_seamless']
|
models: ['ncep_gefs_seamless']
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
let params = $state({
|
let params = $state({
|
||||||
...defaultParameters,
|
...defaultParameters,
|
||||||
hourly: ['temperature_2m', 'rain', 'relative_humidity_2m', 'wind_speed_10m'],
|
hourly: ['temperature_2m', 'rain', 'wind_speed_10m'],
|
||||||
models: ['ecmwf_ifs', 'meteofrance_seamless', 'ukmo_seamless', 'icon_seamless', 'gfs_seamless']
|
models: ['ecmwf_ifs', 'meteofrance_seamless', 'ukmo_seamless', 'icon_seamless', 'gfs_seamless']
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -470,7 +470,7 @@
|
|||||||
</th>
|
</th>
|
||||||
<td
|
<td
|
||||||
colspan={cellData.length}
|
colspan={cellData.length}
|
||||||
class="relative h-12 overflow-visible p-0"
|
class="relative h-12 cursor-default overflow-visible p-0"
|
||||||
onmousemove={hoverTimeRow}
|
onmousemove={hoverTimeRow}
|
||||||
onmouseleave={clearTimeRowHover}
|
onmouseleave={clearTimeRowHover}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import { type ChartPanel, storedChartLayout } from '$lib/stores/settings';
|
import { type ChartPanel, storedChartLayout } from '$lib/stores/settings';
|
||||||
|
|
||||||
import { formatZoned, getRelativeDayLabel } from '$lib/utils/date';
|
import { formatZoned, getRelativeDayLabel, isSameDayInZone } from '$lib/utils/date';
|
||||||
|
|
||||||
import { ChartContainer, downloadChartsPng } from '$lib/components/charts';
|
import { ChartContainer, downloadChartsPng } from '$lib/components/charts';
|
||||||
|
|
||||||
@@ -91,13 +91,18 @@
|
|||||||
onResetZoom?.();
|
onResetZoom?.();
|
||||||
}
|
}
|
||||||
|
|
||||||
const rangePresets = [
|
const now = new Date();
|
||||||
|
// "Selected day" is redundant while today is the selected day, so hide it then
|
||||||
|
let rangePresets = $derived.by(() => {
|
||||||
|
const isToday = isSameDayInZone(now, selectedDay, data.timezone);
|
||||||
|
return [
|
||||||
{ label: 'Today', apply: () => setRangeDays(new Date(), 1) },
|
{ label: 'Today', apply: () => setRangeDays(new Date(), 1) },
|
||||||
{ label: 'Selected day', apply: () => setRangeDays(selectedDay, 1) },
|
...(isToday ? [] : [{ label: 'Selected day', apply: () => setRangeDays(selectedDay, 1) }]),
|
||||||
{ label: '3 days', apply: () => setRangeDays(new Date(), 3) },
|
{ label: '3 days', apply: () => setRangeDays(new Date(), 3) },
|
||||||
{ label: '5 days', apply: () => setRangeDays(new Date(), 5) },
|
{ label: '5 days', apply: () => setRangeDays(new Date(), 5) },
|
||||||
{ label: 'All', apply: () => resetZoom() }
|
{ label: 'All', apply: () => resetZoom() }
|
||||||
];
|
];
|
||||||
|
});
|
||||||
|
|
||||||
// Soft band drawn on every chart marking the currently selected day
|
// Soft band drawn on every chart marking the currently selected day
|
||||||
let selectedDayHighlight = $derived.by(() => {
|
let selectedDayHighlight = $derived.by(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user