Skip to main content

gridRatio

Size in pixels of each square grid cell used for pathfinding.

Typenumber
Default10
Minimum2

Smaller values produce more accurate paths but slower pathfinding. Larger values are faster but coarser.

createSmartEdge("step", { gridRatio: 5 });

On large graphs, avoid very small gridRatio values — pathfinding runs on a discrete grid and cost grows quickly.