Published
Edited
Feb 22, 2020
2 forks
10 stars
Insert cell
Insert cell
chart
Insert cell
data = Generators.observe(notify => {
const data = [];
data.x = "Size (KB)";
data.y = "Count";
const socket = new WebSocket("wss://ws.blockchain.info/inv");
socket.addEventListener("open", () => {
socket.send(JSON.stringify({op: "unconfirmed_sub"}));
});
socket.addEventListener("message", event => {
const message = JSON.parse(event.data);
if (message.op === "utx") {
data.push(Math.min(999, message.x.size));
notify(data);
}
});
return () => socket.close();
})
Insert cell
import {chart} with {data} from "@d3/histogram"
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