Search results

PointPortModel

Interface for a class PointPort

Properties

addInfo

Object

Allows the user to save custom information/data about a port

constraints

PortConstraints

Defines the constraints of port

height

number

Sets the height of the port

horizontalAlignment

string

Sets the horizontal alignment of the port with respect to its immediate parent(node/connector)

  • Stretch - Stretches the diagram element throughout its immediate parent
  • Left - Aligns the diagram element at the left of its immediate parent
  • Right - Aligns the diagram element at the right of its immediate parent
  • Center - Aligns the diagram element at the center of its immediate parent
  • Auto - Aligns the diagram element based on the characteristics of its immediate parent

id

string

Defines the unique id of the port

margin

MarginModel

Defines the space that the port has to be moved from its actual position

offset

PointModel

Defines the position of the port with respect to the boundaries of nodes/connector

pathData

string

Defines the geometry of the port

shape

string

Defines the type of the port shape

  • X - Sets the decorator shape as X
  • Circle - Sets the decorator shape as Circle
  • Square - Sets the decorator shape as Square
  • Custom - Sets the decorator shape as Custom

style

ShapeStyleModel

Defines the appearance of the port

<div id='diagram'></div>
  let port: PointPortModel[] =
[{ id: 'port1', visibility: PortVisibility.Visible, shape: 'Circle', offset: { x: 0, y: 0 } },];
let nodes: NodeModel[] = [{
id: 'node1', width: 100, height: 100, offsetX: 100, offsetY: 100,
}];
nodes.ports = port;
let diagram: Diagram = new Diagram({
...
nodes : nodes,
...
});
diagram.appendTo('#diagram');

verticalAlignment

string

Sets the vertical alignment of the port with respect to its immediate parent(node/connector)

  • Stretch - Stretches the diagram element throughout its immediate parent
  • Top - Aligns the diagram element at the top of its immediate parent
  • Bottom - Aligns the diagram element at the bottom of its immediate parent
  • Center - Aligns the diagram element at the center of its immediate parent
  • Auto - Aligns the diagram element based on the characteristics of its immediate parent

visibility

PortVisibility

Defines the type of the port visibility

  • Visible - Always shows the port
  • Hidden - Always hides the port
  • Hover - Shows the port when the mouse hovers over a node
  • Connect - Shows the port when a connection end point is dragged over a node

width

number

Sets the width of the port