Insert cell
Insert cell
Insert cell
Insert cell
G3_caption = html`<p class="atm-figcaption">Quelle: ${[
...new Set(data.map((d) => d.Datenquelle))
]}. <a href=${dataPath} class="atm-text_link" target="_blank" title="Daten als kommagetrennte Tabelle herunterladen">Daten zur Grafik herunterladen</a></p>`
Insert cell
Insert cell
dataPath = "https://raw.githubusercontent.com/statistikZH/decarb_monitoring/main/output/G3_data.csv"
Insert cell
data = d3
.csv(dataPath)
// FileAttachment("G3_data@2.csv")
// .csv({ typed: true })
.then(function (data) {
data.forEach(function (d) {
d.year = new Date(d.Jahr, 0, 1);
d.xTime = d3.timeParse("%Y")(d.Jahr); // xTime is time used for x scale so different year's data can share the x scale
d.Wert = d.Einheit == "Mwh [%]" ? +d.Wert / 100 : +d.Wert; // Values to numeric and percentage
});
return data;
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more