Public
Edited
Oct 15, 2021
1 fork
30 stars
Insert cell
Insert cell
Insert cell
Insert cell
density = seriesDensity(width, 250).yDomain([-1, 1])
Insert cell
xAxis = d3.scaleTime().domain([d3.utcDay.offset(d3.utcDay(), -1), d3.utcDay()])
Insert cell
data = allData.slice(0, numSeries)
Insert cell
allData = {
let rand = d3.randomLcg(0);
return Array.from({ length: maxSeries }, () => {
let amplitude = rand();
let offset = 2.5 * rand();
let noiseAmplitude = 0.025;
return d3.quantize(
pc =>
amplitude * Math.sin(0.35 * (offset + pc * 100)) +
noiseAmplitude * rand(),
numPoints
);
});
}
Insert cell
numPoints = 500
Insert cell
maxSeries = 1000
Insert cell
comma = d3.format(',')
Insert cell
import {
densityPlot,
seriesDensity,
cacheInterpolator
} from '@twitter/density-plot@4159'
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