GraphLife

Import

svelte
import { GraphLife } from 'markgraphy';

Basic usage

svelte
<GraphLife
  title="example"
  cols={44}
  rows={14}
/>
[ example ]
██       ██        ███           ██  ██ 
        ██                              
   ███                               
██  █████  ██               ██             
                       ██               
        ██               ██ ██      ██ 
          ██      ██       ███ ██     
       ██                            
                ██  ██               
              ██     ██      ███       
        ██         ███    ██          
                    ██                  
                           ██      ██  
      ██   ██           ███         ██

gen 000 · pop 152

Props

PropTypeDefaultDescription
titlestringCaption drawn on the top edge as [ TITLE ].
cols?number44Columns of the board. Default 44.
rows?number14Rows of the board. Default 14.
density?number0.28Random fill probability when no seed is given. Default 0.28.
seed?boolean[][]Explicit initial board. Padded/cropped to cols x rows.
seedNum?number7PRNG seed for the random board, reproducible. Default 7.
speedMs?number220Milliseconds per generation. Default 220.
animated?booleantrueStart playing on mount. Default true. Reduced motion starts paused.
showControls?booleantrueShow the playback controls. Default true.
corner?stringCharacter at each corner of the frame. Default ”+“.
class?string''

Exported types

  • GraphLifeProps

Reduced motion

Animation is disabled under prefers-reduced-motion.