Animator

Class Animator controls running of a function.

Constructor

new Animator(fcn, steps, fps)

Sets parameters, then calls start(). To have the model not start immediately do:

  • const anim = new Animator(<args>).stop()
Parameters:
NameTypeDefaultDescription
fcnfunction

The function the animator runs and controls

stepsnumber

How many steps to run. Default is -1, forever

fpsnumber30

Max frames/second to run. Default is 30

Methods

start()

Starts the model running

Returns:

The animator, allows chaining

stop()

Stops the model running

Returns:

The animator, allows chaining