Documentation
¶
Overview ¶
Package export writes the library out as GraphML, JSON and BibTeX. M1.
No lock-in is a product commitment, not a feature: everything the tool knows must be extractable in a format something else can read. GraphML is the one that matters first, because the M1 acceptance test is a 500-node graph that opens cleanly in Gephi.
Every exporter has to survive a graph that is mostly stubs — works with an ID and no title. Filter them or label them, but never crash on them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GraphML ¶
type GraphML struct {
// contains filtered or unexported fields
}
GraphML writes a citation graph as GraphML (http://graphml.graphdrawing.org), the format Gephi, Cytoscape, yEd, NetworkX and igraph all read.
It streams: nodes and edges are written as they are handed over, so a library of any size exports in constant memory. Call WriteNode for every node, then WriteEdge for every edge, then Close. GraphML requires nodes and edges inside one <graph> element and does not require nodes first, but several readers resolve edges against nodes already seen, so nodes go first.
Edges point from the citing work to the cited one: an arrow means "cites", which is also the direction fil path calls lineage.
func NewGraphML ¶
NewGraphML writes the GraphML header to w and returns a writer for the graph's nodes and edges.
func (*GraphML) Close ¶
Close ends the document and flushes it, returning the first error seen at any point in the write.