gridmash
components for reconciling grids of scalar values
Note: Project is unstable and extremely early phase
Purpose
gridmash
is designed for reconciliing grids of values in a user-definable and predictable way.
Components
Component | Implemented | PR | Issue |
---|---|---|---|
Grid | ✔️ | - | - |
Cell | ✔️ | - | - |
Installation
npm install gridmash
API Overview
Basic Rendering
The following example shows how to use Grid
and Cell
to render a reconciler.
<Grid />
will map arrow key press events to reconciliations in the grid between
two viable cell values.
A reconciliation is defined by props.reconcile
, and occurs when two cell values
fulfill props.reconciliationCondition
and are in the motion-dependant path of
one another.
Grid
does not have internal state. It assumes that any reconciliation it identifies should be passed back into itsdata
prop if it is desired to haveGrid
update with new cell values.
;;
Mapping Custom Input Keys
Grid
can accept a keyMap
prop which allows you to define what events should be mapped to which directions of movement in the grid.
;