Recipes
The Guide explains Mazely's core model. These recipes combine multiple APIs to solve common application problems.
Recipes assume that you can create and generate a maze. If you have not done that yet, begin with the Quick Start.
Animating Algorithm Progress
Connect StepPlayer to requestAnimationFrame, add playback controls, and keep animation speed stable across display refresh rates.
Drawing Maze State
Read cells, edges, solve metadata, and step payloads in a Canvas renderer. The same separation applies to SVG, WebGL, terminal, and game renderers.
Generating a Shaped Maze
Use a boolean mask to exclude grid cells, validate connected shapes according to the selected topology, and choose valid start and end points.
Saving and Restoring a Maze
Serialize maze topology as JSON and restore it into a compatible grid without persisting internal playback state.