Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
csv = d3.dsvFormat(";").parse(await FileAttachment("Table_Figure2.csv").text(), d3.autoType)
Insert cell
data = Object.assign(csv.map(d => ({key: d["Importing country"], value: d[indicator]})).sort((a, b) => b.value - a.value), { x: indicator === "DEF_HA" ? "Deforestation (ha)" : "GHG emissions (tonnes)"})
Insert cell
margin = ({top: 30, right: 20, bottom: 20, left: 140})
Insert cell
import { chart } with { data, margin } from "@trase/horizontal-bar-chart@979"
Insert cell
import { select } from "@jashkenas/inputs"
Insert cell
d3 = require("d3@6")
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