Public
Edited
Jan 21
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = d3.csv(
"https://www.web.statistik.zh.ch/ogd/daten/ressourcen/KTZH_00001202_00003520.csv",
{ typed: true }
)
//FileAttachment("KTZH_00001202_00003520_Geschaedigte_Kanton.csv")
// .csv()
.then(function (data) {
data.forEach(function (d) {
d.Ausgangsjahr = +d.Ausgangsjahr;
d.Männer = +d.Minderjaehrige_M + +d.Erwachsene_M + +d.ohne_Alter_M;
d.Frauen = +d.Minderjaehrige_W + +d.Erwachsene_W + +d.ohne_Alter_W;
d.Haupttitel = d.Haupttitel.split("Total ")[1]; // removing suffix "Total"
});
return data.filter((d) => d.Haupttitel != "StGB"); // limit to the subgroupings of Haupttitel
})
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
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import { fonts as ZHFonts } from "@statistikzh/common-styles"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
css = html`<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/colreorder/1.5.4/css/colReorder.dataTables.min.css">
<!--<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.7.1/css/buttons.dataTables.min.css">-->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/responsive/2.2.9/css/responsive.dataTables.min.css">
<!--<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/select/1.3.3/css/select.dataTables.min.css">-->`
Insert cell
stylesheet = html`<!--<link rel='stylesheet'
href='https://www.zh.ch/etc.clientlibs/zhweb/core/clientlibs/publish/resources/css/main.04fb0ec.min.css' />-->
<link rel='stylesheet' href='https://cdn.rawgit.com/resmartiZH/zhwebfiles/main/zhwebstyle.css'/>`
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