The timeline function

Creates a Timeline when passed one or more Shape or array.


timeline(shapeOrArray1, shapeOrArray2, ..., options)
    

Arguments

shapeOrArray1, shapeOrArray2, ...

A list of one or more Shape or array.

If passed an array instead of a Shape it should take the following form.


[ shape, options ]
    

Where:

  • shape is a Shape.
  • options is an object, where:
    • name (optional) is a string or number.
    • queue (optional) is an object, where:
      • offset (optional) is the offset in milliseconds to adjust the queuing of this shape.
      • at (optional) is the name of the Shape to queue at (in parallel).
      • after (optional) is the name of the Shape to queue after (in sequence).

options (optional)

An object holding playback options, events and middleware, where:

  • alternate (optional) defines if the next iteration should reverse current direction?
  • duration (optional) is the number of milliseconds that each iteration lasts.
  • initialIterations (optional) is the starting number of iterations.
  • iterations (optional) is the number of playback interations (additional to initialIterations).
  • reverse (optional) defines if the the first iteration should start in a reverse direction?
  • started (optional) is the UNIX timestamp of playback start.
  • events (optional) is an array of events, where each event is iteself an array, where:
  • middleware (optional) is an array of Middleware.

Return value

A Timeline.