Published
Edited
Apr 19, 2022
3 forks
6 stars
Insert cell
Insert cell
Insert cell
Insert cell
// try replacing this line with the FileAttachment to load our data
data = d3.csv(url, d3.autoType)
Insert cell
Insert cell
Inputs.table(data)
Insert cell
Insert cell
Insert cell
Insert cell
// using an index to select an item from an array
data[0]
Insert cell
// this is like extracting a column from the data
data.map(d => d.item_price)
Insert cell
// calculate the minimum of a column
d3.min(data, d => d.item_price)
Insert cell
// calculate the minimum and maximum of a column
d3.extent(data, d => d.item_price)
Insert cell
Insert cell
Insert cell
// try creating a slider which goes from 0 to however many data points are in our data array

Insert cell
Insert cell
// let's use the value of our slider to
// data[index]
Insert cell
Insert cell
Insert cell
// type your code here

Insert cell
Insert cell
Insert cell
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