Public
Edited
Apr 26, 2023
Insert cell
Insert cell
refined-LO.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
alldata = FileAttachment("refined-LO.csv").csv({ typed: true })
Insert cell
Insert cell
counted= _.countBy(alldata, 'videoId');
Insert cell
ordered = _.orderBy(_.map(counted, function(amount, videoId) {
return {
videoId: _.parseInt(videoId),
amount
}
}), "amount", "desc");
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
topvideodata = _.reject(_.filter(alldata, { videoId: topvideo.videoId}), { likes: 0})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
tenthvidata = _.reject(_.filter(alldata, { videoId: tenthvideo.videoId}), { likes: 0})
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
Insert cell
recentvideos = _.reject(alldata, (o) => { return _.lte(o.createTime, new Date("2023-03-09"))})
Insert cell
Insert cell
Insert cell
Insert cell
Plot.auto(meaningful, { x: "amount" }).plot()
Insert cell
selected = _.filter(alldata, (o) => { return !!_.find(meaningful, {videoId: o.videoId})})
Insert cell
## Below research in progress
Insert cell
Insert cell
Insert cell
height = 400
Insert cell
x = d3
.scaleLinear()
.domain(d3.extent(selected, (d) => d.likes))
.nice()
.range([margin.left, width - margin.right])
Insert cell
y = d3
.scaleLinear()
.domain(d3.extent(selected, (d) => d.order))
.nice()
.range([height - margin.bottom, margin.top])
Insert cell
xAxis = g => g
.attr("transform", `translate(0,${height - margin.bottom})`)
.call(d3.axisBottom(x))
Insert cell
yAxis = g => g
.attr("transform", `translate(${margin.left},0)`)
.call(d3.axisLeft(y))
Insert cell
margin = ({top: 25, right: 20, bottom: 35, left: 40})
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