Skip to main content

Connector

A connector is a line element that connects two points or items on the project map. Connectors support multiple line styles (straight, angled, curved) and customizable decorators (arrows, circles) at the endpoints.

Item type: connector

Properties

PropertyTypeRequiredUpdatableDefaultDescription
positionobjectNoIgnored for connectors. Position is determined by startPoint and endPoint.
sizeobjectNoIgnored for connectors. Size is calculated automatically.
scalenumberNoIgnored for connectors.
anglenumberNoIgnored for connectors.
typestringNoYes"Straight"Line type: "Straight", "Angled", or "Curved".
strokeColorstringNoYesAccent colorStroke color as a CSS color string (e.g., "#FF0000", "rgb(255,0,0)").
strokeThicknessnumberNoYes3Line thickness in pixels. Must be ≥ 0.
cornerPointsarrayNoYes[]Array of corner points for "Angled" connectors. Each point has x and y fields.
radiusnumberNoYes0.5Corner radius for "Angled" connectors. Must be ≥ 0.
startPointobjectYesYesStart point configuration. See Connector Point below.
endPointobjectYesYesEnd point configuration. See Connector Point below.

Connector Point

Both startPoint and endPoint use the ConnectorPointDto structure:

PropertyTypeRequiredDefaultDescription
edgebooleanNotrueWhether to connect to the edge of an item (if itemId is specified).
positionobjectYes{ x: 0, y: 0 }Absolute position on the map with x and y fields.
itemIdstring (GUID)NonullID of an item to attach to. When specified, the connector follows the item.
decoratorstringNo"ArrowLine"Endpoint decorator: "None", "Arrow", "ArrowLine", or "Circle".

Line Types

  • Straight: Direct line between start and end points
  • Angled: Polyline with 90-degree angles (uses cornerPoints and radius)
  • Curved: Smooth cubic Bézier curve

Decorators

  • None: No decorator
  • Arrow: Filled arrow
  • ArrowLine: Arrow outline
  • Circle: Circle at the endpoint

Create

Creates a new connector item in the project.

POST /api/v2/projects/{projectId}/item/{parent}/connector

curl

curl -X POST "https://api.deon.cloud/api/v2/projects/{projectId}/item/inbox/connector" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"type": "Straight",
"strokeColor": "#0078D4",
"strokeThickness": 2,
"startPoint": {
"position": { "x": 100, "y": 100 },
"decorator": "None"
},
"endPoint": {
"position": { "x": 300, "y": 200 },
"decorator": "ArrowLine"
}
}'

JavaScript

const response = await fetch(
`https://api.deon.cloud/api/v2/projects/${projectId}/item/inbox/connector`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
type: "Straight",
strokeColor: "#0078D4",
strokeThickness: 2,
startPoint: {
position: { x: 100, y: 100 },
decorator: "None",
},
endPoint: {
position: { x: 300, y: 200 },
decorator: "ArrowLine",
},
}),
}
);

const result = await response.json();
console.log(result.itemId); // "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Update

Updates an existing connector item.

PATCH /api/v2/projects/{projectId}/item/connector/{itemId}

curl

curl -X PATCH "https://api.deon.cloud/api/v2/projects/{projectId}/item/connector/{itemId}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"properties": {
"strokeColor": "#FF5733",
"strokeThickness": 4,
"type": "Curved"
}
}'

JavaScript

const response = await fetch(
`https://api.deon.cloud/api/v2/projects/${projectId}/item/connector/${itemId}`,
{
method: "PATCH",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
properties: {
strokeColor: "#FF5733",
strokeThickness: 4,
type: "Curved",
},
}),
}
);

const result = await response.json();
console.log(result.itemId);

Example: Connect Two Items

You can attach a connector to existing items by specifying their IDs:

const response = await fetch(
`https://api.deon.cloud/api/v2/projects/${projectId}/item/inbox/connector`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
type: "Angled",
strokeColor: "#28A745",
strokeThickness: 2,
radius: 10,
startPoint: {
itemId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Source item ID
position: { x: 0, y: 0 }, // Relative position
edge: true,
decorator: "Circle",
},
endPoint: {
itemId: "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy", // Target item ID
position: { x: 0, y: 0 }, // Relative position
edge: true,
decorator: "Arrow",
},
}),
}
);

When itemId is specified and edge is true, the connector automatically attaches to the nearest edge of the item and follows it when the item is moved.