gexf

package module
v0.0.0-...-64c8edf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2014 License: MIT Imports: 6 Imported by: 1

README

gexf

.

GEXF format in Go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(w io.Writer, g *Graph) error

Types

type Attr

type Attr struct {
	Title   string
	Type    GEXFType
	Default interface{}
}

type AttrValue

type AttrValue struct {
	Title string
	Value interface{}
}

type GEXFType

type GEXFType string

GEXFType is an type for values Nodes can hold.

const (
	Long       GEXFType = "long"
	Double     GEXFType = "double"
	Float      GEXFType = "float"
	Boolean    GEXFType = "boolean"
	ListString GEXFType = "liststring"
	String     GEXFType = "string"
	AnyURI     GEXFType = "anyURI"
)

All the recognized GEXTTypes.

type Graph

type Graph struct {
	XMLName xml.Name `xml:"graph"`

	Mode     string `xml:"mode,attr,omitempty"`
	EdgeType string `xml:"defaultedgetype,attr"`

	Attrs *attributes `xml:"attributes"`
	Nodes []node      `xml:"nodes>node"`
	Edges []edge      `xml:"edges>edge"`
	// contains filtered or unexported fields
}

func NewGraph

func NewGraph() *Graph

func (*Graph) AddEdge

func (g *Graph) AddEdge(from, to string)

func (*Graph) AddNode

func (g *Graph) AddNode(id, label string, attr []AttrValue)

func (*Graph) GetID

func (g *Graph) GetID(feature interface{}) string

func (*Graph) SetNodeAttrs

func (g *Graph) SetNodeAttrs(attrs []Attr) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL