Public
Edited
Oct 23, 2023
2 forks
19 stars
Insert cell
Insert cell
d3.range(10)
Insert cell
Insert cell
d3.range(5, 10)
Insert cell
d3.range(-5, 6)
Insert cell
Insert cell
d3.range(0, 20, 2)
Insert cell
Insert cell
d3.range(0, 10.5, 1)
Insert cell
Insert cell
d3.range(10).concat(10)
Insert cell
Insert cell
d3.range(10, 0, -1) // 🌶
Insert cell
Insert cell
d3.range(9, -1, -1) // 🌶
Insert cell
Insert cell
d3.range(26).map(i => String.fromCharCode(65 + i))
Insert cell
d3.range(10).map(i => ({n: i, nsquare: i ** 2}))
Insert cell
Insert cell
Array.from({length: 26}, (_, i) => String.fromCharCode(65 + i))
Insert cell
Insert cell
Float64Array.from({length: 256}, Math.random)
Insert cell
Uint32Array.from({length: 256}, (_, i) => i ** 2)
Insert cell
Insert cell
{
const start = 0, stop = 20, step = 2;
const array = [];
for (let i = 0, n = Math.ceil((stop - start) / step); i < n; ++i) {
array.push(start + i * step);
}
return array;
}
Insert cell
Insert cell
d3.range(0, 1, 0.2)
Insert cell
Insert cell
d3.ticks(0, 1, 5)
Insert cell
Insert cell
d3.range(0, 1, 0.2).map(d => d.toFixed(1))
Insert cell
Insert cell
d3.range(0, 10, -1)
Insert cell
d3.range(0, 1, 0)
Insert cell
d3.range(0, 1, NaN)
Insert cell
Insert cell
Insert cell
d3 = require("d3-array@3")
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