Port layouts
layout.Port
import provides special layout functions for the port layout.
Built-in port layoutsβ
Absoluteβ
It lays a port out at the given position (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 which evenly spreads ports 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%' }
}
}
On sidesβ
A simple layout suitable for rectangular shapes. It evenly spreads ports along a single side.
name | string | Can be either | ||||||||||||||
args | object |
|
{
name: 'left',
args: {
x: 10,
y: 10,
angle: 30,
dx: 1,
dy: 1
}
}
Radialβ
Suitable for circular shapes. The ellipseSpreads
evenly spreads ports along an ellipse. The ellipse
spreads ports from the point at startAngle
leaving gaps between ports equal to step
.
name | string | Can be either | |||||||||||||||||||||||
args | object |
|
{
name: 'ellipseSpread',
args: {
dx: 1,
dy: 1,
dr: 1,
startAngle: 10,
step: 10,
compensateRotation: false
}
}