3.7
Updated event banner to fit top screen Updated table thermal colours to max hot and min cold for 2h, 3h & 4h Ground Lab preview
This commit is contained in:
+29
-12
@@ -154,6 +154,10 @@ export function buildHourlyRows({ forecast, airQuality, location, vehicleType, v
|
||||
uv, uvA, uvB,
|
||||
precip, precipProb, lightning, cape, snow,
|
||||
soilT0, soilT6, soilM, shadeT,
|
||||
// Pet Shade reads the same hourly value as Shade but aggregates as a
|
||||
// MEAN rather than a worst case, so it needs its own field to diverge
|
||||
// from shadeT at 2h/3h/4h. Same for pawT vs concreteT below.
|
||||
petShadeT: shadeT,
|
||||
effectiveRad,
|
||||
elev, Tmrt, utci, utciAdj, eh, compass,
|
||||
visKm, aqi,
|
||||
@@ -182,7 +186,7 @@ export function buildHourlyRows({ forecast, airQuality, location, vehicleType, v
|
||||
const concreteTemps = calcConcreteTempPass(
|
||||
TaArr, radArr, vaArr, elevArr, uvArr, cloudCatArr, soilMArr, precipArr, snowArr
|
||||
);
|
||||
hourlyRows.forEach((r, i) => { r.concreteT = concreteTemps[i]; });
|
||||
hourlyRows.forEach((r, i) => { r.concreteT = concreteTemps[i]; r.pawT = concreteTemps[i]; });
|
||||
|
||||
const indoorTemps = calcIndoorTempPass(TaArr, globArr, elevArr, buildingType);
|
||||
const managedTemps = calcManagedIndoorTempPass(TaArr, globArr, elevArr, buildingType);
|
||||
@@ -267,10 +271,15 @@ export function buildHourlyRows({ forecast, airQuality, location, vehicleType, v
|
||||
//
|
||||
// Every other column is aggregated with the rule that fits its meaning:
|
||||
// - SUM : precipitation totals (1mm/h x 3h = 3mm)
|
||||
// - MAX : risk/peak columns (rain %, UV, gusts, cabin/surface/indoor)
|
||||
// - MEAN : smooth continuous quantities (air temp, RH, wind, cloud, ...)
|
||||
// - FELT : worst-case felt temp - the warmest hour if it reaches >=20C
|
||||
// (heat is the concern), otherwise the coldest (cold concern)
|
||||
// - MAX : risk/peak columns (rain %, UV, gusts, managed indoor)
|
||||
// - MEAN : smooth continuous quantities (RH, wind, cloud, Tmrt, ...)
|
||||
// - FELT : worst-case temperature - the warmest hour if the block reaches
|
||||
// >=20C (heat is the concern), otherwise the coldest hour (cold
|
||||
// is the concern). Applies to EVERY temperature column the user
|
||||
// judges comfort or risk by - SunSoak, Cabin, Indoors, Concrete,
|
||||
// Soil, Shade and Air - so they never disagree with each other
|
||||
// at 2h/3h/4h. Note Air is therefore a block worst case, not a
|
||||
// block average, and will read hotter than a mean on a warm day.
|
||||
//
|
||||
// Derived render values (Delta, Burn) are recomputed downstream from the
|
||||
// aggregated Air / UTCI / UV, so they stay consistent automatically.
|
||||
@@ -278,16 +287,24 @@ export function buildHourlyRows({ forecast, airQuality, location, vehicleType, v
|
||||
// interval <= 1 returns the input untouched (zero behaviour change).
|
||||
// ------------------------------------------------------------------------
|
||||
const AGG_MEAN = [
|
||||
'Ta', 'shadeT', 'RH', 'dew', 'va', 'dir', 'dif', 'cc', 'ccLow', 'ccMid', 'ccHigh',
|
||||
'soilT0', 'soilT6', 'soilM', 'Tmrt', 'eh', 'visKm', 'aqi', 'effectiveRad',
|
||||
'RH', 'dew', 'va', 'dir', 'dif', 'cc', 'ccLow', 'ccMid', 'ccHigh',
|
||||
'soilM', 'Tmrt', 'eh', 'visKm', 'aqi', 'effectiveRad',
|
||||
// Thermal columns that read as a plain block average rather than a worst
|
||||
// case: Tmrt and Dew above, plus the pet trio. pawT/petShadeT mirror
|
||||
// concreteT/shadeT hourly but must NOT inherit their FELT aggregation.
|
||||
'furSurfaceT', 'pawT', 'petShadeT',
|
||||
'grassPollen', 'birchPollen', 'alderPollen', 'mugwortPollen', 'olivePollen', 'ragweedPollen',
|
||||
];
|
||||
const AGG_MAX = [
|
||||
'precipProb', 'uv', 'uvA', 'uvB', 'gust',
|
||||
'vehicleT', 'concreteT', 'indoorT', 'managedT',
|
||||
];
|
||||
const AGG_MAX = ['precipProb', 'uv', 'uvA', 'uvB', 'gust'];
|
||||
const AGG_SUM = ['precip', 'snow'];
|
||||
const AGG_FELT = ['utci', 'utciAdj'];
|
||||
// Every temperature the user reads as "how hot/cold does this actually get"
|
||||
// shares one rule, so a 3h row never disagrees with the columns beside it.
|
||||
const AGG_FELT = [
|
||||
'utci', 'utciAdj', // SunSoak
|
||||
'vehicleT', 'concreteT', // Cabin, Concrete
|
||||
'indoorT', 'managedT', // Indoors + Managed Indoors (+ Pet Home)
|
||||
'soilT0', 'soilT6', 'shadeT', 'Ta', // Soil surface + root, Shade, Air
|
||||
];
|
||||
|
||||
export function aggregateRows(rows, interval) {
|
||||
if (!rows || rows.length === 0 || !interval || interval <= 1) return rows;
|
||||
|
||||
Reference in New Issue
Block a user