Diagram XML format
Overview
This XML format describes a diagram page (pages/page{i}.xml), including:
- page-level properties and background color,
- layers and visibility states,
- user-defined views and visible elements filtering,
- automatic incrementation groups for markers,
- magnetic guide lines,
- stencil instances with styling, positioning, fill modes, and badges,
- connector points and connections between stencils,
- databinding annotations and metadata.
File Structure
The root element is:
Diagram
The main sections are:
Properties— page metadata, active layer, and background colorLayers— layer definitions and visibility stateViews— named viewpoints and shape visibility presetsIncrementationGroups— marker counter definitions and symbol stylesGuides— magnetic guide lines on the canvasStencils— diagram objects and shapes placed on the canvasConnections— links and routes between stencils
Root Element: Diagram
The Diagram element is the container for a single diagram page.
Properties section
The Properties section stores page-level configuration.
Common properties
| Property | Type | Description |
|---|---|---|
Name |
string | human-readable diagram / page name |
Index |
int | zero-based page index in the document |
Color |
Color |
background color of the canvas (hex or theme index, e.g. @0) |
ActiveLayerId |
string | identifier of the current active layer to draw on |
Layers section
The Layers section defines the available layers on the page.
Each Layer has its own Properties container.
Layer properties
| Property | Type | Description |
|---|---|---|
Name |
string | display name of the layer |
Id |
string | unique identifier used by shapes and connectors |
IsVisible |
bool | whether the layer is visible |
IsLocked |
bool | whether the layer is editable |
ZIndex |
int | layer ordering priority |
Example
<Layer>
<Properties>
<Prop name="Name" value="Layer 1"/>
<Prop name="Id" value="default"/>
<Prop name="IsVisible" value="True"/>
<Prop name="IsLocked" value="False"/>
<Prop name="ZIndex" value="1"/>
</Properties>
</Layer>
Views section
The Views section defines named views configured for the page. Each view associates a name with a list of visible stencil IDs.
Structure
Each View element contains:
Properties:NameandIdItems: zero or more<Item>elements specifying stencil IDs included in the view
Example
<Views>
<View>
<Properties>
<Prop name="Name" value="Network Layer"/>
<Prop name="Id" value="view-net"/>
</Properties>
<Items>
<Item>shp.f3df0533</Item>
<Item>shp.c12a48b9</Item>
</Items>
</View>
</Views>
IncrementationGroups section
The IncrementationGroups section defines automatic sequence numbering/lettering groups used by marker stencils on this page.
IncrementationGroup properties
| Property | Type | Description |
|---|---|---|
Id |
string | unique identifier of the incrementation group |
Name |
string | display name of the group |
CurrentValue |
string | current counter value (e.g. "0", "3", "C") |
IncrementationType |
int | sequence type: 0 (Number: 1, 2, 3...) or 2 (Letter: A, B, C...) |
Style |
IncrementationSymbol |
marker geometric shape: Circle=0, Square=1, Triangle=2, etc. |
Example
<IncrementationGroups>
<IncrementationGroup>
<Properties>
<Prop name="Id" value="grp-markers-1"/>
<Prop name="Name" value="Sequence A"/>
<Prop name="CurrentValue" value="4"/>
<Prop name="IncrementationType" value="0"/>
<Prop name="Style" value="0"/>
</Properties>
</IncrementationGroup>
</IncrementationGroups>
Guides section
The Guides section contains magnetic guide lines drawn on the canvas to assist stencil positioning and alignment.
<HorizontalGuide>: Y-coordinate position (double, invariant culture)<VerticalGuide>: X-coordinate position (double, invariant culture)
Example
<Guides>
<HorizontalGuide>150</HorizontalGuide>
<VerticalGuide>320.5</VerticalGuide>
</Guides>
Stencils section
The Stencils section contains all diagram objects, icons, shapes, and containers placed on the canvas.
Stencil Attributes
| Attribute | Type | Description |
|---|---|---|
type |
string | stencil family category: "basic", "svg", "geometry", "container" (or legacy names) |
stype |
ushort | numeric subtype for basic shapes (e.g. 1=Circle, 4=Rectangle, 5=RoundedRectangle, 200=Marker) |
id |
string | unique identifier for the stencil instance (e.g. shp.f3df0533) |
Stencil Properties
The Properties container defines the stencil's visual, positional, and functional attributes:
| Property | Type | Description |
|---|---|---|
Name |
string | human-readable stencil name |
LayerId |
string | target layer identifier |
ZIndex |
int | drawing order priority within the layer |
Rotation |
int | rotation angle in degrees |
Opacity |
byte | shape opacity percentage (0 to 100) |
FlipHorizontal |
bool | horizontal mirroring flag |
FlipVertical |
bool | vertical mirroring flag |
IgnoreSnap |
bool | whether the stencil ignores grid / guide snapping |
HideConnectors |
bool | whether connection attachment points are hidden |
X |
double | horizontal canvas position (X) |
Y |
double | vertical canvas position (Y) |
Width |
double | stencil width |
Height |
double | stencil height |
FontSize |
double | text font size |
FontFamily |
string | font family name |
FontFilePath |
string | custom font file path if bundled |
ContentPadding |
Thickness |
internal padding for content and text |
ContentHorizontalAlignment |
int | horizontal alignment (Left=0, Center=1, Right=2, Stretch=3) |
ContentVerticalAlignment |
int | vertical alignment (Top=0, Center=1, Bottom=2, Stretch=3) |
ForegroundColor |
Color |
text or icon foreground color |
BackgroundColor |
Color |
primary fill / background color |
SecondaryColor |
Color |
secondary fill color (used with gradients or patterns) |
FillType |
StencilFillType |
interior fill style (solid, linear/radial gradients, patterns) |
BorderColor |
Color |
border stroke color |
BorderThickness |
int | border stroke width |
LineStyle |
LineStyle |
border stroke style (solid, dashed, dotted...) |
GroupId |
string | parent group identifier if grouped with other stencils |
ParentId |
string | parent container stencil identifier if nested in a container |
Index |
byte | ordering index within a stack container |
Spacing |
byte | item spacing setting for container stencils |
IsLocked |
bool | whether the stencil is locked against edits and moves |
Badges |
BadgeType |
bitwise flags mask for status badge icons |
BadgesPosition |
BadgesPosition |
corner position of badges (TopLeft=0, TopRight=1, etc.) |
Parameters |
string | comma-separated floats for parametric geometric adjustments |
MediaKey |
string | SVG media key in medias/ (for SVG stencils) |
IncrementationGroupId |
string | identifier of linked IncrementationGroup (for markers) |
ObjectType |
string | GUID of linked Article Type (for databinding) |
Stencil Content (Content)
The Content element stores the textual label payload, wrapped in CDATA:
<Content><![CDATA[Web Server 01]]></Content>
Stencil Description (Description)
The Description element stores notes, documentation, or descriptive text, wrapped in CDATA:
<Description><![CDATA[Primary frontend reverse proxy node.]]></Description>
Stencil Datas (Datas)
The Datas section contains arbitrary custom key-value metadata attached to the stencil:
<Datas>
<Data name="IP" value="192.168.1.10" />
<Data name="Environment" value="Production" />
</Datas>
Stencil Connectors (Connectors)
The Connectors section defines connection attachment points on the stencil.
Connector attributes
id— unique connector identifierx— horizontal position normalized to bounds (0= left,0.5= center,1= right)y— vertical position normalized to bounds (0= top,0.5= center,1= bottom)
Databinding Extensions
When Databinding is configured, stencils may include additional child nodes:
<Annotations>: field annotations displayed on the shape (<Annotation property="..." display="..." showValueOnly="..." />)<CatalogId>and<CatalogArticleId>: links to external catalog records<BadgeConditions>: conditional badge display rules based on property thresholds
Stencil Example
<Stencil type="basic" stype="5" id="shp.f3df0533">
<Properties>
<Prop name="Name" value="App Server"/>
<Prop name="LayerId" value="default"/>
<Prop name="ZIndex" value="0"/>
<Prop name="Rotation" value="0"/>
<Prop name="Opacity" value="100"/>
<Prop name="FlipHorizontal" value="False"/>
<Prop name="FlipVertical" value="False"/>
<Prop name="X" value="250"/>
<Prop name="Y" value="120"/>
<Prop name="Width" value="180"/>
<Prop name="Height" value="90"/>
<Prop name="FontSize" value="12"/>
<Prop name="ContentPadding" value="8,8,8,8"/>
<Prop name="ContentHorizontalAlignment" value="1"/>
<Prop name="ContentVerticalAlignment" value="1"/>
<Prop name="ForegroundColor" value="#000000"/>
<Prop name="BackgroundColor" value="@1"/>
<Prop name="SecondaryColor" value="@2"/>
<Prop name="FillType" value="1"/>
<Prop name="BorderColor" value="@4"/>
<Prop name="BorderThickness" value="2"/>
<Prop name="LineStyle" value="0"/>
<Prop name="IsLocked" value="False"/>
<Prop name="Badges" value="16"/>
<Prop name="BadgesPosition" value="1"/>
</Properties>
<Content><![CDATA[App Server]]></Content>
<Description><![CDATA[Main application service instance]]></Description>
<Datas>
<Data name="Port" value="8080"/>
</Datas>
<Connectors>
<Connector id="con.1" x="0" y="0.5"/>
<Connector id="con.2" x="1" y="0.5"/>
<Connector id="con.3" x="0.5" y="0"/>
<Connector id="con.4" x="0.5" y="1"/>
</Connectors>
</Stencil>
Connections section
The Connections section contains links, arrows, or relationships between stencil instances.
Connection Attributes
Id— unique identifier of the connection
Connection properties
| Property | Type | Description |
|---|---|---|
Name |
string | display name of the connection |
LayerId |
string | layer used to render the connection |
ZIndex |
int | drawing order priority |
Style |
ConnectionStyle |
connection routing style (straight, curved, orthogonal) |
LineColor |
Color |
stroke color (hex #RRGGBB or theme index @index) |
LineStyle |
LineStyle |
line stroke pattern (solid, dashed, dotted...) |
LineThickness |
int | stroke width in pixels |
StartHeadType |
ArrowHeadType |
decoration head at the start of the connection |
EndHeadType |
ArrowHeadType |
decoration head at the end of the connection |
SourceShapeId |
string | identifier of the source stencil |
TargetShapeId |
string | identifier of the target stencil |
SourceConnectionPointId |
string | connector point ID used on the source stencil |
TargetConnectionPointId |
string | connector point ID used on the target stencil |
GravityOffset1X |
double | horizontal gravitational offset for control point 1 |
GravityOffset1Y |
double | vertical gravitational offset for control point 1 |
GravityOffset2X |
double | horizontal gravitational offset for control point 2 |
GravityOffset2Y |
double | vertical gravitational offset for control point 2 |
Intermediate Waypoints (Points)
The Points section defines intermediate routing vertices for the connection line:
<Point type="..." x="..." y="..." />type: waypoint behavior (0= Fixed,1= Free,2= Bridge)x: canvas X position (double)y: canvas Y position (double)
Connection Metadata (Datas)
The Datas section contains custom key-value pairs attached to the connection.
Connection Example
<Connection Id="con.91ab42c8">
<Properties>
<Prop name="Name" value="HTTPS link"/>
<Prop name="LayerId" value="default"/>
<Prop name="ZIndex" value="1"/>
<Prop name="Style" value="4"/>
<Prop name="LineColor" value="@0"/>
<Prop name="LineStyle" value="0"/>
<Prop name="LineThickness" value="2"/>
<Prop name="StartHeadType" value="0"/>
<Prop name="EndHeadType" value="2"/>
<Prop name="SourceShapeId" value="shp.f3df0533"/>
<Prop name="TargetShapeId" value="shp.a182e041"/>
<Prop name="SourceConnectionPointId" value="con.2"/>
<Prop name="TargetConnectionPointId" value="con.1"/>
</Properties>
<Points>
<Point type="0" x="430" y="165"/>
<Point type="0" x="520" y="240"/>
</Points>
</Connection>