XML FORMAT

DGML

DGML (Directed Graph Markup Language)

DGML (Directed Graph Markup Language) is an XML-based file format for directed graphs, developed by Microsoft and first shipped in September 2009 with Visual Studio 2010. It uses the namespace http://schemas.microsoft.com/vs/2009/dgml/, carries the .dgml file extension, and is best known as the on-disk persistence format for Visual Studio "code maps" — dependency graphs that visualize how classes, assemblies, namespaces, and other source components relate to one another. It supports both cyclic and acyclic graphs.

Structurally, a DGML document has a single root DirectedGraph element containing optional child collections. Nodes holds Node elements (each with an Id and usually a Label); Links holds Link elements that connect a Source node to a Target node, giving the graph its directed edges. Beyond this core, DGML is notably rich in annotation and presentation metadata. A Categories section defines named Category elements used to group nodes and links; a Properties section declares typed custom properties (String, Brush, DateTime, Boolean, and others) that can be attached to any element; and a Styles section defines conditional visual rules — for example, coloring a node green when a "Passed" property equals True. Nodes can also be nested to represent containment/grouping, and the graph can carry layout hints (Sugiyama tree, ForceDirected, DependencyMatrix, or none) plus flow direction.

In the format-conversion landscape, DGML occupies a similar niche to other XML graph interchange formats such as GraphML, GEXF, XGMML, and GXL, and to the DOT language of DOT, but it is tightly coupled to the Microsoft/Visual Studio toolchain rather than being a vendor-neutral standard. Its strengths are a clean, IntelliSense-friendly XML schema, first-class support for user-defined typed properties, categories, and conditional styling, and strong tooling inside Visual Studio for generating and browsing large code maps. Libraries such as DgmlPowerTools, dgml2, and the DgmlBuilder .NET library help produce and manipulate DGML programmatically.

Its main limitations are ecosystem lock-in: authoring and interactive viewing traditionally required Visual Studio (specific code-map features were Enterprise-edition only), third-party viewers exist but are less complete, and adoption outside the .NET world is limited. The format also has no widely used streaming or binary variant, so very large graphs are constrained by verbose XML.

Alternative Names: Directed Graph Markup Language

File Extensions: .dgml v2009 schema
FeatureDGML (Directed Graph Markup Language)
Multiple Graphs per Document not supported
Nodes supported
Directed Edges supported
Hyperedges not supported
Parallel Edges supported
Self-loops supported
Edges on Edges not supported
Nested Graphs in Nodes supported
Nested Graphs in Edges not supported
Node Labels supported
Edge Labels supported
Attributes on Nodes supported
Attributes on Edges supported
Attributes on Graphs partial
Typed Edges supported

Tools(Read & Write)

Read-only Tools

Write-only Tools

Frequently Asked Questions

What is a DGML (Directed Graph Markup Language) file?

A DGML (Directed Graph Markup Language) file stores a graph — its nodes, edges and attributes — in the DGML (Directed Graph Markup Language) format (also: Directed Graph Markup Language). See the feature table above for what it supports.

How do I open a DGML (Directed Graph Markup Language) file?

Open it in a graph tool that supports DGML (Directed Graph Markup Language), or convert it to a format your tool reads. With GraphInOut you can convert DGML (Directed Graph Markup Language) to GraphML, DOT, Connected JSON and more, right in your browser.

How do I convert a DGML (Directed Graph Markup Language) file to another format?

Use the Convert from DGML (Directed Graph Markup Language) link above: upload or paste your DGML (Directed Graph Markup Language) file (input preset to DGML (Directed Graph Markup Language)), choose a target format and download the result — free, no install.