Public
Edited
May 22
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof chartGewalt = createChart(seriesGewalt)
Insert cell
viewof chartHG = createChart(seriesHG)
Insert cell
Insert cell
chartsBreakpoint = breakpoints[2]
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
// Defined sort order based on the order of the drive types
sortByGender = keys.reduce((obj, item, index) => {
return {
...obj,
[item]: index
};
}, {})
Insert cell
// Defined sort order based on the order of the drive types
sortByAge = ageClasses.reduce((obj, item, index) => {
return {
...obj,
[item]: index
};
}, {})
Insert cell
Insert cell
Insert cell
Inputs.table(fetchedData)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
groupedData = tidy(
fetchedData,
mutate({
Geschlecht: (d) => (d.Geschlecht == "m" ? "Männlich" : "Weiblich")
}),
groupBy(
["Gewaltkategorie", "Geschlecht", "Altersklasse"],
summarize({
value: sum("Anzahl")
})
),
leftJoin(ageLength, ["Altersklasse"]),
mutate({value: d => d.value / d.ak_length}),
)
Insert cell
Insert cell
Insert cell
Insert cell
ZHSex = [ZHColors.chart.lightviolet, ZHColors.chart.aquamarine] //["#7F3DA7", "#65A73D"]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {
colors as ZHColors,
fonts as ZHFonts
} from "@statistikzh/common-styles"
Insert cell
lit = import(`https://esm.run/lit-html@3`) // import("lit-html@3.2.1")
Insert cell
Insert cell
Insert cell
import { createTooltip, tooltipStyle } from "67f12d77e642b388"
Insert cell
import { setValue, getPointerPosition } from "@statistikzh/utils"
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