Example #1
0
        public static string ToGraphviz <TVertex, TEdge>([NotNull] this IEdgeListGraph <TVertex, TEdge> graph)
            where TEdge : IEdge <TVertex>
        {
            var algorithm = new GraphvizAlgorithm <TVertex, TEdge>(graph);

            return(algorithm.Generate());
        }
Example #2
0
        public static string ToGraphviz <TVertex, TEdge>(
            [NotNull] this IEdgeListGraph <TVertex, TEdge> graph,
            [NotNull, InstantHandle] Action <GraphvizAlgorithm <TVertex, TEdge> > initAlgorithm)
            where TEdge : IEdge <TVertex>
        {
            if (initAlgorithm is null)
            {
                throw new ArgumentNullException(nameof(initAlgorithm));
            }

            var algorithm = new GraphvizAlgorithm <TVertex, TEdge>(graph);

            initAlgorithm(algorithm);
            return(algorithm.Generate());
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GraphvizAlgorithm{TVertex,TEdge}"/> class.
 /// </summary>
 /// <param name="graph">Graph to convert to DOT.</param>
 /// <exception cref="T:System.ArgumentNullException"><paramref name="graph"/> is <see langword="null"/>.</exception>
 protected GraphRendererBase([NotNull] IEdgeListGraph <TVertex, TEdge> graph)
 {
     Graphviz = new GraphvizAlgorithm <TVertex, TEdge>(graph);
     InternalInitialize();
 }