Public
Edited
Jul 6, 2024
Insert cell
Insert cell
data = FileAttachment(
"all_baldwin_tweets_grouped_by_NEW_MERGED_cluster_and_month.csv"
).csv()
Insert cell
data
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
useful_data = data
.filter((d) => d["useful"] == "True")
.map((d) => ({
cluster: d["new_cluster_name"],
count: parseInt(d["0"]),
date: new Date(d["date"])
}))
Insert cell
Insert cell
Insert cell
Insert cell
viewof top = Inputs.range([1, 10], { step: 1, label: "Top #" })
Insert cell
plot = Plot.plot({
color: { legend: true, domain: top_clusters, columns: 3 },
marks: [
Plot.lineY(filtered_data, {
x: "date",
y: "count",
stroke: "cluster",
tip: true
})
]
})
Insert cell
to_be_df = filtered_data.filter((d) => d.cluster == "to be a negro")
Insert cell
Plot.plot({
marks: [
Plot.lineY(to_be_df, {
x: "date",
y: "count"
}),
Plot.dot()
]
})
Insert cell
to_be_examples = [{
"date": "2014-08-14",
"count": 999,
"img": url
}]
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