Published
Edited
Jun 20, 2022
2 forks
2 stars
Insert cell
Insert cell
// quotes = FileAttachment("quotes.json").json()
Insert cell
Insert cell
quotes_only = quotes_unique.map(({ Quote }) => Quote).join`\n`
Insert cell
quotes_author = quotes_unique.map(({ Quote, Author }) => `${Quote} | by ${Author}`).join`\n`
Insert cell
quotes_tags = quotes_unique.map(
({ Quote, Tags }) =>
`${Quote} | ${Tags.filter(blacklistTag).map(cleanTag).join`, `}`
).join`\n`
Insert cell
quotes_author_tags = quotes_unique.map(
({ Quote, Author, Tags }) =>
`${Quote} | by ${Author} | ${Tags.filter(blacklistTag).map(cleanTag)
.join`, `}`
).join`\n`
Insert cell
quotes_author_category = quotes_unique.map(
({ Quote, Author, Category }) => `${Quote} | by ${Author} | ${Category}`
).join`\n`
Insert cell
quotes_category = quotes_unique.map(
({ Quote, Author, Category }) => `${Quote} | ${Category}`
).join`\n`
Insert cell
tag_blacklist = ["attributed-", "misattributed-", "from-"]
Insert cell
blacklistTag = (tag) => !tag_blacklist.some((tag_bad) => tag.includes(tag_bad))
Insert cell
cleanTag = tag => tag.replace(/-/g, " ").trim()
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