Maze Hover
✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on May 14, 2014
A maze rendered on a Canvas element fills the viewport, with a red path tracing the route from the top-left cell to the current mouse position. As the pointer moves over the grid of cells, the highlighted path updates dynamically, always showing the unique parent-child connection from the hovered cell back to the starting corner. The code uses D3 v3’s `d3.select` and `d3.mouse` to handle pointer events, while `generateMaze` builds the maze with a loop-erased random walk and `computeParents` derives each cell’s predecessor for path reconstruction. The black background and white maze structure are drawn with `fillRect`, with the red overlay repainted on every `mousemove`.
AI-generated descriptiongpl-3.0 Licensed