Function: cellInDirection()
ts
function cellInDirection(
layout,
from,
direction,
accept?
): Cell | undefined;The cell to move to from from in a direction, for arrow-key navigation over any tiling.
Looks at cells whose center lies ahead (within 60° of the direction first, then anywhere ahead) and picks the nearest, with sideways distance counting double, so moving keeps to a "row" or "column" where the tiling has one. accept limits it to some cells (those with content, say). Returns undefined at the edge.
Parameters
| Parameter | Type |
|---|---|
layout | Layout |
from | Cell |
direction | Direction |
accept | (cell) => boolean |
Returns
Cell | undefined