ElementPort
Declarative port description for elementPort and elementPorts.
Captures the common port styling and label options in a flat shape, which the
presets expand into a full dia.Element.Port.
Properties
className?
optional className?: string;
Extra CSS class added to the port shape alongside the built-in jj-port class.
Default
''
color?
optional color?: string;
Fill color of the port shape. Any CSS color; when empty the port inherits the jj-port stylesheet fill.
Default
''
cx?
optional cx?: string | number;
Horizontal position of the port, relative to the element, for absolute
placement. Accepts a number or a calc() expression such as 'calc(w)'.
Omit to let the port group position the port instead.
cy?
optional cy?: string | number;
Vertical position of the port, relative to the element, for absolute
placement. Accepts a number or a calc() expression such as 'calc(h)'.
Omit to let the port group position the port instead.
height?
optional height?: number;
Height of the port shape, in pixels.
Default
8
label?
optional label?: string;
Text label rendered next to the port. Omit for an unlabeled port.
labelClassName?
optional labelClassName?: string;
Extra CSS class added to the label alongside the built-in jj-port-label class.
Default
''
labelColor?
optional labelColor?: string;
Color of the label text. Any CSS color; when empty the color comes from the stylesheet.
Default
''
labelFontFamily?
optional labelFontFamily?: string;
Font family of the label text. When empty the family comes from the stylesheet.
Default
''
labelFontSize?
optional labelFontSize?: number;
Font size of the label text, in pixels. When empty the size comes from the stylesheet.
Default
''
labelOffsetX?
optional labelOffsetX?: number;
Horizontal offset of the label from its computed position, in pixels.
labelOffsetY?
optional labelOffsetY?: number;
Vertical offset of the label from its computed position, in pixels.
labelPosition?
optional labelPosition?: string;
Placement of the label relative to the port, e.g. 'outside', 'inside', or a side name.
Default
'outside'
outline?
optional outline?: string;
Outline (stroke) color of the port shape. Any CSS color; when empty the stroke comes from the stylesheet.
Default
''
outlineWidth?
optional outlineWidth?: number;
Outline (stroke) width of the port shape, in pixels. Empty leaves the stroke width unset.
Default
''
passive?
optional passive?: boolean;
Restricts the port to being a link target only; links cannot be started from it.
Default
false
shape?
optional shape?: ElementPortShape;
Shape of the port body.
Default
'ellipse'
width?
optional width?: number;
Width of the port shape, in pixels.
Default
8