Published
Edited
Nov 15, 2019
2 forks
10 stars
Insert cell
Insert cell
chart = d3.create("svg").attr("viewBox", [0, 0, width, height]).node()
Insert cell
update = d3.select(chart).append("text")
.style("font", "14px sans-serif")
.attr("x", width * Math.random())
.attr("y", height * Math.random())
.attr("dy", "0.35em")
.attr("text-anchor", "middle")
.attr("fill", "black")
.attr("opacity", 1)
.text(change.title)
.transition().remove()
.duration(5000)
.ease(d3.easeLinear)
.attr("fill", "red")
.attr("opacity", 0)
Insert cell
change = Generators.queue(notify => {
const source = new EventSource("https://stream.wikimedia.org/v2/stream/recentchange");
source.onmessage = message => notify(JSON.parse(message.data));
return () => source.close();
})
Insert cell
height = 600
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