Published
Edited
Apr 1, 2021
Insert cell
Insert cell
Insert cell
Insert cell
spanify = function(arr) {
return md`${arr.reduce((acc,w,i) => acc +=
` <span class="word" style="background:${rcol()}">${w}</span>`,'')}`;
}
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
rcol = function() {
return `rgb(${Math.random() * 100},${Math.random() * 100},${Math.random() * 100})`;
}
Insert cell
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