Skip to content

Commit

Permalink
Document cloud.on and events.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasondavies committed Jun 22, 2015
1 parent 4cc5fea commit f97d385
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ See the samples in `examples/`.

## API Reference

<a name="on" href="#on">#</a> <b>on</b>(<i>type</i>, <i>listener</i>)

Registers the specified *listener* to receive events of the specified *type*
from the layout. Currently, only "word" and "end" events are supported.

A "word" event is dispatched every time a word is successfully placed.
Registered listeners are called with a single argument: the word object that
has been placed.

An "end" event is dispatched when the layout has finished attempting to place
all words. Registered listeners are called with two arguments: an array of the
word objects that were successfully placed, and a *bounds* object of the form
`[{x0, y0}, {x1, y1}]` representing the extent of the placed objects.

<a name="start" href="#start">#</a> <b>start</b>()

Starts the layout algorithm. This initialises various attributes on the word
Expand All @@ -29,7 +43,7 @@ addressed in a future release.

<a name="stop" href="#stop">#</a> <b>stop</b>()

Stops the layout algorithm.V
Stops the layout algorithm.

<a name="timeInterval" href="#timeInterval">#</a> <b>timeInterval</b>([<i>time</i>])

Expand Down

0 comments on commit f97d385

Please sign in to comment.