feat: model comparison picto timeline
This commit is contained in:
@@ -222,6 +222,8 @@ export interface ModelCompareResult {
|
||||
utcOffsetSeconds: number;
|
||||
timezone: string;
|
||||
markAreas: MarkArea[];
|
||||
sunrise: number[];
|
||||
sunset: number[];
|
||||
units: Record<string, string>;
|
||||
/** Flat record compatible with the existing chart utilities (keys like "temperature_2m_icon_seamless") */
|
||||
hourlyFlat: Record<string, number[]>;
|
||||
@@ -408,12 +410,14 @@ export async function fetchModelComparison(
|
||||
|
||||
// Extract sunrise/sunset from the first response's daily block
|
||||
let markAreas: MarkArea[] = [];
|
||||
let sunrise: number[] = [];
|
||||
let sunset: number[] = [];
|
||||
const dailyBlock = firstResponse.daily();
|
||||
if (dailyBlock) {
|
||||
const sunriseVar = dailyBlock.variables(0)!;
|
||||
const sunsetVar = dailyBlock.variables(1)!;
|
||||
const sunrise = getInt64Values(sunriseVar);
|
||||
const sunset = getInt64Values(sunsetVar);
|
||||
sunrise = getInt64Values(sunriseVar);
|
||||
sunset = getInt64Values(sunsetVar);
|
||||
markAreas = buildDaylightMarkAreas(sunrise, sunset);
|
||||
}
|
||||
|
||||
@@ -471,6 +475,8 @@ export async function fetchModelComparison(
|
||||
utcOffsetSeconds,
|
||||
timezone,
|
||||
markAreas,
|
||||
sunrise,
|
||||
sunset,
|
||||
units,
|
||||
hourlyFlat,
|
||||
hourlyUnitsFlat
|
||||
|
||||
Reference in New Issue
Block a user