Sorcerer's IsleDocs ScatterOverviewCode

Scatter Options

This page describes the options which can be set in the second argument when creating a new Scatter instance.

Mode

Controls how items are arranged.

Default radial

InitialMode

Mode that applies initially, until arrange is called.

Default unset (i.e. inherits Mode value)

InitialSelect

If set, select is immediately called on the item at specified index.

That is, this:

ScatterObj = new Scatter(Container,{InitialSelect:0})
is equivalent to this:
ScatterObj = new Scatter(Container,{});
ScatterObj.select(0)

Default unset

SelectedClass

Class to add to the item when selected (and remove when discarded).

Default "selected"

SelectedScale

A selected item is scaled to this value.

Default 1.5

Scale

All unselected items are scaled to this value.

Default 1.0

MaxRotation

How much each item can be rotated.

This value is a magnitude, so range of rotation is twice (from negative to positive).

Default 10

Shuffle

Whether item ordering should be shuffled.

Default true for random,radial; false for all other modes.

ContainerEvents

An object indicating functions to bind to specific events on the container.

The built-in methods must be defined as strings, but for all other functions, pass in the function itself.

Default value is {click:"arrange"} - i.e. clicking the container arranges items.

To disable default behaviour without specifying a new function, use {click:void 0}

ChildEvents

An object indicating functions to bind to specific events on the children of the container.

The built-in methods must be defined as strings, but for all other functions, pass in the function itself.

Default is {click:"select"} - i.e. clicking a container child selects that item.

To disable default behaviour without specifying a new function, use {click:void 0}

Mode-specific options

The options listed below only apply when arranging items by the mode the option name starts with (i.e. grid, pile, radial, fixed).

GridAlignCenter

Boolean, specifies whether items in grid mode should be centered (true), or in top left (false).

Default true

GridSpacing

Integer, how many pixels of space should seperate items in grid mode.

Default 1

GridSpacingX

Override GridSpacing horizontally.

Default unset

GridSpacingY

Override GridSpacing vertically.

Default unset

PileOffsetFactor

Numeric. The width of an item is divided by this number to determine maximum random offset.

Default 3

RadialWidthFactor

Numeric. The random horizontal offset for radial mode is multiplied by this number.

Default 0.85

RadialHeightFactor

Numeric. The random vertical offset for radial mode is multiplied by this number.

Default 1.2

RadialMinDistance

Numeric. The smallest random offset allowed - prevents too much clustering in the center.

Default 0.5

FixedRelativeTo

Whether fixed mode positions are relative to the top left corner, or center of the container.

Default center

FixedPositions

Array of item positions; accepts arrays or objects (but not both in same array).

[x,y], [x,y,angle], {left:x,top:y}, {left:x,top:y,angle:a}

Default: unset