Public
Edited
Jan 28, 2022
Insert cell
Insert cell
Insert cell
sankeyBar = StackedBarChart(regions, {
x: d => d.resolution,
y: d => d.value,
z: d => d.vote,
zDomain: ["No vote", "Abstention", "No", "Yes"],
colors: ["#C6C6C6", "#9d9d9c", "#fed061", "#3f8ca5"],
},{
})
Insert cell
sankey = SankeyChart({
links: evo
}, {
nodeGroup: d => d.source,
// nodeGroup: d => d.id.split(/\W/)[0], // take first word for color
nodeAlign: "justify",
linkColor: "source-target",
// nodeAlign, // e.g., d3.sankeyJustify; set by input above
// linkColor, // e.g., "source" or "target"; set by input above
width,
height: 600
})
Insert cell
Insert cell
evo = aq
.fromCSV(await FileAttachment("cybercrime_amendment_blog_alluvial.csv").text())
.derive({source: d => d.Source})
.derive({target: d => d.Dest})
.derive({value: d => d.Value})
.select("source", "target", "value")
// .view()
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