2

Drawing graphs in Visual Studio

 3 years ago
source link: https://stevedrivendevelopment.com/2014/11/29/drawing-graphs-in-visual-studio/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Drawing graphs in Visual Studio

Just a quick one, but I find that a picture is often a much better way to communicate than words, and Visual Studio has a built-in tool I had no idea about until today. It’s the directed graph editor;

dgml-visual-studio

Turns out VS has this built-in, nicely-featured graph editor which saves to an XML dialect called DGML. The feature seems to have been included to support Visual Studio’s code analysis tools, but it can quite happliy edit plain files with no connection to any kind of code. The simple upshot is that you get a free tool for building these sorts of pictures, which I find really useful for thinking through a complex problem.

The quickstart guide is;

  1. Create a blank file with a DGML extension.
  2. In a text editor, add a simple example. The wikipedia page on DGML has a three-node graph you can copy.
  3. Open the file in Visual Studio.

It’s pretty straightfoward to draw your graphs, and the toolbar above the editor window does things like auto-layout.

The resulting file is just XML, so it can be checked into source control, too.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK