DiagramConnectorSegmentModel

23 Sep 20252 minutes to read

Interface for a class DiagramConnectorSegment

Properties

allowDrag boolean

Defines the segment to be drag or not

direction Direction

Sets the direction of orthogonal segment

  • Left - Sets the direction type as Left
  • Right - Sets the direction type as Right
  • Top - Sets the direction type as Top
  • Bottom - Sets the direction type as Bottom

length number

Defines the length of orthogonal segment

<div id='diagram'></div>
let connectors: ConnectorModel[] = [{
      id: 'link2', sourcePoint: { x: 0, y: 0 }, targetPoint: { x: 40, y: 40 }, type: 'Orthogonal',
      shape: {
          type: 'Bpmn',
          flow: 'Message',
          association: 'directional'
      }, style: {
          strokeDashArray: '2,2'
      },
      segments: [{ type: 'Orthogonal', length: 30, direction: 'Bottom' },
      { type: 'Orthogonal', length: 80, direction: 'Right' }]
  }];
let diagram: Diagram = new Diagram({
...
connectors: connectors
...
});
diagram.appendTo('#diagram');

point PointModel

Sets the end point of the connector segment

point1 PointModel

Sets the first control point of the connector

point2 PointModel

Sets the second control point of the connector

type Segments

Defines the type of the segment

  • Straight - Sets the segment type as Straight
  • Orthogonal - Sets the segment type as Orthogonal
  • Bezier - Sets the segment type as Bezier

vector1 VectorModel

Defines the length and angle between the source point and the first control point of the diagram

vector2 VectorModel

Defines the length and angle between the target point and the second control point of the diagram