public static void DrawWithPath(this Graph <string, VertexData, string, EdgeData> graph, DrawGraph drawer, List <string> path)
        {
            if (graph.VerticesCount() > 1000)
            {
                drawer.ClearCanvas();
                drawer.DrawWarning(Resources.CannotDrawGraph);
                return;
            }

            Dictionary <string, VertexData> mappedVertices = InitDraw(graph, drawer);

            if (mappedVertices.Count <= 0)
            {
                return;
            }

            DrawEdges(drawer, mappedVertices, graph.Edges);
            if (path != null)
            {
                DrawPath(drawer, mappedVertices, path);
            }
            DrawVertices(drawer, mappedVertices);
        }
        private static Dictionary <string, VertexData> InitDraw(Graph <string, VertexData, string, EdgeData> graph, DrawGraph drawer)
        {
            drawer.ClearCanvas();
            var vertices = graph.Vertices;

            Dictionary <string, VertexData> mappedVertices = new Dictionary <string, VertexData>();

            foreach (var v in vertices)
            {
                mappedVertices.Add(v.Key, v.Data);
            }

            drawer.SetGraphSize(CalculateGraphSize(mappedVertices));

            return(mappedVertices);
        }
 private static void DrawEdges(DrawGraph drawer, Dictionary <string, VertexData> mappedVertexes,
                               IEnumerable <(string Key, string Start, string Target, EdgeData Data)> edges)
        public static void Draw(this Graph <string, VertexData, string, EdgeData> graph, DrawGraph drawer)
        {
            if (graph.VerticesCount() > 1000)
            {
                drawer.DrawWarning(Resources.CannotDrawGraph);
                return;
            }

            Dictionary <string, VertexData> mappedVertices = InitDraw(graph, drawer);

            if (mappedVertices.Count <= 0)
            {
                return;
            }

            DrawEdges(drawer, mappedVertices, graph.Edges);
            DrawVertices(drawer, mappedVertices);
        }