Transforming Layouts
Layout transformations modify an existing layout, such as by repositioning elements to avoid overlaps.
Avoiding overlaps
Jittering
Randomly perturb positions.
Attribute | Type | Description |
---|---|---|
type | "jitter" | |
x? | number | x-coordinate may be altered by $-x/2 < = dx < = x/2$ |
y? | number | y-coordinate may be altered by $-y/2 < = dy < = y/2$ |
1D Offset to avoid overlap
Offset positions of elements (either horizontally or vertically) to avoid overlap.Minimises the sum-of-squares of displacements.
Attribute | Type | Description |
---|---|---|
type | "offset" | |
direction | "vertical" or "horizontal" | Which direction to offset positions in. |
width? | number | Maximise width (or height) within which offset elements should fit. |
minSpacing? | number | Minimum spacing between adjacent elements. |
condition? | string | If set, elements for which this expression evaluates to false will be ignored. |
Beeswarm
Apply a Beeswarm transformation, by doing a force-based simulation in which elements are attracted to their original positions, but also pushed apart by a collision force.
Attribute | Type | Description |
---|---|---|
type | "beeswarm" | |
gravityX? | number | Strength of horizontal force pulling nodes to their original position (default: 0.1). |
gravityY? | number | Strength of vertical force pulling nodes to their original position (default: 0.1). |
collisionStrength? | number | Strength of force avoiding overlaps (default: 1) |
collisionStrength? | number | Strength of force avoiding overlaps (default: 1) |
Other
Translation
Apply a x
or y
translation of the elements of the layouts.
Attribute | Type | Description |
---|---|---|
type | "translate" | |
x? | number | Amplitude of the horizontal translation |
y? | number | Amplitude of the horizontal translation |
Set position
Set x
/y
/width
/height
of elements in a layout.
Attribute | Type | Description |
---|---|---|
type | "set" | |
field | "width" or "height" or "x"or "y" | Which field to set. |
value | number | New value to assign to field. |
Orient Links
Move target of links to align horizontally with source.
Attribute | Type | Description |
---|---|---|
direction | "vertical" or "horizontal" | Direction in which to orient links. |
network | string | The network containing the links. |
network | string | The network containing the links. |