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