![]() |
Satsuma
a delicious .NET graph library
|
Loads and saves graphs stored in GraphML format. More...
Public Member Functions | |
GraphMLFormat () | |
void | Load (XDocument doc) |
Loads from an XML document. More... | |
void | Load (XmlReader xml) |
Loads from an XML reader. More... | |
void | Load (TextReader reader) |
Loads from a reader. More... | |
void | Load (string filename) |
Loads from a file. More... | |
void | RegisterPropertyLoader (Func< XElement, GraphMLProperty > loader) |
Registers a new GraphML property loader. More... | |
void | Save (TextWriter writer) |
Saves to a writer. More... | |
void | Save (string filename) |
Saves to a file. More... | |
Properties | |
IGraph | Graph [get, set] |
The graph itself. More... | |
IList< GraphMLProperty > | Properties [get, set] |
The properties (special data for nodes, arcs and the graph itself). More... | |
Loads and saves graphs stored in GraphML format.
See the GraphML website for information on the GraphML format.
Example (loading a graph and some special values for objects):
Example (saving a complete bipartite graph without any bells and whistles):
For examples on saving extra values for nodes, arcs or the graph itself; see the descendants of GraphMLProperty, such as StandardProperty<T> and NodeGraphicsProperty.
Definition at line 514 of file IO.GraphML.cs.
Satsuma.IO.GraphML.GraphMLFormat.GraphMLFormat | ( | ) |
Definition at line 533 of file IO.GraphML.cs.
void Satsuma.IO.GraphML.GraphMLFormat.Load | ( | XDocument | doc | ) |
Loads from an XML document.
Definition at line 573 of file IO.GraphML.cs.
void Satsuma.IO.GraphML.GraphMLFormat.Load | ( | XmlReader | xml | ) |
Loads from an XML reader.
Definition at line 628 of file IO.GraphML.cs.
void Satsuma.IO.GraphML.GraphMLFormat.Load | ( | TextReader | reader | ) |
Loads from a reader.
reader | A reader on the input file, e.g. a StreamReader. |
Definition at line 636 of file IO.GraphML.cs.
void Satsuma.IO.GraphML.GraphMLFormat.Load | ( | string | filename | ) |
Loads from a file.
Definition at line 643 of file IO.GraphML.cs.
void Satsuma.IO.GraphML.GraphMLFormat.RegisterPropertyLoader | ( | Func< XElement, GraphMLProperty > | loader | ) |
Registers a new GraphML property loader.
By default, recognition of StandardProperty<T> and NodeGraphicsProperty is supported when loading. You can define your own property classes by calling this method to add a loader.
The loader chain is used to make properties from <key>
elements.
loader | Must take an XElement (the key) as argument, and return a property with the parameters defined by the key element. Must throw ArgumentException if the element could not be recognized as a definition of the property class supported by the loader. |
Definition at line 557 of file IO.GraphML.cs.
void Satsuma.IO.GraphML.GraphMLFormat.Save | ( | TextWriter | writer | ) |
Saves to a writer.
writer | A writer on the output file, e.g. a StreamWriter. |
Definition at line 708 of file IO.GraphML.cs.
void Satsuma.IO.GraphML.GraphMLFormat.Save | ( | string | filename | ) |
Saves to a file.
Definition at line 715 of file IO.GraphML.cs.
|
getset |
The graph itself.
Definition at line 527 of file IO.GraphML.cs.
|
getset |
The properties (special data for nodes, arcs and the graph itself).
Definition at line 529 of file IO.GraphML.cs.