Public
Edited
Sep 20, 2022
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
pid_color = d3
.scaleOrdinal(
[
"Catherine Nancarrow",
"Maria Praetzellis",
"Brian Riley",
"Erin Robinson"
],
d3.schemeTableau10
)
.unknown("#ccc")
Insert cell
color = d3.scaleOrdinal(["Perished"], ["#da4f81"]).unknown("#ccc")
Insert cell
pid_keys = ["vote","group","resourceTypeGeneral"]
Insert cell
keys = data.columns.slice(0, -1)
Insert cell
pid_data = [
{"vote":"John Chodacki", "group":"Project Leader", "resourceTypeGeneral":"OutputManagementPlan", "value":"1"},
{"vote":"Erin Robinson", "group":"Project Leader", "resourceTypeGeneral":"Article", "value":"4"},
{"vote":"Neil Davies", "group":"Creator", "resourceTypeGeneral":"Article","value":"15"},
{"vote":"Maria Praetzellis", "group":"Project Leader", "resourceTypeGeneral":"Article", "value":"19"},
{"vote":"Maria Praetzellis", "group":"Creator", "resourceTypeGeneral":"Software", "value":"9"},
{"vote":"John Chodacki", "group":"Creator", "resourceTypeGeneral":"Dataset", "value":"8"},
{"vote":"Brian Riley", "group":"Data Curator", "resourceTypeGeneral":"Dataset", "value":"12"},
{"vote":"Brian Riley", "group":"Creator", "resourceTypeGeneral":"Dataset", "value":"6"},
{"vote":"Catherine Nancarrow", "group":"Project Manager", "resourceTypeGeneral":"OutputManagementPlan", "value":"22"}
]
Insert cell
data = d3.csvParse(await FileAttachment("titanic.csv").text(), d3.autoType)
Insert cell
d3 = require("d3@6", "d3-sankey@0.12")
Insert cell
import { sankey as sankey2 } from "@kjgarza/vega-charts"
Insert cell
sankey2()
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more