Public
Edited
Mar 21, 2023
Insert cell
Insert cell
viewof file = Inputs.file({ label: "Data" })
Insert cell
raw = (await file.csv()).map((e) => ({
...e,
simple_name: e.Scientific_Name.split(" ").slice(0, 2).join(" ")
}))
Insert cell
raw
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
names = [...new Set(raw.map((e) => e.simple_name))]
Insert cell
plots = [...new Set(raw.map((e) => e.Plot))]
Insert cell
raw.map((e) => ({
...e,
name_ind: names.indexOf(e.simple_name),
plot_ind: plots.indexOf(e.Plot)
}))
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