Directed Graph Documents

Video: (mp4 14.5mb)

Cameron Skinner first introduced DGML about 9 months ago and now that VS 2010 Beta 2 has shipped it’s time for an update.

The video takes you through some great demos to give you an idea of what it can do.  This is just a 10 minute teaser, in subsequent posts I’ll drill into all the various software visualization features in more detail.

I think you’ll agree that this is pretty exciting stuff and I can’t wait to see all the amazing things that people will do with this new capability.

The following download contains the DGML demos used in this video: (542.37 kb)

Someone asked me recently how I built all those demos:

Demos.dgml – built by hand, manually adding the “Reference” attribute that point to each sample.

.NET 4.0

Assemblies.dgml: I just drag/dropped the .NET assemblies onto a new empty graph document. The green colorization was a custom category added by hand.

Grouped.dgml: was taking the above and manually grouping things then styling the group & link colors by hand.


Baseball.dgml – by hand by copying this graph from Slate magazine

Coverage.dgml – the dependency graph is just a class to class dependency graph which I think I just used the architecture menu generate with a “Custom” settings, namely show only Types and no methods (this way the classes are leaf nodes but their links are a rollup of their inner dependencies), then I wrote a tool that mapped the Coverage report (which is in an XML format) to add coverage properties to my nodes. The hard part here is the “name mapping” because metrics analyzer uses a different “identifier” scheme.

LinesOfCode.dgml – the class dependency graph came from the Architecture menu, then wrote a tool that took a log file from the Metrics Analyzer in VS and mapped it back to the DGML graph. The hard part here is the “name mapping” because metrics analyzer uses a different “identifier” scheme.

Set.dgml – the class dependencies from VS, but the categorization by hand (using the VS Property Window you can type in your own category names), then hooking up the icons by hand.

Tagging.dgml –by hand

TeamData.dgml – was a class level dependency graph , the green was a hand categorization of interfaces, the link color styles added via the Legend.


Most of these started as class or assembly level dependency graphs, with manual coloring and grouping added.

Overview.dgml – entirely by hand

ProgressionTypes – You can get a Type Hierarchy graph using the Architecture Explorer tool window which I explain in my view on the Architecture Explorer.


CallSequence.dgml: by hand

UmlMetaModel.dgml – I built a tool that understands the MOF XML format and exported it from an internal MOF description of UML that we had, but I think the grouping was by hand.


Devdiv-grouped.dgml A friend of mine JP Duplessis wrote a tool that cracks all the binaries in a Visual Studio build (native and managed) which he then stored in a database, he then dumped that out to DGML. The grouping was then done using some regular expression matching. We knew a few central nodes that lived in each group, then based on their dependencies the tool would suck things into those groups. We call this “group by patterns”.

devdiv-just-group.dgml – collapse all, but then I have a tool that does a “shallow copy” of this graph keeping the computed group to group dependencies intact. This could be a handy power tool – sort of a “roll up and throw away the detail” kind of tool.

Wpf-by-namespace – was a straight architecture dependency graph, limited to public types only I believe.

9 Replies to “Directed Graph Documents”

  1. I have programmed IBM mainframes, OS/2, Apple, Web, Java, Windows C++, ASP, .NET, Robot C, and micro controllers. And you know what? It’s all built on the same computer science principles and so all environments suffer from the same problem of complexity. My mission in life is to figure out what we are going to do about this across the industry because I think complexity is seriously limiting our ability to innovate in all software domains.

  2. Hi Chris,
    Is there a way I can add a "DGML Viewer" in my app to show a DGML file to users? Or is it only comes as part of the VS2010 IDE?

    I really like the DGML engine embedded in VS2010, and would like to use it in my app. What are my options?

  3. We do not have a standalone DGML viewer for you to use, it only comes in VS 2010 Ultimate and Premium. But we have received many requests for something like this and are considering what we can do about it in the future.

  4. Hi Chris,
    I really like this DGML and I think it’s a very cool way to create directed graph.
    I have Microsoft Visual Studio 2010, I have downloaded and extracted the files but I don’t know how to open the files in VS2010. Could you tell me how to open the files?


  5. Chris,

    I’m a developer with Siemens, and I’ve introduced our team to DGML for the purposes of this massive documentation project and for generating these dependency graphs from our existing code base. I haven’t yet figured out how to generate the dgml automatically though installing the "Visualization and Modeling Feature Pack", which I understand was supposed to extend this dependency graph functionality beyond C# and .NET to embrace C++ code as well. To work around that we’ve created a tool for generating the dgml.

    I have some questions about the behavior of properties. There’s odd behavior I can’t seem to make sense of beyond some attributes being defined in the xsd schema and others just orphaned from any namespace it seems (I’m a xml rookie, so perhaps more of that would make sense to me down the road). Anyhow, the behavior I find is where some properties show up in the dgml editor squiggled with blue text, which upon mouse hovering displays in the tooltip
    The ‘PropertyId’ attribute is not declared
    For some property PropertyId I’ve created from scratch. What is this about exactly?

    One other quick question, when generating the layout you often see the message "Processing 0 of N graphs…" What is this number referring to? Seems like I only have one graph, at least there’s only one <DirectedGraph> element in my dgml, so what could this mean?

    Since I’m writing, I thought I’d also ask what the status is for the request that there be a standalone dgml viewer/editor.

    Thanks a lot for the great work!


  6. I’ve just found that VS2017 Community Edition has this DGML editor. So, you can use DGML for free with VS, now. Thank you for the videos. The good thing is that these kinds of tools, similar to OO CASE (Sparx Enterprise Architect, for example) are forever, programming languages come and go but design tools like this will remain forever.

Leave a Reply

Your email address will not be published. Required fields are marked *