{#if loadError}
Failed to load weather data: {loadError}
{/if}
{#each chartOptions as option, i (i)}
{/each}
{#if fetchedData && !loading}
} models={params.models || []} sunrise={fetchedData.sunrise} sunset={fetchedData.sunset} timezone={fetchedData.timezone} /> {/if}
{#snippet controls()}
Show legend
{/snippet}
Models
{#if params.models && params.models.length > 0}
{params.models?.length || 0} / {models.flat().length}
{/if}
{#each models as group, i (i)}
{#each group as item (item.value)} {@const { value, label } = item as { value: string; label: string }}
{ if (params.models?.includes(value)) { params.models = params.models.filter((item) => { return item !== value; }); } else if (params.models) { params.models = [...params.models, value]; } }} />
{label}
{/each}
{/each}
Hourly Weather Variables
{#if params.hourly && params.hourly.length > 0}
{params.hourly?.length || 0} / {hourly.flat().length}
{/if}
{#each hourly as group, i (i)}
{#each group as { value, label } (value)}
{ if (params.hourly?.includes(value)) { params.hourly = params.hourly.filter((item) => { return item !== value; }); } else if (params.hourly) { params.hourly = [...params.hourly, value]; } }} />
{label}
{/each}
{/each}