Published
Edited
Dec 25, 2020
4 stars
Also listed in…
31 Days of Observable
Insert cell
Insert cell
Insert cell
mazegen = import("https://cdn.jsdelivr.net/gh/TheWizardBear/maze_generator@main/mod.js")
Insert cell
Insert cell
mycanvas = DOM.canvas(300, 300)
Insert cell

{
const kruskalMaze = new mazegen.Maze({
width: 20,
height: 20,
seed: Math.floor(Math.random()*100), //set to a constant number if you want the same maze every gen
algorithm: "Kruskal's",

}).generate();
kruskalMaze.display({
canvas: mycanvas, //Replace this with your canvas element you want to display the maze on.
lineThickness: 0.5, //this sets the walls to be the same size as the paths
coloringMode: "distance",
colorScheme: "rainbow"
})
}
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