SpiralLayout
extends Layout
The SpiralLayout class represents a layout that positions objects along an Archimedean spiral around a center point: each successive child sits at a slightly larger radius and a further-rotated angle than the one before it (radius(i) = startRadius + radiusStep * i, angle(i) = startAngle + direction * angleStep * i). To create a SpiralLayout object and apply it to a collection, use the layout function:
let sl = msc.layout("spiral", {x: 200, y: 200, startRadius: 10, radiusStep: 8, angleStep: 40});
collection.layout = sl;
Properties#
| property | explanation | type | default value |
|---|
| angleStep | the angle (in degrees) added between consecutive children | Number | 40 |
| direction | the AngularDirection the spiral winds in (“clockwise” or “anti-clockwise”) | String | “clockwise” |
| markRotation | how each child is oriented as it’s placed along the spiral: "outward" (faces away from center), "inward" (faces toward center), "tangentialClockwise" / "tangentialCounterClockwise" (faces along the tangent, in that direction of travel), or "upright" (orientation never changes, regardless of position) | String | “tangential” |
| radiusStep | the amount the radius grows between consecutive children | Number | 8 |
refElements  | the reference elements used by this layout | Array | [] |
| startAngle | the angle (in degrees) of the first child | Number | 0 |
| startRadius | the radius of the first child | Number | 0 |
| type | the type of the layout | String | “spiral” |
| x | the x coordinate of the spiral’s center | Number | 100 |
| y | the y coordinate of the spiral’s center | Number | 100 |
Methods#
| method | explanation | return type |
|---|
| clone() | returns a copy of this layout | SpiralLayout |
Methods inherited from Layout#
| method | explanation | return type |
|---|
| addRefElement(re) | adds a reference element to this layout | void |
| clearRefElements() | removes all reference elements from this layout | void |