OPF
SpecDefinition referenceView source

Diagram

A diagram written as text. Engines parse the source, lay it out with the deck's measured fonts at the largest type size that fits the block, and draw it in the slide's resolved colors (color scheme, variant, color map and background); the PPTX export writes it as a native SVG picture with a PNG fallback. A string value in a diagram field is shorthand for { "source": value }.

Metadata

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

Field index

FieldTypeReq.Description
sourcestringyesThe diagram source. With syntax 'mermaid' (the default) it is Mermaid 12.1 text whose first line names the diagram type (flowchart, sequenceDiagram, classDiagram, stateDiagram-v2, erDiagram, gantt, pie, mindmap, timeline, journey, quadrantChart, xychart, sankey, gitGraph, C4Context, block, architecture-beta, kanban, packet, radar-beta, treemap, venn-beta, ishikawa, requirementDiagram and the other built-in families; ZenUML is not supported). Mermaid themes, colors in themeVariables and click callbacks are ignored: the deck's design decides the colors and fonts.
syntaxenum—The language of 'source'. Mermaid is the only syntax today.
syntax · Allowed values
"mermaid"
altstring—Text alternative that says what the diagram shows. Exported as the picture's description. Without it, engines derive one from the diagram's labels.

source

typestringrequiredyesdefault—

The diagram source. With syntax 'mermaid' (the default) it is Mermaid 12.1 text whose first line names the diagram type (flowchart, sequenceDiagram, classDiagram, stateDiagram-v2, erDiagram, gantt, pie, mindmap, timeline, journey, quadrantChart, xychart, sankey, gitGraph, C4Context, block, architecture-beta, kanban, packet, radar-beta, treemap, venn-beta, ishikawa, requirementDiagram and the other built-in families; ZenUML is not supported). Mermaid themes, colors in themeVariables and click callbacks are ignored: the deck's design decides the colors and fonts.

source.json
{
  "source": "flowchart LR\n  A[Idea] --> B[Prototype] --> C[Launch]"
}

syntax

typeenumrequirednodefaultmermaid

The language of 'source'. Mermaid is the only syntax today.

syntax · Allowed values
"mermaid"
syntax.json
{
  "syntax": "mermaid"
}

alt

typestringrequirednodefault—

Text alternative that says what the diagram shows. Exported as the picture's description. Without it, engines derive one from the diagram's labels.

alt.json
{
  "alt": "Ideas move from brief to approval; approved work is built, rejected work returns to the brief."
}
Complete definition constraints
Schema constraints
{
  "type": "object",
  "description": "A diagram written as text. Engines parse the source, lay it out with the deck's measured fonts at the largest type size that fits the block, and draw it in the slide's resolved colors (color scheme, variant, color map and background); the PPTX export writes it as a native SVG picture with a PNG fallback. A string value in a diagram field is shorthand for { \"source\": value }.",
  "additionalProperties": false,
  "required": [
    "source"
  ],
  "properties": {
    "source": {
      "type": "string",
      "minLength": 1,
      "description": "The diagram source. With syntax 'mermaid' (the default) it is Mermaid 12.1 text whose first line names the diagram type (flowchart, sequenceDiagram, classDiagram, stateDiagram-v2, erDiagram, gantt, pie, mindmap, timeline, journey, quadrantChart, xychart, sankey, gitGraph, C4Context, block, architecture-beta, kanban, packet, radar-beta, treemap, venn-beta, ishikawa, requirementDiagram and the other built-in families; ZenUML is not supported). Mermaid themes, colors in themeVariables and click callbacks are ignored: the deck's design decides the colors and fonts.",
      "examples": [
        "flowchart LR\n  A[Idea] --> B[Prototype] --> C[Launch]",
        "mindmap\n  root((Strategy))\n    Growth\n    Efficiency\n    People"
      ]
    },
    "syntax": {
      "type": "string",
      "enum": [
        "mermaid"
      ],
      "default": "mermaid",
      "description": "The language of 'source'. Mermaid is the only syntax today."
    },
    "alt": {
      "type": "string",
      "description": "Text alternative that says what the diagram shows. Exported as the picture's description. Without it, engines derive one from the diagram's labels.",
      "examples": [
        "Ideas move from brief to approval; approved work is built, rejected work returns to the brief."
      ]
    }
  }
}