Namespace Graph1x.Serialization
Classes
- DotExportOptions<TVertex, TEdge>
Options controlling ToDot<TVertex, TEdge>(IReadOnlyGraph<TVertex, TEdge>, DotExportOptions<TVertex, TEdge>).
- GraphAttribute<T>
A named, typed attribute read off a vertex or edge during export — the same declaration drives GraphML (typed
<key>elements) and node-link JSON (typed properties). A null string value omits the attribute on that element. Names must be unique per element kind and must not collide with structural names (id,source,target, or theweightkey when a weight selector is set).
- GraphDocument
A parsed graph document: the structure plus every vertex and edge attribute the source carried. Vertices are strings (the document's node ids); attribute values are typed per the document's declarations — string, bool, int, long, float, or double — boxed as object.
- GraphDotExtensions
Exports graphs to the Graphviz DOT language. Output is deterministic (vertices in insertion order, edges in the graph's enumeration order — grouped by source vertex — and
\nline endings) so it can be asserted, diffed, and cached; every identifier is quoted and escaped, so arbitrary vertex strings are safe.
- GraphJson
Imports node-link JSON documents produced by ToJson<TVertex, TEdge>(IReadOnlyGraph<TVertex, TEdge>) or by other tools using the same shape. Vertices are strings; graphs import into multigraph types, the lossless superset. Unknown properties are ignored for forward compatibility; structural problems raise FormatException.
- GraphJsonExportOptions<TVertex, TEdge>
Options controlling ToJson<TVertex, TEdge>(IReadOnlyGraph<TVertex, TEdge>, GraphJsonExportOptions<TVertex, TEdge>).
- GraphJsonExtensions
Exports graphs to JSON in the node-link shape used across the ecosystem (NetworkX, D3):
{ "directed": ..., "nodes": [...], "edges": [...] }. Written with Utf8JsonWriter directly — no reflection-based serialization — with deterministic property order and invariant number formatting.
- GraphMermaidExtensions
Exports graphs to Mermaid flowchart syntax. Output is deterministic (vertices in insertion order, edges in the graph's enumeration order — grouped by source vertex — and
\nline endings) so it can be asserted, diffed, and cached. Mermaid node identifiers cannot be arbitrary strings, so nodes get synthetic identifiers (v0,v1, … in insertion order) with the display label attached at declaration; labels are escaped, so arbitrary vertex strings are safe.
- GraphMl
Imports GraphML documents produced by ToGraphMl<TVertex, TEdge>(IReadOnlyGraph<TVertex, TEdge>) or by other tools. Vertices are strings (GraphML node ids); graphs import into multigraph types, the lossless superset, since GraphML permits parallel edges. Unknown elements and attributes are ignored for forward compatibility; structural problems raise FormatException.
- GraphMlExportOptions<TVertex, TEdge>
Options controlling ToGraphMl<TVertex, TEdge>(IReadOnlyGraph<TVertex, TEdge>, GraphMlExportOptions<TVertex, TEdge>).
- GraphMlExtensions
Exports graphs to GraphML (http://graphml.graphdrawing.org). Vertices are declared first (isolated ones included) and edges follow in the graph's enumeration order (grouped by source vertex); XML escaping is handled by the writer, so arbitrary vertex strings are safe. Weights are written with the invariant culture.
- MermaidExportOptions<TVertex, TEdge>
Options controlling ToMermaid<TVertex, TEdge>(IReadOnlyGraph<TVertex, TEdge>, MermaidExportOptions<TVertex, TEdge>).
Enums
- GraphAttributeType
The declared value type of a GraphAttribute<T>, mirroring GraphML's attr.type domain.
- MermaidDirection
Flow direction of a Mermaid flowchart, emitted in the
flowchartheader.