Port layouts
layout.Port
import provides special layout functions for the port layout.
Built-in port layouts​
Absolute​
A layout function which lays all ports at a given point (defined as x
, y
coordinates or percentage of the element dimensions).
name | string |
| |||||||
args | object |
|
{
name: 'absolute',
args: {
x: '10%',
y: 10,
angle: 45
}
}
Line​
A layout function which spreads ports evenly along a line defined by a start
and end
point.
name | string |
| |||||||||||||||||
args | object |
|
{
name: 'line',
args: {
start: { x: 10, y: 10 },
end: { x: 'calc(w)', y: '50%' },
angle: 45
}
}
On sides​
Simple layout functions suitable for rectangular shapes. They spread ports evenly along a single side of the shape.
The 'left'
layout is the default port layout function.
name | string | Can be either | |||||||||||
args | object |
|
{
name: 'left',
args: {
x: 10,
y: 10,
angle: 30,
dx: 1,
dy: 1
}
}
Radial​
Layout functions suitable for circular shapes.
- The
'ellipseSpread'
layout spreads ports evenly along an ellipse. - The
'ellipse'
layout spreads ports from the point defined bystartAngle
leaving gaps between ports equal tostep
.
name | string | Can be either | ||||||||||||||||||||
args | object |
|
{
name: 'ellipseSpread',
args: {
dx: 1,
dy: 1,
dr: 1,
startAngle: 10,
step: 10,
compensateRotation: false
}
}