past weather
This commit is contained in:
@@ -250,11 +250,15 @@
|
||||
let cloudBandSeries = $derived(visibleSeries.filter((s) => s.cloudBand));
|
||||
let hasRightAxis = $derived(plottedSeries.some((s) => s.axis === 'right'));
|
||||
|
||||
// Tighter left gutter on narrow screens so axis labels sit near the edge
|
||||
let padLeft = $derived(width > 0 && width < 520 ? 38 : 60);
|
||||
// Minimal gutters on narrow screens so the plot uses nearly the full width
|
||||
// (just enough to keep the axis tick labels legible).
|
||||
let isNarrow = $derived(width > 0 && width < 520);
|
||||
let padLeft = $derived(isNarrow ? 26 : 60);
|
||||
// Reserve the right gutter when this chart (or a sibling, via reserveRightAxis)
|
||||
// has a right axis, so a stacked row of charts share the same plot width.
|
||||
let padRight = $derived(hasRightAxis || reserveRightAxis ? 56 : 20);
|
||||
let padRight = $derived(
|
||||
hasRightAxis || reserveRightAxis ? (isNarrow ? 34 : 56) : isNarrow ? 6 : 20
|
||||
);
|
||||
// Icon rows across the top: pictograms and/or wind arrows. reserveTopRows keeps
|
||||
// a stacked row of charts the same height even if some have fewer icon rows.
|
||||
let ownIconRows = $derived((pictograms.length > 0 ? 1 : 0) + (windArrows.length > 0 ? 1 : 0));
|
||||
@@ -1131,7 +1135,7 @@
|
||||
<!-- Weather pictograms: a bordered band across the top of the plot -->
|
||||
{#if visiblePictograms.length > 0}
|
||||
<div
|
||||
class="pointer-events-none absolute z-10 overflow-hidden rounded-lg border border-border/60 bg-muted/30"
|
||||
class="pointer-events-none absolute z-10 overflow-hidden rounded-t-lg border border-border/60 bg-muted/30"
|
||||
style:left="{iconBandLeft}px"
|
||||
style:top="{pictoRowTop}px"
|
||||
style:width="{iconBandWidth}px"
|
||||
@@ -1153,7 +1157,7 @@
|
||||
<!-- Wind-direction arrows: a matching band -->
|
||||
{#if visibleWindArrows.length > 0}
|
||||
<div
|
||||
class="pointer-events-none absolute z-10 overflow-hidden rounded-lg border border-border/60 bg-muted/30"
|
||||
class="pointer-events-none absolute z-10 overflow-hidden rounded-t-lg border border-border/60 bg-muted/30"
|
||||
style:left="{iconBandLeft}px"
|
||||
style:top="{windRowTop}px"
|
||||
style:width="{iconBandWidth}px"
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
{location.name}
|
||||
{#if location.admin1 || location.country}
|
||||
<span class="font-normal text-muted-foreground">
|
||||
· {#if location.admin1}{location.admin1},
|
||||
· {#if location.admin1}{location.admin1},
|
||||
{/if}{location.country ?? ''}
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user