Skip to main content

Style reference for AI diagram generation

This document is a companion to mxfile.xsd and provides all information needed to programmatically generate valid draw.io (.drawio) files. All data was extracted from the draw.io source code.

See also: Generate and validate draw.io diagrams with AI and the .drawio file format


1. File Structure Overview​

A minimal valid draw.io file:

<mxfile>
<diagram id="page-1" name="Page-1">
<mxGraphModel dx="0" dy="0" grid="1" gridSize="10" guides="1"
tooltips="1" connect="1" arrows="1" fold="1"
page="1" pageScale="1" pageWidth="850" pageHeight="1100"
math="0" shadow="0">
<root>
<!-- Root container (always required, always id="0") -->
<mxCell id="0" />
<!-- Default layer (always required, always id="1", parent="0") -->
<mxCell id="1" parent="0" />
<!-- Diagram elements go here with parent="1" -->
</root>
</mxGraphModel>
</diagram>
</mxfile>

Critical Rules​

  1. The first two mxCell elements are mandatory structural cells:
    • id="0" — root container, no parent attribute
    • id="1" with parent="0" — default layer
  2. All diagram elements must have parent="1" or the id of a group/layer.
  3. IDs must be unique within the diagram. Use any string (e.g. "2", "node-1", "abc123").
  4. Vertices need vertex="1" and edges need edge="1". These are mutually exclusive.
  5. Edges should reference source and target via cell IDs. Edges without connections need explicit mxPoint sourcePoint/targetPoint.
  6. Always use uncompressed XML (no compressed="true"). AI should not generate compressed content.
  7. Style strings end with semicolon, for example: "rounded=1;whiteSpace=wrap;html=1;"
  8. Coordinates: origin (0,0) is top-left, x increases rightward, y increases downward.

2. Style String Format​

The style attribute on mxCell is a semicolon-separated list of key=value pairs:

key1=value1;key2=value2;key3=value3;

A style class name or shape name can appear as a bare token (without =):

ellipse;whiteSpace=wrap;html=1;fillColor=#DAE8FC;

Here ellipse sets the shape. Multiple bare tokens are possible for style class inheritance:

text;html=1;align=left;

Rules​

  • Keys and values are case-sensitive
  • No spaces around = or ;
  • Boolean values use 0 and 1 (not true/false)
  • Colors use #RRGGBB hex format (with #), none, or default
  • The trailing ; is conventional but not strictly required
  • Unknown keys are silently ignored

3. Shape Types​

3.1 Core mxGraph Shapes​

These shapes are defined in the mxGraph core library:

shape= valueDescriptionNotes
rectangleRectangle (default)Also the default if no shape specified
ellipseOval / ellipseUse aspect=fixed for circle
rhombusDiamondUse perimeter=rhombusPerimeter
triangleTriangleUse perimeter=trianglePerimeter
hexagonHexagonUse perimeter=hexagonPerimeter2
cloudCloudUse perimeter=cloudPerimeter
cylinder3D Cylinder
lineHorizontal line
arrowBlock arrow
arrowConnectorArrow-shaped connector
doubleEllipseDouble-bordered ellipse
imageImage containerRequires image=<url>
labelRectangle with icon areaDefault vertex shape
swimlaneContainer with header barUse startSize for header height
actorActor (stick figure outline)
connectorEdge connectorDefault edge shape

3.2 Extended Shapes (draw.io Shapes.js)​

These are registered via mxCellRenderer.registerShape():

shape= valueDescription
cube3D cube
isoCubeIsometric cube
isoCube2Isometric cube (variant 2)
isoRectangleIsometric rectangle
cylinder2Cylinder (variant 2, configurable)
cylinder3Cylinder (variant 3)
datastoreCylindrical data store
noteSticky note
note2Note (variant 2)
documentDocument page with curled bottom
folderFolder icon
cardCard with cut corner
tapePunched tape
tapeDataTape data storage
processProcess box (double-sided borders)
process2Same as process
stepStep/chevron arrow
plusPlus sign
extExtended rectangle (supports double=1)
calloutSpeech bubble
parallelogramParallelogram (use perimeter=parallelogramPerimeter)
trapezoidTrapezoid (use perimeter=trapezoidPerimeter)
curlyBracketCurly bracket
switchNetworking switch shape
transparentInvisible shape
messageEnvelope/message
cornerL-shaped corner
crossbarCross bar
teeT-shaped connector
singleArrowSingle arrow
doubleArrowDouble-headed arrow
flexArrowFlexible arrow
wireWire connector
waypointWaypoint marker
manualInputManual input (flowchart)
internalStorageInternal storage (flowchart)
dataStorageData storage (flowchart)
loopLimitLoop limit (flowchart)
offPageConnectorOff-page connector
delayDelay shape
displayDisplay device
orOR gate
orEllipseOR ellipse
xorXOR gate
sumEllipseSum/sigma ellipse
sortShapeSort shape
collateCollate shape
crossCross / X shape
dimensionDimension line
partialRectangleRectangle with configurable borders
lineEllipseLine with ellipse
linkLink / chain shape
pipePipe connector
zigzagZigzag connector
filledEdgeFilled edge connector
taperedArrowConnector that tapers from startWidth (default 12) to endWidth (default 2). Supports rounded and curved, and fillColor / gradientColor like flexArrow (no fill by default). startSize / endSize is how much wider the arrow head is than the band at that end.
tableTable container. evenRowColor / oddRowColor and evenColumnColor / oddColumnColor add alternating stripes to rows and columns
tableRowTable row
tableLineTable line
rect2Alternative rectangle
tieTie that bundles edges (with tie=1, see §4.4): a line across the lanes of its edges with a head at one end, drawn with strokeColor, strokeWidth and dashed. New ties use shape=tie;tie=1;resizable=0;rotatable=0;connectable=0;fillColor=none;strokeWidth=3;

3.3 UML Shapes​

shape= valueDescription
umlActorUML stick figure
umlBoundaryUML boundary
umlEntityUML entity
umlDestroyUML destruction mark
umlControlUML control
umlLifelineUML lifeline
umlFrameUML frame
umlStateUML state (use perimeter=mxPerimeter.StatePerimeter)
lollipopUML provided interface
requiresUML required interface
requiredInterfaceUML required interface (arc)
providedRequiredInterfaceUML assembly connector
moduleUML module
componentUML component
associativeEntityER associative entity
endStateState diagram end state
startStateState diagram start state

3.4 Stencil Libraries​

Additional shapes are available via stencil libraries in the stencils/ directory. Use with: shape=stencil(<library>.<shape>) or shape=mxgraph.<library>.<shape>.

Major libraries:

  • mxgraph.flowchart.* — Flowchart shapes
  • mxgraph.bpmn.* — BPMN shapes
  • mxgraph.aws4.* — AWS architecture icons
  • mxgraph.azure.* — Azure architecture icons
  • mxgraph.gcp.* / mxgraph.gcp2.* — Google Cloud icons
  • mxgraph.cisco.* / mxgraph.cisco19.* — Cisco networking
  • mxgraph.kubernetes.* — Kubernetes icons
  • mxgraph.uml.* — UML shapes
  • mxgraph.er.* — Entity-relationship shapes
  • mxgraph.electrical.* — Electrical engineering symbols
  • mxgraph.pid.* — Piping and instrumentation
  • mxgraph.mockup.* — UI wireframe components
  • mxgraph.lean_mapping.* — Lean mapping
  • mxgraph.eip.* — Enterprise integration patterns

4. Style Properties Reference​

4.1 Fill and Stroke​

PropertyValuesDefaultDescription
fillColor#RRGGBB, none, default, keyworddefaultShape fill color
gradientColor#RRGGBB, none, keywordnoneGradient end color (gradient from fillColor to gradientColor)
gradientDirectionnorth, south, east, westsouthGradient direction
strokeColor#RRGGBB, none, default, keyworddefaultBorder/stroke color
strokeWidthnumber1Border width in pixels
dashed0, 10Dashed stroke
dashPatternstring—Dash pattern, e.g. "1 3" (1px dash, 3px gap), "8 8"
opacity0–100100Overall opacity (0=transparent, 100=opaque)
fillOpacity0–100100Fill opacity only
strokeOpacity0–100100Stroke opacity only
glass0, 10Glass/shine overlay effect
shadow0, 10Drop shadow (also controlled globally on mxGraphModel)
multiple0, 10Paints copies of a vertex stacked behind it, for example to show several instances. Connectors end on the outline of the stack instead of crossing the copies. The label and the selection stay on the front shape. Ignored on edges
multipleCount1–102With multiple=1: number of copies behind the shape
multipleDxnumber8With multiple=1: horizontal offset of each copy from the one in front of it, in pixels on the page (also for rotated and flipped shapes)
multipleDynumber-8With multiple=1: vertical offset of each copy from the one in front of it, in pixels on the page (negative values go up)
opacityGroup0, 10Applies opacity to the shape as a whole, so that overlapping parts (the line under a filled arrow head, the stroke over the fill) do not get darker. Set together with the opacity in the Style tab

4.2 Shape Geometry​

PropertyValuesDefaultDescription
shapesee Shape Types abovelabelShape type
perimetersee Perimeters belowrectanglePerimeterConnection point calculation
rounded0, 10Round the corners of rectangles, polygons (e.g. rhombus, triangle, hexagon) and shapes with curved sides (document, tape, dataStorage, or, xor). On curved sides the rounding follows the tangent of the curve
arcSizenumber—Corner size for rounded shapes. Rectangle-based shapes (e.g. rectangle, label, process): the radius is arcSize percent of the shorter side (0–50, default 15), or arcSize / 2 pixels with absoluteArcSize=1. Other shapes (polygons, document, tape, dataStorage, or, xor): the radius is arcSize / 2 pixels (default 20), at most half of each side
aspectvariable, fixedvariablefixed preserves width/height ratio
directionnorth, south, east, west—Rotate shape by 90° increments
flipH0, 10Flip horizontally
flipV0, 10Flip vertically
rotationnumber (degrees)0Free rotation angle (0–360)
fixedSize0, 10Shape keeps size independent of label
roundedPerimeter0, 10With rounded=1 on rectangles and labels, perimeter connection points and floating edges end on the rounded outline instead of the bounding box. Corner connection points sit at 45° on the arc. Other shapes: see below

roundedPerimeter also applies to process and internalStorage, and to triangle, rhombus, hexagon, parallelogram, trapezoid and step with their default perimeter, where connectors end on the rounded corners as painted. Other shapes ignore it. The Rounded sets the key on all of these shapes when applied.

4.3 Text and Labels​

PropertyValuesDefaultDescription
html0, 11Enable HTML label rendering
whiteSpacewrap, nowrap—Text wrapping mode. Use wrap for most shapes
fontSizenumber12Font size in pixels
fontFamilystringHelveticaFont family name
fontColor#RRGGBB, default, keyworddefaultText color
fontStylebitmask0Font style: 0=normal, 1=bold, 2=italic, 4=underline (combine by adding: 3=bold+italic)
alignleft, center, rightcenterHorizontal text alignment
verticalAligntop, middle, bottommiddleVertical text alignment
labelPositionleft, center, rightcenterHorizontal label position relative to shape
verticalLabelPositiontop, middle, bottommiddleVertical label position relative to shape
labelPerimeter0, 10On a shape whose label is outside its outline, centred on one side (verticalLabelPosition=top or bottom with labelPosition=center, or labelPosition=left or right with verticalLabelPosition=middle), connectors that would cross the label end at its outline instead (plus the perimeter spacing), and a fixed connection point on that side moves to the far edge of the label. Ignored on rotated and flipped shapes. Automatically set on library shapes with an outside label, and when the Position in the Text tab is changed to an outside position.
overflowvisible, hidden, fill, width—Text overflow handling
spacingnumber2General padding in pixels
spacingTopnumber0Top padding
spacingBottomnumber0Bottom padding
spacingLeftnumber0Left padding
spacingRightnumber0Right padding
textOpacity0–100100Text opacity
labelPlacementauto—On a connector or a connector label: the label stays horizontal and sits just above horizontal segments, or below when something is in the way, and on the line (with a label gap) on vertical and diagonal segments. It avoids bends and arrowheads, and a label that doesn't fit its segment moves to the nearest longer segment. Placed again when the route changes. A label with an offset maintains that offset and only moves to the side appropriate for its segment. Not applied to vertical text (horizontal=0)
labelBackgroundColor#RRGGBB, none, default—Background behind text (useful for edge labels). Shown as None (none) or Solid (a colour) in the Background list of the Text tab
defaultLabelBackgroundColorpage—With labelBackgroundColor=default: no background, the label box is cut out of the shape and of the parent edge, so the page and the cells behind the label stay visible. gap has the same effect. The default edge style sets it, so new edges and edge labels use it. Shown as Transparent in the Background list of the Text tab, which offers it for edges and their label cells
inheritText1, comma-separated keys—On a label cell of an edge: the text styles that the label takes from the edge, 1 for all of fontFamily (with fontSource), fontSize, fontColor, fontStyle, textOpacity, labelBorderColor, labelBorderWidth, labelBackgroundColor, defaultLabelBackgroundColor and labelPadding. The label also stores the values of the edge in these keys for applications that don't support inheritText. Setting one of these keys on the label removes it from the list. The value inherit of one of these keys also takes it from the edge. New double-click labels and the label cells of the edge templates use inheritText=1; Use Connector Style in the Text tab sets it again
labelBorderColor#RRGGBB, none—Border around label
labelWidthnumber—Fixed label width
textDirectiondefault, ltr, rtldefaultText direction
horizontal0, 110 for vertical text. For swimlanes and table rows, it also sets the side of the title region; combine horizontal=1;direction=north for a title on the left with horizontal text

4.4 Edge / Connector Properties​

PropertyValuesDefaultDescription
edgeStylesee Edge Styles below—Routing algorithm
tiescomma-separated cell IDs—IDs of the tie vertices (tie=1) the edge runs through, in order from source to target. The bundled edge passes each tie in its own lane and is routed between its terminals and the ties with its edgeStyle (edges without an edgeStyle get a short straight piece along each tie). Waypoints and libavoidRouting are ignored while the edge has ties. IDs of missing or hidden cells are ignored. The edge stays one edge (source, target, labels and arrows are unchanged)
tie0, 10On a vertex: the vertex is a tie that the edges listing its ID in ties run through. Its center is where its edges cross it and its size follows the number of lanes. It points in the direction most of its edges travel, or along an axis if all of them are orthogonal
tieSpacingnumber6On a tie: distance between the lanes of its edges
libavoidRouting0, 10Auto-route the edge around shapes (obstacle-avoiding orthogonal routing, paired with edgeStyle=orthogonalEdgeStyle). Re-routed when a terminal or a shape on the route changes; a manual waypoint edit removes it
curved0, 10Curved edge path
curveGeometry0, 10With curved=1 or bezier=1: labels and line jumps follow the painted curve instead of the control points. Added to new curved edges
labelOnCurve0, 10With curved=1 or bezier=1, edge labels are placed along the painted curve instead of the line through the waypoints (x and y of the label geometry are measured along the curve). The editor sets and removes it together with curved and adds it to new curved edges.
trimCurve0, 10With curved=1 or bezier=1: the curve is painted as without markers and cut where the start and end markers begin, so markers don't change its course. Line jumps follow the cut curve. Trim Curve in the Property section
rounded0, 11Round edge corners (for orthogonal)
jettySizeauto, numberautoSpacing from port for orthogonal edges
sourceJettySizenumber—Source-side jetty override
targetJettySizenumber—Target-side jetty override
orthogonalLoop0, 11Self-loop routing style
elbowhorizontal, vertical—Elbow edge direction
jumpStylearc, gap, sharp, line—Line crossing visualization (curved edges need curveGeometry=1)
jumpSizenumber6Jump width at crossings
jumpLayers0, 110 only adds jumps for crossings with edges in the same layer as this edge
followTerminals0, 10Waypoints move with the terminals when these are moved, resized or arranged: orthogonal edges keep axis-parallel segments, other edges keep each waypoint's relative position along and distance from the line between the terminal centres. No effect with libavoidRouting=1
PropertyValuesDefaultDescription
libavoidSpacingnumber16With libavoidRouting=1: distance between the edge and the shapes it routes around (Spacing in the Line section of the Style tab)

4.5 Arrow Markers​

PropertyValuesDefaultDescription
startArrowarrow typenoneMarker at edge start
endArrowarrow typeclassicMarker at edge end
startSizenumber—Start marker size
endSizenumber—End marker size
startFill0, 11Fill start marker
endFill0, 11Fill end marker
startFillColor#RRGGBB—Fill colour of the start marker (default: line colour)
endFillColor#RRGGBB—Fill colour of the end marker (default: line colour)
startStrokeColor#RRGGBB—Outline colour of the start marker (default: line colour)
endStrokeColor#RRGGBB—Outline colour of the end marker (default: line colour)

Arrow type values:

ValueDescription
noneNo arrow
classicStandard filled triangle
classicThinThin triangle
blockFilled block
blockThinThin block
openOpen (unfilled) triangle
openThinThin open triangle
ovalCircle/oval
diamondDiamond
diamondThinThin diamond
boxSquare box
halfCircleHalf circle
circleCircle
circlePlusCircle with plus
crossCross mark
baseDashPerpendicular dash
doubleBlockDouble filled block
dashShort dash
asyncAsynchronous (half-arrow)
openAsyncOpen asynchronous arrow
manyOptionalER many-optional (crow's foot)

Fill behavior: startFill=0/endFill=0 renders the marker as an outline only. This is important for UML and ER diagram conventions (e.g., open diamond = aggregation, filled diamond = composition).

4.6 Connection Points​

PropertyValuesDefaultDescription
exitX0.0–1.0—Relative x of exit point (0=left, 0.5=center, 1=right)
exitY0.0–1.0—Relative y of exit point (0=top, 0.5=middle, 1=bottom)
exitDxnumber—Absolute x offset from exit point
exitDynumber—Absolute y offset from exit point
exitPerimeter0, 11Use perimeter for exit point
entryX0.0–1.0—Relative x of entry point
entryY0.0–1.0—Relative y of entry point
entryDxnumber—Absolute x offset from entry point
entryDynumber—Absolute y offset from entry point
entryPerimeter0, 11Use perimeter for entry point
portConstrainteastwest, northsouth, perimeter, fixed—Port constraint
sourcePerimeterSpacingnumber0Gap between the edge start and the source shape (Line start offset)
targetPerimeterSpacingnumber0Gap between the edge end and the target shape (Line end offset)
fixedPointSpacing0, 10Also apply sourcePerimeterSpacing / targetPerimeterSpacing to ends attached to a fixed connection point. Negative values extend the end outward. Set automatically when Line start/end offset is edited in the Format panel

4.7 Container / Swimlane Properties​

PropertyValuesDefaultDescription
container0, 10Cell is a container (children can be placed inside)
collapsible0, 11Container can be collapsed
recursiveResize0, 11Resize children when container resizes
swimlaneFillColor#RRGGBB—Swimlane header fill color
startSizenumber23Swimlane header height in pixels
horizontal0, 11Swimlane orientation (1=header on top, 0=header on left)
childLayoutstackLayout, tableLayout, rack, circleLayout, flowLayout, treeLayout, organicLayout, URL-encoded JSON—Layout that arranges the children (see below)

childLayout values: The layout runs when the container or its children change, not when the diagram is opened.

ValueLayout
stackLayoutStacks the children in a row or column and stretches them across the container, e.g. lists and UML class members
tableLayoutRows and cells of a shape=table table
rackRack cabinet: stacks the devices from top to bottom
circleLayoutPlaces the children on a circle
flowLayoutLayered flow, runs as the ELK layout elkLayered
treeLayoutTree, runs as the ELK layout elkTree; connectors retain their style
organicLayoutForce-directed, runs as the ELK layout elkOrganic
URL-encoded JSONA layout list as in the JSON layout specification, URL-encoded so that no ; or = breaks the style string, e.g. childLayout=%5B%7B%22layout%22%3A%22elkTree%22%7D%5D for [{"layout":"elkTree"}]

flowLayout, treeLayout and organicLayout run as ELK layouts, and their style keys below are translated to ELK options (See the JSON layout specification).

Layout style keys:

PropertyValuesDefaultDescription
resizeParent0, 11The container resizes to fit its children (stackLayout, circleLayout, flowLayout, treeLayout, organicLayout)
resizeParentMax0, 11stackLayout: the container only grows, it never shrinks
resizeLast0, 10stackLayout: the last child fills the remaining space
horizontalStack0, 11stackLayout: 1 places the children side by side, 0 stacks them top to bottom
stackSpacingnumber0stackLayout: gap between the children
stackBordernumber0stackLayout: gap between the container and its children
marginTop, marginRight, marginBottom, marginLeftnumber0stackLayout, rack: additional space inside the container
allowGaps1—stackLayout, rack: retain the gaps between the children, in steps of stackUnitSize or rackUnitSize. Omit for no gaps (any value, including 0, will enable gaps)
stackUnitSizenumber20stackLayout with allowGaps: step size of the gaps
rackUnitSizenumber20rack: height of one rack unit
horizontalRack0, 10rack: 1 places the devices side by side
flowOrientationnorth, west, east, southeastflowLayout: side of the roots — north top to bottom, west left to right, east right to left, south bottom to top
intraCellSpacingnumber30flowLayout: gap between shapes in the same rank
interRankCellSpacingnumber100flowLayout: gap between ranks
interHierarchySpacingnumber60flowLayout: gap between unconnected parts
parallelEdgeSpacingnumber10flowLayout: gap between parallel connectors
horizontalTree0, 11treeLayout: 1 left to right, 0 top to bottom
treeLevelDistancenumber30treeLayout: gap between levels and between siblings (minimum 20)
parentPaddingnumber20flowLayout, treeLayout, organicLayout: gap between the container border (below its title) and its children

4.8 Image Properties​

PropertyValuesDefaultDescription
imageURL string—Image URL (data: URIs also supported)
imageWidthnumber42Image width
imageHeightnumber42Image height
imageAlignleft, center, right—Image horizontal alignment
imageVerticalAligntop, middle, bottom—Image vertical alignment
imageAspect0, 11Preserve image aspect ratio

4.9 Sketch / Hand-Drawn Style​

PropertyValuesDefaultDescription
sketch0, 10Enable hand-drawn/sketch style (uses rough.js)
comic0, 10Comic book style
fillStylesolid, hachure, cross-hatch, dots—Fill pattern for sketch mode
fillWeightnumber—Hatch line weight (negative = thinner)
hachureGapnumber—Gap between hatch lines in pixels
hachureAnglenumber (degrees)—Angle of hatch lines
jigglenumber—Hand-drawn jiggle amount
curveFitting0–1—Curve fitting quality
simplification0–1—Path simplification
disableMultiStroke0, 1—Disable double-stroke effect
disableMultiStrokeFill0, 1—Disable double-stroke fill

4.10 Behavior Properties​

PropertyValuesDefaultDescription
movable0, 11Allow moving
resizable0, 11Allow resizing
rotatable0, 11Allow rotation
bendable0, 11Allow bending edges
collapsedPoints0, 110 ignores the edge's waypoints while one of its ends is hidden in a collapsed container (the stored waypoints are kept and used again when expanded; the edge can't be bent in that state)
editable0, 11Allow label editing
deletable0, 11Allow deletion
cloneable0, 11Allow cloning
foldable0, 1—Allow fold/collapse
connectable0, 11Allow connections
newEdgeStyleURL-encoded JSON style—Style of new connectors drawn from this shape. Set it with Use for New Connections from Source (formerly Set New Connection Default) on a connector from this shape, and remove it with Clear Style for New Connections (formerly Clear New Connection Default) on the shape
pointerEvents0, 11Enable mouse events
autosize0, 10Auto-size to fit content

4.11 Data Properties​

Values in the style of a cell can come from its data, and from the style rules of the page.

PropertyValuesDefaultDescription
stylePlaceholders0, 101 replaces placeholders such as %color% in the values of the keys in the table below with the data of the cell, its ancestors and the page, like placeholders in labels. Each value is checked for its key: keys whose value is not valid after the placeholders are replaced are removed, numbers are limited to the range of the key. Placeholders in other keys are not replaced. The CSV import keeps these placeholders in styles with stylePlaceholders=1, so the styles follow later changes of the data. Example: fillColor=%color%;stylePlaceholders=1;
styleRules0, 110: the style rules of the page don't change the cell, for example the shapes of a legend that Insert Legend adds

Keys that placeholders and style rules can set:

KeysValues
fillColor, gradientColor, strokeColor, fontColor, labelBackgroundColor, labelBorderColor, swimlaneFillColor#hex, rgb(), rgba(), hsl() or hsla() with numbers, a colour name, light-dark() of two colours, none or default
opacity, fillOpacity, strokeOpacity, textOpacity0 to 100
strokeWidth0 to 100
fontSize1 to 500
fontStyle0 to 15, rounded
rotation-360 to 360
dashed, rounded, shadow0, 1
imagehttps:// URL without quotes, spaces, ; or parentheses, up to 2048 characters. An image without placeholders, for example a data: URI that contains %, is kept as it is

5. Edge Styles (Routing Algorithms)​

edgeStyle= valueDescription
orthogonalEdgeStyleRoutes with right-angle turns (most common)
segmentEdgeStyleManual segments with horizontal/vertical segments
elbowEdgeStyleSingle elbow (one bend). Combine with elbow=horizontal or elbow=vertical
entityRelationEdgeStyleEntity-relationship style (perpendicular exits)
isometricEdgeStyleIsometric diagram routing
loopEdgeStyleSelf-referencing loop
sideToSideEdgeStyleSide-to-side connection
topToBottomEdgeStyleTop-to-bottom connection
(empty/none)Straight line, no routing

Common edge style combinations:

edgeStyle=orthogonalEdgeStyle;rounded=1;         # Rounded orthogonal (default-like)
edgeStyle=orthogonalEdgeStyle;curved=1; # Curved orthogonal
edgeStyle=elbowEdgeStyle;elbow=horizontal; # Horizontal elbow
edgeStyle=entityRelationEdgeStyle; # ER-style connections
edgeStyle=none; # Straight line

6. Perimeter Types​

The perimeter determines how connection points are calculated on a shape's border:

perimeter= valueUse with
rectanglePerimeterRectangles (default)
ellipsePerimeterEllipses, circles
rhombusPerimeterDiamond shapes
trianglePerimeterTriangles
hexagonPerimeter2Hexagons
parallelogramPerimeterParallelograms
trapezoidPerimeterTrapezoids
calloutPerimeterCallout/speech bubbles
backbonePerimeterBackbone/bus shapes
centerPerimeterSingle center point
stepPerimeterStep/chevron shapes
cloudPerimeterClouds: connectors end on the outline of the cloud as drawn (without it, ellipse;shape=cloud uses the ellipse)

Important: When using non-rectangular shapes, always set the matching perimeter. Otherwise edges will connect to the rectangular bounding box instead of the visible shape border.


7. Predefined Style Classes​

These class names can be used as bare tokens in the style string. They set multiple style properties at once:

ClassSets
textNo fill, no stroke, left-aligned, top-aligned
edgeLabelExtends text, adds label background, font size 11
labelBold, left-aligned, with image area (42x42), rounded
iconExtends label, centered image above text
swimlaneSwimlane shape, bold, header size 23
groupNo fill, no stroke, transparent container
ellipseEllipse shape with ellipsePerimeter
rhombusDiamond shape with rhombusPerimeter
triangleTriangle shape with trianglePerimeter
lineLine shape, strokeWidth=4
imageImage shape with label below
arrowArrow shape, no edge routing

Color Theme Classes​

Each sets fillColor, gradientColor, strokeColor, plus shadow=1 and glass=1:

ClassfillColorgradientColorstrokeColor
blue#DAE8FC#7EA6E0#6C8EBF
green#D5E8D4#97D077#82B366
yellow#FFF2CC#FFD966#D6B656
orange#FFCD28#FFA500#D79B00
red#F8CECC#EA6B66#B85450
pink#E6D0DE#B5739D#996185
purple#E1D5E7#8C6C9C#9673A6
gray#F5F5F5#B3B3B3#666666
turquoise#D5E8D4#67AB9F#6A9153

plain-* variants (e.g. plain-blue) set the same colors without shadow and glass.


8. Common Color Palettes​

Standard draw.io Colors​

These are commonly used in the draw.io UI:

Fill colors (light):

  • #DAE8FC (light blue)
  • #D5E8D4 (light green)
  • #FFF2CC (light yellow)
  • #F8CECC (light red)
  • #E1D5E7 (light purple)
  • #E6D0DE (light pink)
  • #F5F5F5 (light gray)
  • #FFCD28 (orange)
  • #FFE6CC (light orange)

Stroke colors (matching):

  • #6C8EBF (blue)
  • #82B366 (green)
  • #D6B656 (yellow/gold)
  • #B85450 (red)
  • #9673A6 (purple)
  • #996185 (pink)
  • #666666 (gray)
  • #D79B00 (orange)

Font/accent colors:

  • #000000 (black)
  • #FFFFFF (white)
  • #333333 (dark gray)
  • #0000EE (link blue)

Special Color Values​

  • none — transparent / no color (removes fill or stroke)
  • default — uses the current theme's default (resolves at render time)

The following keywords refer to another colour. They can be used as the value of fillColor, strokeColor, gradientColor and fontColor:

  • inherit — the same colour of the parent cell, e.g. fillColor=inherit uses the fill colour of the container
  • fillColor, strokeColor — the fill or stroke colour of the cell itself, e.g. fillColor=strokeColor fills the shape with its stroke colour
  • parentFillColor, parentStrokeColor — the fill or stroke colour of the parent cell, e.g. strokeColor=parentFillColor draws the border in the fill colour of the container

Cells on a layer have no parent shape, so inherit, parentFillColor and parentStrokeColor use the default colour there.


9. HTML Labels​

When html=1 is set in the style, the cell's value attribute can contain HTML:

Supported HTML Elements​

  • <b>, <i>, <u>, <s> — text formatting
  • <br> / <br/> — line break
  • <p>, <div>, <span> — block/inline containers
  • <font> — font attributes (face, size, color)
  • <table>, <tr>, <td>, <th> — tables
  • <ul>, <ol>, <li> — lists
  • <hr> — horizontal rule
  • <img> — inline images (with src attribute)
  • <a> — links (href attribute)
  • <sub>, <sup> — subscript/superscript

HTML in Attributes​

HTML in the value attribute must be XML-escaped:

  • < → &lt;
  • > → &gt;
  • & → &amp;
  • " → &quot;

Example:

<mxCell value="&lt;b&gt;Title&lt;/b&gt;&lt;br&gt;Description"
style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">

Common HTML Patterns​

Bold title with description:

&lt;b&gt;Title&lt;/b&gt;&lt;br&gt;Description text

UML class box (within table container):

&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;b&gt;ClassName&lt;/b&gt;&lt;/p&gt;
&lt;hr size=&quot;1&quot;/&gt;
&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ field: Type&lt;/p&gt;
&lt;hr size=&quot;1&quot;/&gt;
&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ method(): ReturnType&lt;/p&gt;

Colored text:

&lt;font color=&quot;#FF0000&quot;&gt;Red text&lt;/font&gt;

10. Layers​

Layers are additional mxCell elements with parent="0":

<root>
<mxCell id="0" />
<mxCell id="1" parent="0" /> <!-- Default layer -->
<mxCell id="layer2" value="Background" parent="0" /> <!-- Additional layer -->

<!-- Elements on default layer -->
<mxCell id="2" ... parent="1" />

<!-- Elements on "Background" layer -->
<mxCell id="3" ... parent="layer2" />
</root>

To hide a layer: add visible="0" to the layer cell.


11. Groups and Containers​

A group/container is a vertex that other cells reference as their parent:

<!-- Group container -->
<mxCell id="group1" value="Group" style="group;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="300" height="200" as="geometry" />
</mxCell>

<!-- Children reference the group as parent -->
<mxCell id="child1" value="Inside" style="rounded=1;html=1;" vertex="1" parent="group1">
<mxGeometry x="10" y="10" width="100" height="40" as="geometry" />
</mxCell>

Key points:

  • Child coordinates are relative to the parent container
  • Use style="group;" for invisible containers
  • Use style="swimlane;startSize=30;" for containers with a visible header
  • Add container=1; to any style to make it act as a container
  • collapsible=0; prevents the collapse/expand button

Collapsible Containers and Alternate Bounds​

When a container (e.g. swimlane) is collapsible, draw.io stores alternate bounds in an mxRectangle child element inside mxGeometry. When the container is collapsed/expanded, the geometry swaps between the normal and alternate bounds:

<mxCell id="class1" value="ClassName" style="swimlane;fontStyle=1;childLayout=stackLayout;startSize=26;collapsible=1;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="200" height="150" as="geometry">
<mxRectangle x="100" y="100" width="200" height="26" as="alternateBounds" />
</mxGeometry>
</mxCell>

The alternateBounds typically has the same x/y but a smaller height (just the header). AI generators generally do not need to produce mxRectangle elements — draw.io adds them automatically when the user collapses a container.


These features are stored as attributes, not in the style. The .drawio file format reference describes them in §2.2 and §2.8–§2.11.

Multiple Pages​

Each page is one <diagram> element inside <mxfile>, with its own <mxGraphModel>:

<mxfile pages="2">
<diagram id="overview" name="Overview">
<mxGraphModel>...</mxGraphModel>
</diagram>
<diagram id="details" name="Details">
<mxGraphModel>...</mxGraphModel>
</diagram>
</mxfile>

Key points:

  • Every page needs its own structural cells id="0" and id="1"
  • Page id values must be unique in the file. Cell IDs only need to be unique within a page
  • The page tabs follow the order of the <diagram> elements
  • Links and background pages refer to the page id, not to its name

A link is the link attribute of a UserObject (or object) wrapper:

<UserObject id="2" label="Details" link="data:page/id,details">
<mxCell style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="40" y="40" width="120" height="60" as="geometry" />
</mxCell>
</UserObject>
link valueEffect
https://…Opens the URL. Add linkTarget="_blank" to open it in a new window
data:page/id,PAGE_IDOpens the page with this id in the same file
data:action/json,{"actions":[…]}Runs custom actions, such as {"toggle":{"cells":["3"]}}. See the JSON actions reference. Escape " as &quot; in the attribute

Tags​

tags on the wrapper holds the tags of a cell, separated by spaces, for example tags="backend critical". Tags are case-sensitive and can't contain spaces. In the Tags dialog, readers can hide tags: a cell is hidden when all of its tags are hidden. Which tags are hidden is not stored in the file.

Page Data and Page Animations​

Attributes of the whole page go on a UserObject that wraps the root cell id="0". The mxCell inside has no id and no parent:

<UserObject id="0" label="" owner="ITS" animation="{&quot;animation&quot;:{&quot;steps&quot;:[{&quot;fadeOut&quot;:{&quot;cells&quot;:[&quot;*&quot;]}},{&quot;fadeIn&quot;:{&quot;cells&quot;:[&quot;2&quot;]}}]}}">
<mxCell />
</UserObject>
<mxCell id="1" parent="0" />
  • Custom attributes such as owner are page data. The placeholder %owner% in a label with placeholders="1" shows the value
  • animation is the page animation. It plays in the lightbox viewer and in presentation mode. steps takes the same actions as data:action/json, links
  • styleRules and dataSources hold the style rules and data sources of the page as JSON arrays. AI generators typically do not need to write them

13. Edge Geometry and Labels​

Basic Connected Edge​

<mxCell id="e1" value="" style="endArrow=classic;html=1;"
edge="1" parent="1" source="v1" target="v2">
<mxGeometry relative="1" as="geometry" />
</mxCell>

Edge with Waypoints​

<mxCell id="e2" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;"
edge="1" parent="1" source="v1" target="v2">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="300" y="150" />
<mxPoint x="300" y="250" />
</Array>
</mxGeometry>
</mxCell>

Edge with Label​

Edge labels are usually encoded in the edge cell's value. The label position is controlled by the geometry:

<mxCell id="e3" value="label text" style="endArrow=classic;html=1;"
edge="1" parent="1" source="v1" target="v2">
<mxGeometry x="-0.5" y="0" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
  • x on geometry: position along edge (-1 to 1, where 0 = center, -1 = near source, 1 = near target)
  • y on geometry: perpendicular offset in pixels
  • With labelOnCurve=1 on a curved edge, x and y are measured along and perpendicular to the painted curve instead of the line through the waypoints

Edge with Label Cells​

More labels are vertex children of the edge with a relative geometry, connectable="0" and the edgeLabel style. With inheritText=1 they take the text styles of the edge (see 4.3 Text and Labels):

<mxCell id="l1" value="1" style="edgeLabel;html=1;align=left;verticalAlign=bottom;resizable=0;inheritText=1;"
vertex="1" connectable="0" parent="e3">
<mxGeometry x="-1" relative="1" as="geometry" />
</mxCell>
  • x on geometry: position along the edge (-1 to 1), y: perpendicular offset, offset: an extra offset in pixels

Unconnected Edge (Floating)​

<mxCell id="e4" value="" style="endArrow=classic;html=1;"
edge="1" parent="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="100" y="200" as="sourcePoint" />
<mxPoint x="300" y="100" as="targetPoint" />
</mxGeometry>
</mxCell>

14. Complete Examples​

Example 1: Simple Flowchart​

<mxfile>
<diagram id="flowchart" name="Flowchart">
<mxGraphModel dx="0" dy="0" grid="1" gridSize="10" guides="1"
tooltips="1" connect="1" arrows="1" fold="1"
page="1" pageScale="1" pageWidth="850" pageHeight="1100">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />

<!-- Start -->
<mxCell id="start" value="Start" style="ellipse;whiteSpace=wrap;html=1;fillColor=#D5E8D4;strokeColor=#82B366;" vertex="1" parent="1">
<mxGeometry x="340" y="40" width="120" height="60" as="geometry" />
</mxCell>

<!-- Decision -->
<mxCell id="decision" value="Condition?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#FFF2CC;strokeColor=#D6B656;" vertex="1" parent="1">
<mxGeometry x="320" y="150" width="160" height="80" as="geometry" />
</mxCell>

<!-- Process A -->
<mxCell id="procA" value="Process A" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DAE8FC;strokeColor=#6C8EBF;" vertex="1" parent="1">
<mxGeometry x="160" y="290" width="120" height="60" as="geometry" />
</mxCell>

<!-- Process B -->
<mxCell id="procB" value="Process B" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DAE8FC;strokeColor=#6C8EBF;" vertex="1" parent="1">
<mxGeometry x="520" y="290" width="120" height="60" as="geometry" />
</mxCell>

<!-- End -->
<mxCell id="end" value="End" style="ellipse;whiteSpace=wrap;html=1;fillColor=#F8CECC;strokeColor=#B85450;" vertex="1" parent="1">
<mxGeometry x="340" y="420" width="120" height="60" as="geometry" />
</mxCell>

<!-- Edges -->
<mxCell id="e1" style="endArrow=classic;html=1;" edge="1" parent="1" source="start" target="decision">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e2" value="Yes" style="endArrow=classic;html=1;" edge="1" parent="1" source="decision" target="procA">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e3" value="No" style="endArrow=classic;html=1;" edge="1" parent="1" source="decision" target="procB">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e4" style="endArrow=classic;html=1;" edge="1" parent="1" source="procA" target="end">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e5" style="endArrow=classic;html=1;" edge="1" parent="1" source="procB" target="end">
<mxGeometry relative="1" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

Example 2: UML Class Diagram​

<mxfile>
<diagram id="uml" name="Classes">
<mxGraphModel dx="0" dy="0" grid="1" gridSize="10" guides="1"
tooltips="1" connect="1" arrows="1" fold="1"
page="1" pageScale="1" pageWidth="850" pageHeight="1100">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />

<!-- Class: Animal -->
<mxCell id="animal" value="&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;i&gt;&amp;lt;&amp;lt;abstract&amp;gt;&amp;gt;&lt;/i&gt;&lt;br&gt;&lt;b&gt;Animal&lt;/b&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot;/&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ name: String&lt;br&gt;+ age: int&lt;/p&gt;&lt;hr size=&quot;1&quot;/&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ speak(): void&lt;br&gt;+ move(): void&lt;/p&gt;" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;whiteSpace=wrap;" vertex="1" parent="1">
<mxGeometry x="300" y="40" width="200" height="140" as="geometry" />
</mxCell>

<!-- Class: Dog -->
<mxCell id="dog" value="&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;b&gt;Dog&lt;/b&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot;/&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ breed: String&lt;/p&gt;&lt;hr size=&quot;1&quot;/&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ fetch(): void&lt;/p&gt;" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;whiteSpace=wrap;" vertex="1" parent="1">
<mxGeometry x="180" y="260" width="160" height="120" as="geometry" />
</mxCell>

<!-- Class: Cat -->
<mxCell id="cat" value="&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;b&gt;Cat&lt;/b&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot;/&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ indoor: boolean&lt;/p&gt;&lt;hr size=&quot;1&quot;/&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ purr(): void&lt;/p&gt;" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;whiteSpace=wrap;" vertex="1" parent="1">
<mxGeometry x="460" y="260" width="160" height="120" as="geometry" />
</mxCell>

<!-- Inheritance: Dog extends Animal -->
<mxCell id="e1" style="endArrow=block;endFill=0;html=1;" edge="1" parent="1" source="dog" target="animal">
<mxGeometry relative="1" as="geometry" />
</mxCell>

<!-- Inheritance: Cat extends Animal -->
<mxCell id="e2" style="endArrow=block;endFill=0;html=1;" edge="1" parent="1" source="cat" target="animal">
<mxGeometry relative="1" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

Example 3: Network Diagram with Groups​

<mxfile>
<diagram id="network" name="Network">
<mxGraphModel dx="0" dy="0" grid="1" gridSize="10" guides="1"
tooltips="1" connect="1" arrows="1" fold="1"
page="1" pageScale="1" pageWidth="850" pageHeight="1100">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />

<!-- DMZ Group -->
<mxCell id="dmz" value="DMZ" style="swimlane;startSize=25;fillColor=#F5F5F5;strokeColor=#666666;fontStyle=1;html=1;" vertex="1" parent="1">
<mxGeometry x="50" y="50" width="300" height="200" as="geometry" />
</mxCell>

<!-- Firewall inside DMZ -->
<mxCell id="fw" value="Firewall" style="shape=mxgraph.cisco.firewalls.firewall;sketch=0;html=1;whiteSpace=wrap;" vertex="1" parent="dmz">
<mxGeometry x="100" y="60" width="80" height="60" as="geometry" />
</mxCell>

<!-- Internal Group -->
<mxCell id="internal" value="Internal Network" style="swimlane;startSize=25;fillColor=#DAE8FC;strokeColor=#6C8EBF;fontStyle=1;html=1;" vertex="1" parent="1">
<mxGeometry x="450" y="50" width="300" height="200" as="geometry" />
</mxCell>

<!-- Server -->
<mxCell id="srv" value="App Server" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#D5E8D4;strokeColor=#82B366;" vertex="1" parent="internal">
<mxGeometry x="90" y="60" width="120" height="60" as="geometry" />
</mxCell>

<!-- Connection -->
<mxCell id="conn" style="endArrow=classic;startArrow=classic;html=1;strokeWidth=2;" edge="1" parent="1" source="fw" target="srv">
<mxGeometry relative="1" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

Example 4: Custom Metadata with UserObject​

<mxfile>
<diagram id="metadata" name="Servers">
<mxGraphModel dx="0" dy="0" grid="1" gridSize="10" guides="1"
tooltips="1" connect="1" arrows="1" fold="1"
page="1" pageScale="1" pageWidth="850" pageHeight="1100">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />

<!-- Server with custom attributes -->
<UserObject id="srv1" label="Web Server" tooltip="Production web server"
ip="10.0.1.10" environment="production" owner="ops-team">
<mxCell style="rounded=1;whiteSpace=wrap;html=1;fillColor=#D5E8D4;strokeColor=#82B366;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="140" height="70" as="geometry" />
</mxCell>
</UserObject>

<!-- Database with custom attributes -->
<object id="db1" label="PostgreSQL" ip="10.0.2.20"
environment="production" port="5432">
<mxCell style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#DAE8FC;strokeColor=#6C8EBF;" vertex="1" parent="1">
<mxGeometry x="350" y="90" width="100" height="90" as="geometry" />
</mxCell>
</object>

<mxCell id="conn1" style="endArrow=classic;html=1;" edge="1" parent="1" source="srv1" target="db1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

15. Additional mxGraphModel Attributes​

These optional attributes on <mxGraphModel> are less commonly used but appear in real-world files:

AttributeValuesDescription
adaptiveColorsauto, simple, none, defaultControls color adaptation for light/dark mode viewing
backgroundImageJSONBackground image of the page: {"src":"https://…","width":800,"height":600}. A background page is a page link: {"src":"data:page/id,PAGE_ID"}
measureScalenumberDrawing scale for measurements in labels: 50 if one unit in the diagram is 50 units in reality. Default 1. Not in mxfile.xsd 1.0, so a file with it fails validation

adaptiveColors example:

<mxGraphModel dx="0" dy="0" grid="1" ... adaptiveColors="auto">

AI generators typically do not need to set this attribute.


16. Validation Checklist for AI-Generated Files​

Use this checklist to verify generated draw.io files:

  1. Valid XML: File is well-formed XML with proper escaping
  2. Root element: <mxfile> as root, contains at least one <diagram>
  3. Diagram IDs: Each diagram has a unique id attribute
  4. Structural cells: Root contains <mxCell id="0"/> and <mxCell id="1" parent="0"/>
  5. Unique IDs: All cell IDs are unique within the diagram
  6. Parent references: Every cell (except id="0") has a valid parent referencing an existing cell
  7. Type flags: Each content cell has either vertex="1" or edge="1" (not both)
  8. Edge references: Edge source and target reference existing vertex IDs
  9. Geometry: Vertices have mxGeometry with x, y, width, height; edges have relative="1"
  10. Style format: Style strings use key=value; format, valid keys and values
  11. Perimeter match: Non-rectangular shapes have matching perimeter in style
  12. HTML escaping: HTML in value attributes is properly XML-escaped
  13. Coordinate system: x increases right, y increases down, no negative dimensions
  14. Group hierarchy: Children of groups have coordinates relative to the group
  15. Page links: Every data:page/id, link names the id of a <diagram> in the file
  16. Link JSON: The JSON in data:action/json, links and in animation is valid, with " escaped as &quot;