Make titles a bit bigger
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
fc2a7ce42f
commit
44a3a0d1e9
|
|
@ -168,31 +168,35 @@ export const dowRoutes = router((router, ctx) => {
|
|||
|
||||
const next12Hours = Object.entries(weather.hours).slice(1, 22)
|
||||
|
||||
const tempY = 230
|
||||
const tempY = 210
|
||||
const tempX = 30
|
||||
const tempW = 280
|
||||
const tempH = 120
|
||||
|
||||
const tempGraphP = 5
|
||||
const tempGraphX = tempX + tempGraphP * 2
|
||||
const tempGraphY = tempY + 24 + tempGraphP
|
||||
const tempGraphW = tempW - tempGraphP * 4
|
||||
const tempGraphH = tempH - 24 - tempGraphP * 2
|
||||
|
||||
widgets.push(
|
||||
...rectangleWithTitle({
|
||||
x: tempX,
|
||||
y: tempY - 20,
|
||||
y: tempY,
|
||||
width: tempW,
|
||||
height: tempH,
|
||||
title: 'Teplota',
|
||||
titleHeight: 20,
|
||||
titleHeight: 24,
|
||||
titleFont: 3,
|
||||
}),
|
||||
)
|
||||
|
||||
widgets.push(
|
||||
...barGraph({
|
||||
x: tempX + tempGraphP * 2,
|
||||
y: tempY + tempGraphP,
|
||||
x: tempGraphX,
|
||||
y: tempGraphY,
|
||||
width: tempGraphW,
|
||||
height: tempH - 20 - tempGraphP * 2,
|
||||
height: tempGraphH,
|
||||
data: next12Hours.map(([offset, h]) => ({
|
||||
x: now.plus({ hours: +offset }).hour.toString().padStart(2, '0'),
|
||||
yFormatted: Math.floor(h.temperature as number).toString(),
|
||||
|
|
@ -206,59 +210,35 @@ export const dowRoutes = router((router, ctx) => {
|
|||
}),
|
||||
)
|
||||
|
||||
/*
|
||||
const minPre = Math.min(
|
||||
...next12Hours.map(([, h]) => h.precipitationAmount as number),
|
||||
)
|
||||
|
||||
const maxPre = Math.max(
|
||||
...next12Hours.map(([, h]) => h.precipitationAmount as number),
|
||||
)
|
||||
|
||||
const maxPreIndex = Object.entries(weather.hours).reduce(
|
||||
(acc, [i, h]) => {
|
||||
if (typeof h.precipitationAmount !== 'number') {
|
||||
return acc
|
||||
}
|
||||
|
||||
if (!acc || h.precipitationAmount > acc.pre) {
|
||||
return { pre: h.precipitationAmount, index: i }
|
||||
}
|
||||
|
||||
return acc
|
||||
},
|
||||
{} as { pre: number; index: string } | undefined,
|
||||
)?.index
|
||||
|
||||
const displayedMaxPre = Math.max(maxPre, 1)
|
||||
const preRange = displayedMaxPre - minPre
|
||||
*/
|
||||
|
||||
const preY = 250 + 120
|
||||
const preY = 230 + 124
|
||||
const preX = 30
|
||||
const preW = 280
|
||||
const preH = 120
|
||||
const preH = 116
|
||||
|
||||
const preGraphP = 5
|
||||
const preGraphX = preX + preGraphP * 2
|
||||
const preGraphY = preY + 24 + preGraphP
|
||||
const preGraphW = preW - preGraphP * 4
|
||||
const preGraphH = preH - 24 - preGraphP * 2
|
||||
|
||||
widgets.push(
|
||||
...rectangleWithTitle({
|
||||
x: preX,
|
||||
y: preY - 20,
|
||||
y: preY,
|
||||
width: preW,
|
||||
height: preH,
|
||||
title: 'Srazky',
|
||||
titleHeight: 20,
|
||||
titleHeight: 24,
|
||||
titleFont: 3,
|
||||
}),
|
||||
)
|
||||
|
||||
widgets.push(
|
||||
...barGraph({
|
||||
x: preX + preGraphP * 2,
|
||||
y: preY + preGraphP,
|
||||
x: preGraphX,
|
||||
y: preGraphY,
|
||||
width: preGraphW,
|
||||
height: preH - 20 - preGraphP * 2,
|
||||
height: preGraphH,
|
||||
data: next12Hours.map(([offset, h]) => ({
|
||||
x: now.plus({ hours: +offset }).hour.toString().padStart(2, '0'),
|
||||
yFormatted: (h.precipitationAmount as number).toFixed(1) + 'mm',
|
||||
|
|
|
|||
Loading…
Reference in New Issue