TaggedEdge Tag doesn´t appear in drawn graph

Topics: graph
Apr 7, 2014 at 3:45 PM
Hi!

I´m trying to add labels to my edges.
I changed Edge<string> to
TaggedEdge<string, string> edge = new TaggedEdge<string, string>("from", "to", "label");
graph.AddEdge(edge);

What else do I have to change?
Is a FormatEdgeAction necessary? atm. it is set to null

Thank you!
Jan

Code:
-------------
FormatEdgeAction<string, TaggedEdge<string, string>> edgeFormatter;
edgeFormatter = null;
Visualizer.VisualizeAdjacency<string, TaggedEdge<string, string>>(graph, "filename", edgeFormatter, @"C:\Users\...");

-------------

public static void VisualizeAdjacency<TVertex, TEdge>(AdjacencyGraph<TVertex, TEdge> graph,
            string fileName, FormatEdgeAction<TVertex, TEdge> edgeFormatter, string dir = @"c:\temp\")
            where TEdge : IEdge<TVertex>
        {
            var fullFileName = Path.Combine(dir, fileName);
            var viz = new GraphvizAlgorithm<TVertex, TEdge>(graph);

            viz.FormatVertex += VizFormatVertex;

            viz.FormatEdge += edgeFormatter;

            viz.Generate(new FileDotEngine(), fullFileName);
        }
---------
static void VizFormatVertex<TVertex>(object sender, FormatVertexEventArgs<TVertex> e)
        {
            e.VertexFormatter.Label = e.Vertex.ToString();
        }
--------------