gexf

package module
v0.0.0-...-cad7271 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2016 License: BSD-3-Clause Imports: 2 Imported by: 0

README

gexf

GoDoc Travis

A GEXF file format package.

Supported features
  • Basic graph
  • Associated data
  • Network and data dynamics
  • Hierarchy structure
  • Phylogeny structure
  • Visualization

Documentation

Overview

Package gexf implements the GEXF file format

Index

Constants

View Source
const (
	Version = "1.2"
	Space   = "http://www.gexf.net/1.2draft"
	Local   = "gexf"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attr

type Attr struct {
	ID      string `xml:"id,attr"`
	Title   string `xml:"title,attr"`
	Type    string `xml:"type,attr"`
	Default string `xml:"default,omitempty"`
}

type AttrVal

type AttrVal struct {
	For   string `xml:"for,attr"`
	Value string `xml:"value,attr"`
}

type ClassAttrs

type ClassAttrs struct {
	Class ClassType `xml:"class,attr"`
	Attrs []Attr    `xml:"attribute"`
}

type ClassType

type ClassType int
const (
	ClassNode ClassType = iota
	ClassEdge
)

func (ClassType) MarshalText

func (t ClassType) MarshalText() ([]byte, error)

func (ClassType) String

func (t ClassType) String() string

type Color

type Color struct {
	R uint8 `xml:"r,attr"`
	G uint8 `xml:"g,attr"`
	B uint8 `xml:"b,attr"`
}

type Date

type Date struct {
	time.Time
}

func (*Date) MarshalText

func (d *Date) MarshalText() ([]byte, error)

func (*Date) UnmarshalText

func (d *Date) UnmarshalText(text []byte) error

type Doc

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

	Graph Graph `xml:"graph"`
}

func New

func New() *Doc

type Edge

type Edge struct {
	ID     string    `xml:"id,attr"`
	Label  string    `xml:"label,attr,omitempty"`
	Type   EdgeType  `xml:"type,attr,omitempty"`
	Source string    `xml:"source,attr"`
	Target string    `xml:"target,attr"`
	Weight float64   `xml:"weight,attr,omitempty"`
	Attrs  []AttrVal `xml:"attvalues>attvalue,omiempty"`
}

type EdgeType

type EdgeType int
const (
	Directed EdgeType = iota
	Undirected
	Mutual
)

func (EdgeType) MarshalText

func (t EdgeType) MarshalText() ([]byte, error)

func (EdgeType) String

func (t EdgeType) String() string

type Graph

type Graph struct {
	Mode    GraphMode `xml:"mode,attr,omitempty"`
	IDType  IDType    `xml:"idtype,attr,omitempty"`
	DefEdge EdgeType  `xml:"defaultedgetype,attr,omitempty"`

	Attrs []ClassAttrs `xml:"attributes,omitempty"`
	Nodes []Node       `xml:"nodes>node,omitempty"`
	Edges []Edge       `xml:"edges>edge,omitempty"`
}

type GraphMode

type GraphMode int
const (
	Static GraphMode = iota
	Dynamic
)

func (GraphMode) MarshalText

func (t GraphMode) MarshalText() ([]byte, error)

func (GraphMode) String

func (t GraphMode) String() string

type IDType

type IDType int
const (
	String IDType = iota
	Integer
)

func (IDType) MarshalText

func (t IDType) MarshalText() ([]byte, error)

func (IDType) String

func (t IDType) String() string

type Meta

type Meta struct {
	LastMod  Date   `xml:"lastmodifieddate,attr"`
	Creator  string `xml:"creator,omitempty"`
	Keywords string `xml:"keywords,omitempty"`
	Desc     string `xml:"description,omitempty"`
}

type Node

type Node struct {
	ID      string    `xml:"id,attr"`
	Label   string    `xml:"label,attr,omitempty"`
	Attrs   []AttrVal `xml:"attvalues>attvalue,omiempty"`
	Parents []Parent  `xml:"parents>parent"`

	Size  *Size  `xml:"http://www.gexf.net/1.2draft/viz size,omitempty"`
	Pos   *Pos   `xml:"http://www.gexf.net/1.2draft/viz position,omitempty"`
	Color *Color `xml:"http://www.gexf.net/1.2draft/viz color,omitempty"`
}

type Parent

type Parent struct {
	For string `xml:"for,attr"`
}

type Pos

type Pos struct {
	X float64 `xml:"x,attr"`
	Y float64 `xml:"y,attr"`
	Z float64 `xml:"z,attr"`
}

type Size

type Size struct {
	Value float64 `xml:"value,attr"`
}

Jump to

Keyboard shortcuts

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