Port label layouts
layout.PortLabel
import provides built-in label layout functions.
Built-in port label layoutsβ
Inside/Outsideβ
Places the label inside or outside of a rectangular shape. Where 'oriented' versions rotate the text towards the element center. The args
object is optional.
name | string | Can be either | |||||||||||||||
args | object |
|
label: {
position: {
name :'outsideOriented',
args: {
offset: 10,
attrs: {}
}
}
}
Manual placementβ
It allows setting label position directly.
name | string |
| ||||||||||||
args | object |
|
label: {
position: {
name: 'manual',
args: {
x: 10,
y: 20,
angle: 45,
attrs: {}
}
}
}
On Sidesβ
Simple label layout suitable for rectangular shapes. It places the label on arbitrary side of a port. The args
object is optional.
name | string | Can be either | ||||||||||||
args | object |
|
label: {
position: {
name : 'right',
args: {
x: 0,
y: 0,
angle: 0,
attrs: {}
}
}
}
Radialβ
Places the label outside of a circular shape. Where the 'oriented' version rotates the text towards the element center. The args
object is optional.
name | string | Can be either | |||||||||||||||
args | object |
|
label: {
position: {
name :'radialOriented',
args: {
offset: 0,
attrs: {}
}
}
}