Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

8 Commits

Repository files navigation

DotNetGraph

Create DOT/GraphViz diagram using C# / .Net

Available on NuGet: #

Documentation

Create a graph (DotGraph)

vargraph=newDotGraph("MyGraph");vardirectedGraph=newDotGraph("MyDirectedGraph",true);

Create and add a node (DotNode)

varmyNode=newDotNode("MyNode"){// Set all available propertiesShape=DotNodeShape.Ellipse,Label="My node !",FillColor=DotColor.Lightgrey,FontColor=DotColor.Black,Style=DotNodeStyle.Default,Height=0.5f};// Add the node to the graphgraph.Add(myNode);

Create and add an arrow (DotArrow)

// Create an arrow with node namesvarmyArrow=newDotArrow("myNode1","myNode2");// Create an arrow with node objectsvarmyArrow=newDotArrow(myNode1,myNode2){// Set all available propertiesArrowHeadShape=DotArrowShape.Normal;};// Add the arrow to the graphgraph.Add(myArrow);

Compile to DOT format

// Indented versionvardot=graph.Compile(false);// Minified versionvardot=graph.Compile();// Save it to a fileFile.WriteAllText("myFile.dot",dot);

About

Create DOT diagram using C#

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages