React-sim
GitHub

Grid is a frame helper which displays any 2-dimensional matrix of data as a grid of colored squares.

0
100

It's used in examples like Game of Life, Simple Model or Activators/inhibitors.

Properties

NameDescription
data
Array
It expects data to be a 2-dimensional array of data.
accessor
function
How to determine how to color each cell. The inputs of the function are:
cell (content of the cell), x , y. The output is: a color. The default value is:
cell => cell ? 0 : 'none' : '#000'
size
string/integer, default: 12
How big the squares will be in pixels.
cellProps
anything
Any extra prop to pass to each individual square

Any other prop will be passed to the Grid.

Edit this page on GitHub
Previous:
Canvas Frame
Next:
Time Series
React-SimGitHub