Public
Edited
Dec 20, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
exampleData = [
// {
// source: "All complaints",
// target: "Closed",
// value: "152645"
// },
{
source: "All complaints",
target: "Case managed",
value: "132033"
},
// {
// source: "All complaints",
// target: "No response by firm",
// value: "5275"
// },
// {
// source: "Resolved (dismissed) before case management",
// target: "Agreement reached",
// value: "30831"
// },
{
source: "All complaints",
target: "Case dismissed before case management",
value: "130494"
},
{
source: "'Other' outcomes",
target: "Black hole, not accounted for",
value: "6717"
},
// {
// source: "Case managed",
// target: "Negotiated resolution",
// value: "30831"
// },
// {
// source: "Final decision",
// target: "Clearly in favour of the complainant",
// value: "4436"
// },

// {
// source: "Negotiated resolution",
// target: "Not in favour of the victim",
// value: "28907"
// },
{
source: "Case managed",
target: "'Other' outcomes",
value: "105444"
},
{
source: "'Other' outcomes",
target: "Assessed??",
value: "2058"
},
{
source: "'Other' outcomes",
target: "Outside AFCA rules",
value: "26072"
},

{
source: "'Other' outcomes",
target: "Dismissed",
value: "18567"
},
{
source: "'Other' outcomes",
target: "Negotiated",
value: "52030"
},
{
source: "Case managed",
target: "Ruled in favour of financial firm",
value: "19187"
},
{
source: "Case managed",
target: "Ruled in favour of the complainant",
value: "7402"
}
// {
// source: "Case managed",
// target: "Final decision",
// value: "17458"
// }

// {
// source: "Case managed",
// target: "Discontinued",
// value: "10922"
// },
// {
// source: "Final decision",
// target: "In favour of financial firm",
// value: "13022"
// }

// {
// source: "Case managed",
// target: "In favour of complainant",
// value: "1924"
// }
]
Insert cell
Insert cell
convertData(exampleData)
Insert cell
Insert cell
Insert cell
csvData = d3.csvParse(await Files.text(f))
Insert cell
Insert cell
Insert cell
dataPastedParsed = d3.tsvParse(pastedData)
Insert cell
Insert cell
Insert cell
Insert cell
format = {
const f = d3.format(",.0f");
return d => `${f(d)}`;
}
Insert cell
color = {
const color = d3.scaleOrdinal(d3.schemeCategory10);
return name => color(name.replace(/ .*/, ""));
}
Insert cell
width = 1200
Insert cell
height = 600
Insert cell
Insert cell
d3 = require("d3@5", "d3-sankey@0.12")
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