Public
Edited
Feb 1, 2023
Insert cell
Insert cell
viewof file = Inputs.file({ label: "Data" })
Insert cell
data = file.csv({ typed: true })
Insert cell
data
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
data[0].plant_name.search(/thunder/)
Insert cell
Plot.plot({
marks: [
Plot.dot(data, {
x: (d) => d.lon,
y: (d) => d.lat,
fill: (d) => {
if (!isNaN(d.plant_name) && d.plant_name.search(/thunder/) > -1) {
return "red";
}
return "black";
},
fillOpacity: (d) => {
if (!isNaN(d.plant_name)) {
console.log(d.plant_name.search(/thunder/));
}
}
})
]
})
Insert cell
viewof file1 = Inputs.file({label: "Data"})
Insert cell
otherdata = file1.csv({ typed: true })
Insert cell
otherdata
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
plant_namings = FileAttachment(
"plant_namings_90217bd1-5614-47ec-95eb-003cd6089e42.json"
)
.json()
Insert cell
import {Plot} from "@mkfreeman/plot-tooltip"
Insert cell
Plot.plot({
marks: [
Plot.dot(
plant_namings.filter(
(e) =>
e.coords[0] > 300000 &&
e.coords[0] < 408995 &&
e.coords[1] < 3695980 &&
e.coords[1] > 3660040
),
{
x: (d) => d.coords[0],
y: (d) => d.coords[1],
title: (d) => `name is${d.name}`
}
)
]
})
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