Published
Edited
Apr 27, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Table(selection)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
parseTime = d3.timeParse("%m/%d/%Y")
Insert cell
choices.map(d=>d.comment_count)
Insert cell
Insert cell
catname = choices.map(d=>d.title)
Insert cell
august = choices.filter(d=>d3.timeFormat("%Y-%m")(d.trending_date).includes("2020-08"))
Insert cell
september = choices.filter(d=>d3.timeFormat("%Y-%m")(d.trending_date).includes("2020-09"))
Insert cell
october = choices.filter(d=>d3.timeFormat("%Y-%m")(d.trending_date).includes("2020-10"))
Insert cell
november = choices.filter(d=>d3.timeFormat("%Y-%m")(d.trending_date).includes("2020-11"))
Insert cell
december = choices.filter(d=>d3.timeFormat("%Y-%m")(d.trending_date).includes("2020-12"))
Insert cell
january = choices.filter(d=>d3.timeFormat("%Y-%m")(d.trending_date).includes("2021-01"))
Insert cell
february = choices.filter(d=>d3.timeFormat("%Y-%m")(d.trending_date).includes("2021-02"))
Insert cell
march = choices.filter(d=>d3.timeFormat("%Y-%m")(d.trending_date).includes("2021-03"))
Insert cell
Insert cell
selection = soph[month]()
Insert cell
stat = ({
views: () => selection.map(d=>d.view_count),
likes: () => selection.map(d=>d.likes),
comments: () => selection.map(d=>d.comment_count)
})
Insert cell
sed = stat[stats]()
Insert cell
Insert cell
newcatname = [...new Set(catname)]
Insert cell
countriesyoutubeGroupedByTitle = group(selection).by(d=>d.title).run()
Insert cell
topcountriesyoutubeGroupedByTitle = countriesyoutubeGroupedByTitle.filter(d=>d.values.length>8)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
USdates = US_youtube.map(d => d.trending_date)
Insert cell
Dates = selection.map(d=>d.trending_date)
Insert cell
Dates[Dates.length-1]
Insert cell
fredo = group(choices).by(d=>d.trending_date).run()
Insert cell
Views
Insert cell
groupTableByDate = d3.group(choices, d=>d.trending_date)
Insert cell
dateRelatedData = groupTableByDate.get(new Date ('2021'))
Insert cell
fredo.filter(d=>d.key.includes('2020-10-08'))
Insert cell
br = fredo.filter(d=>d.key.includes('2020-12'))
Insert cell
br.map(d=>d.key)
Insert cell
Views.map(d=>d.view_count)
Insert cell
USviews = US_youtube.map(d => ({view_count:d.view_count, category:d.category}))
Insert cell
Views = selection.map(d => ({view_count:d.view_count, category:d.category, trending_date:d.trending_date}))
Insert cell
USyoutubeGroupedByCategory = group(US_youtube).by(d=>d.category).run()
Insert cell
countriesyoutubeGroupedByCategory = group(selection).by(d=>d.category).run()
Insert cell
topUSyoutubeCategory = USyoutubeGroupedByCategory.filter(d=>d.values.length>1000 && d.values.length <10000)
Insert cell
topcountriesyoutubeGroupedByCategory = countriesyoutubeGroupedByCategory.filter(d=>d.values.length>2000)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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