Published
Edited
Jun 24, 2020
5 stars
Food clockDisambiguating selection in a 2D treePerceptually more-uniform diverging color scatterplotDays since a U.S. President was last shotSingle-serving sitesDo you feel old?Dynamic scales deprive dashboards of institutional memoryNesting chevron pillsColumnar group byDe Moivre by generatorsShowing ESPN Receiver Tracking Metrics using weighted radar chartsCombine consecutive stringsDollar spectrumThe Feedback BathtubIs Visnu’s hex random?Dual axes are a great way to show correlation 🔥Promise.raceHealthcare plan payoff curvePlot image beeswarmGenerations on Google TrendsFor i of myriadChatterjee correlationChecking invariance of round trip-0 and 0Norms and central tendencyDisordering ULsData-driven table sort iconPlot: weather with sunrise and sunsetRecreating Östling’s regression visualizationsMixing knowledge and random guessesHow many five digit numbers are prime?Warping gridspaceSampling moodLow IDsTesting for OmicronAll Too WellDistance from square root to nearest factorSuper BogosortParrots of Telegraph HillNudibranch sightingsDecimal watershedsFirst Ladies of the United StatesEval-in-PlaceClassic Research in Data VisualizationResponsive PrettierObsv, obvsGenerating All Natural NumbersDaily Café PickerConcentration of MeasureDivide SeriesMultiply SeriesMultiplication and Division by Similar TrianglesRecursive typed table (sketch!)Lorenz CurveThe “Select cells” buttonRecursive viewof testBubble Map RaceSensitivity and Specificity (sketch)
Reactive transition sketch
How to crash ObservableSpilhaus World TourSimpson’s paradox: CalendarsThe Cauchy DistributionEmoji frequenciesThe Man Comes AroundNot what I meant to doSVG numeral sketchesRSAMandelbrot’s binomial time bending??Re: “Can Moons Have Moons?”Continuous cursorParenthesis matching with vertical offsetsA filter icon that shows filtering instead of funnelingFlag of the Popular VoteFlag of the Popular VoteFlag of the Popular VoteTrailing zeroes in factorialsBitcoin fractal bubbles (animated)Bitcoin fractal bubbles
Insert cell
Insert cell
x = 2
Insert cell
y = 3
Insert cell
Insert cell
x * y
Insert cell
transition(500)(this, x * y)
Insert cell
Insert cell
z = transition(1000, 500)(this, x * y)
Insert cell
Insert cell
Math.sqrt(z)
Insert cell
Insert cell
viewof a = html`<input type="range" min="0" max="10" value="5"/>`
Insert cell
a
Insert cell
transition(250)(this, a)
Insert cell
Insert cell
transition = (duration, delay) =>
async function*(prev, value) {
if (prev !== undefined) {
await Promises.delay(delay || 0);
const i = d3.interpolate(prev, value);
let t = 0;
while (t < 1) {
yield i(t);
t += 1 / (duration * framerate);
}
}
yield value;
}
Insert cell
Insert cell
numberExample = cycle(1000)([0, 1])
Insert cell
transition(500)(this, numberExample)
Insert cell
Insert cell
stringExample = cycle(1000)(["The number 1", "The number 2"])
Insert cell
transition(500)(this, stringExample)
Insert cell
Insert cell
colorExample = cycle(1000)(["red", "blue", "green"])
Insert cell
transition(500)(this, colorExample)
Insert cell
Insert cell
dateExample = cycle(1000)([new Date(), new Date(1989, 9, 19)])
Insert cell
transition(500)(this, dateExample)
Insert cell
Insert cell
arrayExample = cycle(1000)([[0, 1, 2, 3], [1, 24, 196884, 21493760]])
Insert cell
transition(500)(this, arrayExample)
Insert cell
Insert cell
objectExample = cycle(1000)([
{ state: "New York", date: new Date("2020-03-15"), cases: 729 },
{ state: "New York", date: new Date("2020-05-12"), cases: 338485 }
])
Insert cell
transition(500)(this, objectExample)
Insert cell
Insert cell
viewof n = html`<input type="range"/>`
Insert cell
transition(500)(this, html`<code>The value is <b>${n}</b>.</code>`)
Insert cell
Insert cell
viewof theta = html`<input type="range" min="0" max="${2 * Math.PI}" />`
Insert cell
coords = transition(500)(this, [Math.cos(theta), Math.sin(theta)])
Insert cell
circle(coords)
Insert cell
Insert cell
viewof theta2 = html`<input type="range" min="0" max="${2 * Math.PI}" />`
Insert cell
smoothTheta2 = transition(500)(this, theta2)
Insert cell
coords2 = [Math.cos(smoothTheta2), Math.sin(smoothTheta2)]
Insert cell
circle(coords2)
Insert cell
Insert cell
transitionInputs = (duration, delay) =>
async function*(prev, expr, args) {
if (prev !== undefined) {
await Promises.delay(delay || 0);
const i = args.map((arg, index) => d3.interpolate(prev.args[index], arg));
let t = 0;
while (t < 1) {
yield Object.assign(
expr.apply(this, args.map((_, index) => i[index](t))),
{ args }
);
t += 1 / (duration * framerate);
}
}
yield Object.assign(expr.apply(this, args), { args });
}
Insert cell
Insert cell
i = 10
Insert cell
j = 140
Insert cell
Insert cell
html`<code>The sum is <b>${i + j}</b>.</code>`
Insert cell
transitionInputs(1000)(
this,
(i, j) => html`<code>The sum is <b>${i + j}</b>.</code>`,
[i, j]
)
Insert cell
Insert cell
Insert cell
d3 = require("d3")
Insert cell
// Generators get called 60 times per 1000 milliseconds:
// https://observablehq.com/@observablehq/introduction-to-generators
framerate = 60 / 1000
Insert cell
circle = coords => svg`<svg viewBox="-10 -10 20 20" style="overflow: visible;" width="50" height="50">
<circle stroke="#ccc" stroke-dasharray="3,4" fill="none" r="10"/>
<circle cx="${10 * coords[0]}" cy="${10 * coords[1]}" r="1.5">
</svg>`
Insert cell
cycle = delay =>
async function*(arr) {
let i = 0;
while (true) {
yield arr[i % arr.length];
i++;
await Promises.delay(delay);
}
}
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