OPF

Search docs

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

    Shape Path

    Custom geometry: SVG path data (M, L, H, V, C, S, Q, T, A and Z, absolute or relative) instead of a preset. PPTX export writes a:custGeom with the same path. A subpath that ends without Z is open: arrowheads draw at its ends (its fill closes it, as in PowerPoint).

    Metadata

    Definition
    #/$defs/ShapePath
    Form
    2 inclusive forms (anyOf)
    Source
    spec/schemas/opf.schema.json

    Field index

    This definition uses the forms or value constraints below.

    anyOf 1 · string

    SVG path data in a 0 to 1 box: x and y run from 0 (left, top) to 1 (right, bottom) of the block, for example "M0 0 L1 0 L0.5 1 Z".

    Exact constraints for anyOf 1
    anyOf 1 schema
    {
      "type": "string",
      "minLength": 1,
      "description": "SVG path data in a 0 to 1 box: x and y run from 0 (left, top) to 1 (right, bottom) of the block, for example \"M0 0 L1 0 L0.5 1 Z\"."
    }

    anyOf 2 · object

    SVG path data with its own viewBox, for example an icon outline drawn on a 24 by 24 grid.

    FieldTypeReq.DefaultDescription
    dstringyes—SVG path data in the viewBox.
    viewBoxstringyes—The path's own box, 'minX minY width height' as in SVG; it is stretched to the block.

    d

    typestringrequiredyesdefault—

    SVG path data in the viewBox.

    viewBox

    typestringrequiredyesdefault—pattern^\s*-?[0-9.]+([ ,]+-?[0-9.]+){3}\s*$

    The path's own box, 'minX minY width height' as in SVG; it is stretched to the block.

    Exact constraints for anyOf 2
    anyOf 2 schema
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "d",
        "viewBox"
      ],
      "properties": {
        "d": {
          "type": "string",
          "minLength": 1,
          "description": "SVG path data in the viewBox."
        },
        "viewBox": {
          "type": "string",
          "pattern": "^\\s*-?[0-9.]+([ ,]+-?[0-9.]+){3}\\s*$",
          "description": "The path's own box, 'minX minY width height' as in SVG; it is stretched to the block."
        }
      },
      "description": "SVG path data with its own viewBox, for example an icon outline drawn on a 24 by 24 grid."
    }
    Complete definition constraints
    Schema constraints
    {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "description": "SVG path data in a 0 to 1 box: x and y run from 0 (left, top) to 1 (right, bottom) of the block, for example \"M0 0 L1 0 L0.5 1 Z\"."
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "d",
            "viewBox"
          ],
          "properties": {
            "d": {
              "type": "string",
              "minLength": 1,
              "description": "SVG path data in the viewBox."
            },
            "viewBox": {
              "type": "string",
              "pattern": "^\\s*-?[0-9.]+([ ,]+-?[0-9.]+){3}\\s*$",
              "description": "The path's own box, 'minX minY width height' as in SVG; it is stretched to the block."
            }
          },
          "description": "SVG path data with its own viewBox, for example an icon outline drawn on a 24 by 24 grid."
        }
      ],
      "description": "Custom geometry: SVG path data (M, L, H, V, C, S, Q, T, A and Z, absolute or relative) instead of a preset. PPTX export writes a:custGeom with the same path. A subpath that ends without Z is open: arrowheads draw at its ends (its fill closes it, as in PowerPoint).",
      "examples": [
        "M0 0 L1 0 L0.5 1 Z",
        {
          "d": "M12 2 L22 22 L2 22 Z",
          "viewBox": "0 0 24 24"
        }
      ]
    }