OPF

Search docs

Loading documentation…
    OpenPresentation/opf
    Browse docs
    On this page
    View source

    Connector

    What a connector joins and how it runs. Each end attaches to a connection site of its shape: a preset's own sites (turned and flipped with the shape), or the four edge midpoints of a block that is not a shape (DrawingML's rect: 0 top, 1 left, 2 bottom, 3 right). Without 'fromSite' and 'toSite' core chooses the pair of sites that face each other with the shortest route.

    Metadata

    Definition
    #/$defs/Connector
    Form
    object
    Source
    spec/schemas/opf.schema.json

    Field index

    FieldTypeReq.Description
    fromstringyesThe id of the block or overlay shape on this slide the connector starts at. An id that is not on the slide is a finding (opf/connector-end-missing) and the connector is not drawn.
    tostringyesThe id of the block or overlay shape on this slide the connector ends at.
    routeenum—straight is one segment (straightConnector1); elbow runs horizontally and vertically (bentConnector3, bentConnector2 between perpendicular sites); curved is PowerPoint's curved connector (curvedConnector3, curvedConnector2 between perpendicular sites). Default straight.
    route · Allowed values
    "straight""elbow""curved"
    fromSiteinteger—The connection site index at 'from' (DrawingML's cxn idx), instead of the automatic choice. An index the shape does not have is a validation error.
    toSiteinteger—The connection site index at 'to', instead of the automatic choice.

    from

    typestringrequiredyesdefault—

    The id of the block or overlay shape on this slide the connector starts at. An id that is not on the slide is a finding (opf/connector-end-missing) and the connector is not drawn.

    to

    typestringrequiredyesdefault—

    The id of the block or overlay shape on this slide the connector ends at.

    route

    typeenumrequirednodefault—

    straight is one segment (straightConnector1); elbow runs horizontally and vertically (bentConnector3, bentConnector2 between perpendicular sites); curved is PowerPoint's curved connector (curvedConnector3, curvedConnector2 between perpendicular sites). Default straight.

    route · Allowed values
    "straight""elbow""curved"
    route.json
    {
      "route": "straight"
    }

    fromSite

    typeintegerrequirednodefault—

    The connection site index at 'from' (DrawingML's cxn idx), instead of the automatic choice. An index the shape does not have is a validation error.

    toSite

    typeintegerrequirednodefault—

    The connection site index at 'to', instead of the automatic choice.

    Complete definition constraints
    Schema constraints
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "from",
        "to"
      ],
      "description": "What a connector joins and how it runs. Each end attaches to a connection site of its shape: a preset's own sites (turned and flipped with the shape), or the four edge midpoints of a block that is not a shape (DrawingML's rect: 0 top, 1 left, 2 bottom, 3 right). Without 'fromSite' and 'toSite' core chooses the pair of sites that face each other with the shortest route.",
      "properties": {
        "from": {
          "type": "string",
          "minLength": 1,
          "description": "The id of the block or overlay shape on this slide the connector starts at. An id that is not on the slide is a finding (opf/connector-end-missing) and the connector is not drawn."
        },
        "to": {
          "type": "string",
          "minLength": 1,
          "description": "The id of the block or overlay shape on this slide the connector ends at."
        },
        "route": {
          "type": "string",
          "enum": [
            "straight",
            "elbow",
            "curved"
          ],
          "description": "straight is one segment (straightConnector1); elbow runs horizontally and vertically (bentConnector3, bentConnector2 between perpendicular sites); curved is PowerPoint's curved connector (curvedConnector3, curvedConnector2 between perpendicular sites). Default straight."
        },
        "fromSite": {
          "type": "integer",
          "minimum": 0,
          "description": "The connection site index at 'from' (DrawingML's cxn idx), instead of the automatic choice. An index the shape does not have is a validation error."
        },
        "toSite": {
          "type": "integer",
          "minimum": 0,
          "description": "The connection site index at 'to', instead of the automatic choice."
        }
      },
      "examples": [
        {
          "from": "plan",
          "to": "build",
          "route": "elbow"
        },
        {
          "from": "a",
          "to": "b",
          "fromSite": 3,
          "toSite": 1
        }
      ]
    }