Public
Edited
Feb 24, 2023
Insert cell
Insert cell
data = fetch(
"https://data.nasdaq.com/api/v3/datatables/NDAQ/RTAT10.json?api_key=v7eTivCMCkfdSUBisazW"
).then((response) => response.json())
Insert cell
grouped = d3
.groups(data.datatable.data, (d) => d[1])
.filter((d, i) => i < 4)
.map(([name, data]) =>
data.map((d) => ({ name, date: new Date(d[0]), sentiment: d[2] }))
)
// .filter()
.flat()
// .sort((d) => d.date)
Insert cell
viewof table = Inputs.table(grouped)
Insert cell
Plot.plot({
marks: [
Plot.ruleY([0]),
Plot.lineY(grouped, {
sort: "date", // uncomment to fix
x: "date",
y: "sentiment",
z: "name",
stroke: "name",
curve: "catmull-rom"
})
]
})
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