Class DirectedGraphMLExtensions
Directed graph Markup Language extensions.
Inheritance
Inherited Members
Namespace: QuikGraph.Serialization
Assembly: QuikGraph.Serialization.dll
Syntax
[CLSCompliant(false)]
public static class DirectedGraphMLExtensions
Properties
| Improve this Doc View SourceDirectedGraphSerializer
Gets the DirectedGraph XML serializer.
Declaration
public static XmlSerializer DirectedGraphSerializer { get; }
Property Value
Type | Description |
---|---|
System.Xml.Serialization.XmlSerializer |
Methods
| Improve this Doc View SourceOpenAsDGML<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>, String)
Saves and opens the given graph
as DGML.
Declaration
public static void OpenAsDGML<TVertex, TEdge>(this IVertexAndEdgeListGraph<TVertex, TEdge> graph, string filePath)
where TEdge : IEdge<TVertex>
Parameters
Type | Name | Description |
---|---|---|
IVertexAndEdgeListGraph<TVertex, TEdge> | graph | Graph to open. |
System.String | filePath | Path to the file to save. |
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TEdge | Edge type. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
ToDirectedGraphML<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>)
Populates a DGML graph from a graph.
Declaration
public static DirectedGraph ToDirectedGraphML<TVertex, TEdge>(this IVertexAndEdgeListGraph<TVertex, TEdge> graph)
where TEdge : IEdge<TVertex>
Parameters
Type | Name | Description |
---|---|---|
IVertexAndEdgeListGraph<TVertex, TEdge> | graph | Graph to convert to DirectedGraph. |
Returns
Type | Description |
---|---|
DirectedGraph | Converted graph. |
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TEdge | Edge type. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
ToDirectedGraphML<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
Populates a DGML graph from a graph.
Declaration
public static DirectedGraph ToDirectedGraphML<TVertex, TEdge>(this IVertexAndEdgeListGraph<TVertex, TEdge> graph, VertexIdentity<TVertex> vertexIdentity, EdgeIdentity<TVertex, TEdge> edgeIdentity)
where TEdge : IEdge<TVertex>
Parameters
Type | Name | Description |
---|---|---|
IVertexAndEdgeListGraph<TVertex, TEdge> | graph | Graph to convert to DirectedGraph. |
VertexIdentity<TVertex> | vertexIdentity | Vertex identity method. |
EdgeIdentity<TVertex, TEdge> | edgeIdentity | Edge identity method. |
Returns
Type | Description |
---|---|
DirectedGraph | Converted graph. |
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TEdge | Edge type. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
ToDirectedGraphML<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, Action<TVertex, DirectedGraphNode>, Action<TEdge, DirectedGraphLink>)
Populates a DGML graph from a graph.
Declaration
public static DirectedGraph ToDirectedGraphML<TVertex, TEdge>(this IVertexAndEdgeListGraph<TVertex, TEdge> graph, VertexIdentity<TVertex> vertexIdentity, EdgeIdentity<TVertex, TEdge> edgeIdentity, Action<TVertex, DirectedGraphNode> formatNode, Action<TEdge, DirectedGraphLink> formatEdge)
where TEdge : IEdge<TVertex>
Parameters
Type | Name | Description |
---|---|---|
IVertexAndEdgeListGraph<TVertex, TEdge> | graph | Graph to convert to DirectedGraph. |
VertexIdentity<TVertex> | vertexIdentity | Vertex identity method. |
EdgeIdentity<TVertex, TEdge> | edgeIdentity | Edge identity method. |
System.Action<TVertex, DirectedGraphNode> | formatNode | Formats a vertex into a DirectedGraphNode. |
System.Action<TEdge, DirectedGraphLink> | formatEdge | Formats an edge into a DirectedGraphLink. |
Returns
Type | Description |
---|---|
DirectedGraph | Converted graph. |
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TEdge | Edge type. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
ToDirectedGraphML<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>, Func<TVertex, GraphColor>)
Populates a DGML graph from a graph.
Declaration
public static DirectedGraph ToDirectedGraphML<TVertex, TEdge>(this IVertexAndEdgeListGraph<TVertex, TEdge> graph, Func<TVertex, GraphColor> verticesColors)
where TEdge : IEdge<TVertex>
Parameters
Type | Name | Description |
---|---|---|
IVertexAndEdgeListGraph<TVertex, TEdge> | graph | Graph to convert to DirectedGraph. |
System.Func<TVertex, GraphColor> | verticesColors | Function that gives the color of a vertex. |
Returns
Type | Description |
---|---|
DirectedGraph | Converted graph. |
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TEdge | Edge type. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
WriteXml(DirectedGraph, Stream)
Writes the DGML data structure to the System.Xml.XmlWriter.
Declaration
public static void WriteXml(this DirectedGraph graph, Stream stream)
Parameters
Type | Name | Description |
---|---|---|
DirectedGraph | graph | Graph instance to write. |
System.IO.Stream | stream | Stream in which writing graph data. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
WriteXml(DirectedGraph, TextWriter)
Writes the DGML data structure to the System.IO.TextWriter.
Declaration
public static void WriteXml(this DirectedGraph graph, TextWriter writer)
Parameters
Type | Name | Description |
---|---|---|
DirectedGraph | graph | Graph instance to write. |
System.IO.TextWriter | writer | Text writer in which writing graph data. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
WriteXml(DirectedGraph, String)
Writes the DGML data structure to the XML writer.
Declaration
public static void WriteXml(this DirectedGraph graph, string filePath)
Parameters
Type | Name | Description |
---|---|---|
DirectedGraph | graph | Graph instance to write. |
System.String | filePath | Path to the file to write into. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
WriteXml(DirectedGraph, XmlWriter)
Writes the DGML data structure to the System.Xml.XmlWriter.
Declaration
public static void WriteXml(this DirectedGraph graph, XmlWriter writer)
Parameters
Type | Name | Description |
---|---|---|
DirectedGraph | graph | Graph instance to write. |
System.Xml.XmlWriter | writer | XML writer in which writing graph data. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|