Public
Edited
Dec 6, 2022
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// number corresponds to letter, the number at a given index "moves" to that index
A = d3.shuffle(d3.range(k))
Insert cell
// Produce a string of commands that follow the mermaid library syntax
// Map numbers to letters
shuffle = {
let cmds = [];
for (let i = 0; i < A.length; i++) {
cmds.push(alphabet[A[i]] + "-->" + alphabet[i]);
}
return cmds.join("\n");
}
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