JSPM

react-conway

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q32364F
  • License MIT

Conway's Game of Life in react

Package Exports

  • react-conway

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-conway) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-conway

npm Build Status Maintainability Test Coverage

Demo

Usage

import React from 'react'
import { render } from 'react-dom'
import Life from '../../lib/life'

render(
    <Life/>,
    document.getElementById('react-root')
)

Check out /example to see it in action!

Properties

className: string

When set, it will be appended to the list of class names on the display element.

seed: string

When set, it this value will determine the initial state of the simulation (also known as a seed). Otherwise, the initial state will be random.

scale: number = 4

The ratio of pixels to cell. For instance, when scale is set to 4, each cell will be 4 pixels wide and 4 pixels tall.

running: bool = true

When set to true, the simulation will progress.

framerate: number = 60

Determines how many frames should be drawn in one second. Most screens these days are running at 60fps, so there's usually no need to change it. If you're expecting to run the simulation on low-power devices, you may want to set a lower framerate.