Public
Edited
Dec 9, 2022
Insert cell
Insert cell
Insert cell
Insert cell
chart = SankeyChart(
{
nodes: nodes,
links: edges
},
{
nodeGroup: (d) => d.id.split(/\W/)[0], // take first word for color
nodeAlign, // e.g., d3.sankeyJustify; set by input above
linkColor, // e.g., "source" or "target"; set by input above
format: (
(f) => (d) =>
`${f(d)} TWh`
)(d3.format(",.1~f")),
width,
height: 100
}
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3Sankey = require.alias({"d3-array": d3, "d3-shape": d3, "d3-sankey": "d3-sankey@0.12.3/dist/d3-sankey.min.js"})("d3-sankey")
Insert cell
import {howto} from "@d3/example-components"
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