gexf

package module
v0.0.0-...-33f5ecd Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2014 License: BSD-2-Clause Imports: 7 Imported by: 0

README

gexf: Go package of Graph Exchange XML Format

REFERENCE

http://gexf.net

Documentation

Index

Constants

View Source
const (
	Version    = "1.2"
	Namespace  = "http://www.gexf.net/1.2draft"
	TimeFormat = "2006-01-02+15:04"

	DefaultCreator = "Gexf Go Library " + Version
)
View Source
const (
	Directed        = EdgeType("directed")
	Undirected      = EdgeType("undirected")
	Mutual          = EdgeType("mutual")
	DefaultEdgeType = Directed
)
View Source
const (
	String        = IdType("string")
	Integer       = IdType("integer")
	DefaultIdType = String
)
View Source
const (
	Static           = GraphType("static")
	Dynamic          = GraphType("dynamic")
	DefaultGraphType = Static
)

Variables

This section is empty.

Functions

func FromGobFile

func FromGobFile(file string, e interface{}) error

func ToGobFile

func ToGobFile(file string, e interface{}) error

Types

type Edge

type Edge struct {
	Id     string  `xml:"id,attr"`
	Source string  `xml:"source,attr"`
	Target string  `xml:"target,attr"`
	Weight float64 `xml:"weight,attr"`
}

type EdgeType

type EdgeType string

func (EdgeType) String

func (t EdgeType) String() string

type Edges

type Edges struct {
	Edge  []Edge `xml:"edge"`
	Count int    `xml:"count,attr"`
}

func (*Edges) Add

func (es *Edges) Add(e Edge)

type Gexf

type Gexf struct {
	XMLName xml.Name
	Version string `xml:"version,attr"`
	Meta    Meta   `xml:"meta"`

	Graph Graph `xml:"graph"`
}

func New

func New() *Gexf

func Open

func Open(file string) (g *Gexf, err error)

func (*Gexf) AddEdge

func (g *Gexf) AddEdge(e Edge)

func (*Gexf) AddNode

func (g *Gexf) AddNode(n Node)

func (*Gexf) Save

func (g *Gexf) Save(file string) error

type Graph

type Graph struct {
	Type     GraphType `xml:"type,attr"`
	IdType   IdType    `xml:"idtype,attr"`
	EdgeType EdgeType  `xml:"defaultedgetype,attr"`

	Nodes Nodes `xml:"nodes"`
	Edges Edges `xml:"edges"`
}

type GraphType

type GraphType string

type IdType

type IdType string

type Meta

type Meta struct {
	LastModified string `xml:"lastmodifieddate,attr"`
	Creator      string `xml:"creator,omitempty"`
	Keywords     string `xml:"keywords,omitempty"`
	Description  string `xml:"description,omitempty"`
}

type Node

type Node struct {
	Id    string `xml:"id,attr"`
	Label string `xml:"label,attr"`
}

type Nodes

type Nodes struct {
	Node  []Node `xml:"node"`
	Count int    `xml:"count,attr"`
}

func (*Nodes) Add

func (ns *Nodes) Add(n Node)

Jump to

Keyboard shortcuts

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