示例#1
0
        public static DotGraph FromPipeline(IGraphNode node)
        {
            var roots = GetRoots(node).ToList();

            var metadata = new NodeMetadata(roots);

            var nodes      = DotGraphNodes.AppendNodeAndChildren(roots, metadata);
            var formatting = DotGraphFormatting.AppendFormatting(roots, metadata);
            var rankings   = DotGraphRanking.AppendRankings(roots, metadata);

            return(new DotGraph {
                nodes = nodes, formatting = formatting, rankings = rankings
            });
        }
        public static string FromPipeline(IGraphNode node)
        {
            var roots = GetRoots(node).ToList();

            var metadata = new NodeMetadata(roots);

            return($@"
digraph G {{ node [style=filled, shape=rec]

# Nodes
{DotGraphNodes.AppendNodeAndChildren(roots, metadata)}

# Formatting
{DotGraphFormatting.AppendFormatting(roots, metadata)}
{DotGraphRanking.AppendRankings(roots, metadata)}

}}
".Trim());
        }