Published
Edited
Apr 24, 2021
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
emojis = Generators.observe(notify => {
const source = new EventSource("https://stream.emojitracker.com/subscribe/eps");
source.onmessage = message => notify(JSON.parse(message.data));
return () => source.close();
})
Insert cell
Insert cell
times = {
let collected = { started: +new Date() }
if(this) collected = this
// yield collected
for(let key in emojis) {
if(!collected[key]) collected[key] = []
collected[key].push({ t: +new Date(), count: emojis[key]})
}
return collected
}
Insert cell
Insert cell
rankings = d3.json("https://api.emojitracker.com/v1/rankings")
Insert cell
rankedById = new Map(rankings.map(d => [d.id, d]))
Insert cell
chosen = ["1F4A9"]
Insert cell
xScaleRain = d3.scaleBand()
.domain(chosen)
.range([10, width])
Insert cell
update = Object.keys(emojis).forEach(d => {
// only render emojis from our chosen list
if(chosen.indexOf(d) >= 0)
poo(d)
})
Insert cell
height = 500
Insert cell
import {radio} from "@jashkenas/inputs"
Insert cell
d3 = require('d3@5')
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more