import { aq, op } from "@uwdata/arquero"
= "https://isithot-data.s3.fr-par.scw.cloud/www/"
bucket_base
= FileAttachment FA
= null
mutable myLocation = "default"
mutable geolocateStatus
= {
getLocation yield null
yield navigator.geolocation.getCurrentPosition(
=> {
pos = {
mutable myLocation lat: pos.coords.latitude,
lon: pos.coords.longitude
}= "granted"
mutable geolocateStatus ,
}=> {
e console.log("Geolocation error", e),
= "error"
mutable geolocateStatus ,
}
{enableHighAccuracy: false
}) }
Ist es heute zu heiß in ?
= ({
answers "Auf gar keinen Fall!": {color: "white", fill1: "#5287d1", fill2: "#2166ac" },
"Nein!": {color: "white", fill1: "#a2cdeb", fill2: "#67a9cf" },
"Nee": {color: "#333333", fill1: "#f5f8fa", fill2: "#d1e5f0" },
"Nicht wirklich": {color: "#333333", fill1: "#f7f7f7", fill2: "#ebebeb" },
"Jepp": {color: "#333333", fill1: "#fddcca", fill2: "#f7cfb7" },
"Ziemlich!": {color: "white", fill1: "#de7b49", fill2: "#fc946a" },
"Absolut!": {color: "white", fill1: "#d1231d", fill2: "#b2182b" }
})
html`
<div class="answer-icon-and-label">
<span class="answer-icon" style="background-color: ${answers[statsPlace.isit_answer].fill2};">
</span>
<span>${statsPlace.isit_answer}</span>
</div>`
md`${statsPlace.isit_comment}`
So sieht es heute im Vergleich aus…
= import("https://cdn.skypack.dev/date-fns@3.3.1?min")
datefns = new Date(Date.parse(statsPlace.isit_maximum_dt || null))
tmaxWhen = new Date(Date.parse(statsPlace.isit_minimum_dt || null))
tminWhen
= isFinite(tmaxWhen) ?
tmaxWhenFriendly .formatRelative(tmaxWhen, new Date()) : ""
datefns= isFinite(tminWhen) ?
tminWhenFriendly .formatRelative(tminWhen, new Date()) : ""
datefns
= statsPlace.isit_average.toFixed(1) + "%" percentRating
md`${statsPlace.isit_minimum} °C `
md`${tminWhenFriendly}`
md`${statsPlace.isit_maximum} °C `
md`${tmaxWhenFriendly}`
html`
<div class="answer-icon-and-label">
<span class="answer-icon" style="background-color: ${answers[statsPlace.isit_answer].fill2};"></span>
<span>${statsPlace.isit_current.toFixed(1)} °C</span>
</div>`
md`Durchschnitt bisher<br>heißer als **${percentRating}** der Tage für diese Zeit im Jahr.`
Dies ist die Verteilung der für diese Jahreszeit typischen Temperaturen, die wir als ein Fenster von sieben Tagen beiderseits des heutigen Tages definiert haben. Wie bei einer Glockenkurve ist die Kurve bei häufigeren Temperaturen höher und bei seltenen Temperaturen niedriger.
… und der Rest vom Jahr.
Wir haben jeden Tag in diesem Jahr in mit ähnlichen Zeiten in der Vergangenheit verglichen. Rote Tage waren im Vergleich zu den Aufzeichnungen heiß, blaue Tage waren kalt.
So sieht der Rest von Deutschland heute bisher aus.
= (new Date()).getUTCHours()
nowHour >= 10 && nowHour <= 22 ?
nowHour md`Mancherorts kann es im Laufe der Nacht noch abkühlen.` :
md`Mancherorts kann es im Laufe des Tages noch wärmer werden.`
= statsAll.filter(d => (!d.max_stale) && (!d.min_stale))
currentStats = statsAll.filter(d => d.max_stale || d.min_stale) staleStats
// breaking out the pointer layer for readability
// (and in case we decide to customise it later)
= Plot.pointer({
tipTemplate x: "lon",
y: "lat",
channels: {
place: {
label: "",
value: d => d.isit_label,
,
}label: {
label: "",
value: d => d.isit_comment
,
}separator: {
label: "",
value: d => ""
,
}isit_maximum: {
label: "Max:",
value: d => d.isit_maximum + "°C"
,
}isit_minimum: {
label: "Min:",
value: d => d.isit_minimum + "°C"
},
}fontSize: 20,
fontFamily: "Roboto Condensed",
format: {
x: null,
y: null
,
}lineWidth: 20,
lineHeight: 1.25,
pointerSize: 0,
fillOpacity: 0.8,
strokeOpacity: 0
})
Dieses Projekt gibt es auch für andere Länder