Public
Edited
Jun 5
Insert cell
Insert cell
Insert cell
Insert cell
vl.markBar()
.data(data_2022)
.encode(
vl.x().fieldO('country').title('Country'),
vl.y().fieldQ('forestArea').title('% Forest Area').scale({domain: [0,100]}),
vl.color().fieldN('country').title('Country'),
vl.tooltip(['country', 'year', 'forestArea'])
)
.title("Forest Area (%) of Country's Land Area in 2022")
.height(400)
.width(900)
.render()

Insert cell
Insert cell
Insert cell
forestArea = FileAttachment("Forest Area@3.csv").csv({typed:true})

Insert cell
selectedCountries = ["China","United States","Japan","France","Australia","Singapore"]
Insert cell
data_2022 = forestArea
.filter(d => selectedCountries.includes(d["Country Name"]))
.map(d => ({ country: d["Country Name"], year: 2022, forestArea: d[2022]}));
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