Skip to content
Office Open

PPTX

Lines and Connectors

Add lines and connector shapes between elements

Use the line property for straight lines and the connector property for lines with arrowheads.

#Line Shape

Lines use start/end point coordinates:

JSON
{
  "slides": [
    {
      "children": [
        {
          "line": {
            "x1": 50,
            "y1": 120,
            "x2": 800,
            "y2": 120,
            "properties": {
              "outline": {
                "color": "4472C4",
                "width": 2
              }
            }
          }
        }
      ]
    }
  ]
}

#Vertical Line

JSON
{
  "slides": [
    {
      "children": [
        {
          "line": {
            "x1": 200,
            "y1": 150,
            "x2": 200,
            "y2": 450,
            "properties": {
              "outline": {
                "color": "ED7D31",
                "width": 2
              }
            }
          }
        }
      ]
    }
  ]
}

#Diagonal Line

JSON
{
  "slides": [
    {
      "children": [
        {
          "line": {
            "x1": 250,
            "y1": 150,
            "x2": 750,
            "y2": 450,
            "properties": {
              "outline": {
                "color": "70AD47",
                "width": 3
              }
            }
          }
        }
      ]
    }
  ]
}

#Connector with Arrowheads

Connectors support arrowhead endpoints:

JSON
{
  "slides": [
    {
      "children": [
        {
          "connector": {
            "x1": 50,
            "y1": 130,
            "x2": 400,
            "y2": 130,
            "properties": {
              "outline": {
                "color": "4472C4",
                "width": 2,
                "tailEnd": {
                  "type": "triangle"
                }
              }
            }
          }
        },
        {
          "connector": {
            "x1": 50,
            "y1": 200,
            "x2": 400,
            "y2": 200,
            "properties": {
              "outline": {
                "color": "ED7D31",
                "width": 2,
                "headEnd": {
                  "type": "triangle"
                },
                "tailEnd": {
                  "type": "triangle"
                }
              }
            }
          }
        }
      ]
    }
  ]
}

#Arrowhead Types

Arrowheads are set via the type field of outline.headEnd (start) / outline.tailEnd (end):

ValueDescription
"triangle"Filled triangle
"stealth"Stealth arrow
"diamond"Diamond shape
"oval"Oval circle
"arrow"Open arrow
"none"No arrowhead

Arrowheads also support size control:

JSON
{
  "slides": [
    {
      "children": [
        {
          "connector": {
            "x1": 500,
            "y1": 410,
            "x2": 800,
            "y2": 410,
            "properties": {
              "outline": {
                "color": "ED7D31",
                "width": 2,
                "tailEnd": {
                  "type": "triangle",
                  "width": "large",
                  "length": "large"
                }
              }
            }
          }
        }
      ]
    }
  ]
}

#Line Options

PropertyTypeDescription
x1numberStart X position
y1numberStart Y position
x2numberEnd X position
y2numberEnd Y position
fillFillOptionsLine fill
outlineOutlineOptionsOutline (color, width, dash, headEnd, tailEnd, ...)

#Connector Options

PropertyTypeDescription
x1numberStart X position
y1numberStart Y position
x2numberEnd X position
y2numberEnd Y position
fillFillOptionsLine fill
outlineOutlineOptionsOutline (color, width, dash, headEnd, tailEnd, ...) — arrows via headEnd/tailEnd

#OutlineOptions

PropertyTypeDescription
type"noFill" | "solidFill" | "gradFill" | "pattFill"Fill type (omitted → solidFill when color is present)
colorstring | SolidFillOptionsColor (sRGB hex string sugar, e.g. "4472C4")
widthnumber | UniversalMeasureLine width
dash"solid" | "dash" | "dot" | "dashDot" | ...Preset dash style
headEnd{ type?, width?, length? }Start arrowhead
tailEnd{ type?, width?, length? }End arrowhead