Public
Edited
Nov 9, 2022
Fork of Simple D3
1 star
Insert cell
Insert cell
forest.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
newData = forest
Insert cell
years = [1990, 2020]
Insert cell
{
var results = []
newData.forEach(function(country) {
results.push(country["Country Name"])
});
console.log(results)
}
Insert cell
import {Scrubber} from "@mbostock/scrubber"
Insert cell
value
Insert cell
import {BarChart} from "@leibatt/bar-chart"
Insert cell
scm0 = d3.schemeCategory10
Insert cell
viewof value = Scrubber(
d3.range(years[0], years[1] + 1, 1),
{ autoplay: false, delay: 100, loop: false }
)
Insert cell
year = value
Insert cell
barchart = BarChart(forest, {
x: d => d["Country Name"],
y: d => d[year.toString()],
title: undefined, // Changed for mouseOver Possibility.
xLabel: "Country",
yLabel: "Forested Area (% of land area)",
yDomain: [0, 75],
width: 1000,
height: 300,
marginBottom: 150,
marginRight: 150,
colorRange: scm0,
rotate: true
})
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