Public
Edited
Apr 30
1 star
Insert cell
Insert cell
Insert cell
{
// Dataset
var cities = [
{ name: 'London', population: 8674000},
{ name: 'New York', population: 8406000},
{ name: 'Sydney', population: 4293000},
{ name: 'Paris', population: 2244000},
{ name: 'Beijing', population: 11510000}
];
// Hint: You need to follow the last exercise D3 Select to create svg elements from JS block
}
Insert cell
Insert cell
// This is the same dataset however loaded from a file
// The loading code should be in a stand-alone cell because it is an asynchronous function
cities_file = FileAttachment("city_population.json").json()
Insert cell
{
// In this cell, draw the city populations bar chart using cities_file
// You can reuse the code before
}
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