Public
Edited
Nov 7, 2022
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
viewof pointIndex = Inputs.range([0, data.length - 1], {
value: 0,
step: 1,
label: "index"
})
Insert cell
Insert cell
// let's use the value of our slider to
// data[index]
data[pointIndex]
Insert cell
Insert cell
Insert cell
// type your code here
SummaryTable(data)
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