gexf12

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2019 License: BSD-3-Clause Imports: 3 Imported by: 2

Documentation

Overview

Package gexf12 implements marshaling and unmarshaling of GEXF1.2 documents.

For details of GEXF see https://gephi.org/gexf/format/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttValue

type AttValue struct {
	For       string `xml:"for,attr"`
	Value     string `xml:"value,attr"`
	Start     string `xml:"start,attr,omitempty"`
	StartOpen string `xml:"startopen,attr,omitempty"`
	End       string `xml:"end,attr,omitempty"`
	EndOpen   string `xml:"endopen,attr,omitempty"`
}

AttValues holds a single attribute value and its associated dynamics.

type AttValues

type AttValues struct {
	AttValues []AttValue `xml:"attvalue,omitempty"`
}

AttVlues holds a collection of attribute values.

type Attribute

type Attribute struct {
	ID    string `xml:"id,attr"`
	Title string `xml:"title,attr"`
	// Type may be one of "integer", "long", "double", "float",
	// "boolean", "liststring", "string", or "anyURI".
	Type    string `xml:"type,attr"`
	Default string `xml:"default,omitempty"`
	Options string `xml:"options,omitempty"`
}

Attribute holds a single graph attribute.

type Attributes

type Attributes struct {
	Attributes []Attribute `xml:"attribute,omitempty"`
	// Class be one of "node" or "edge".
	Class string `xml:"class,attr"`
	// Mode may be "static" or "dynamic".
	Mode      string `xml:"mode,attr,omitempty"`
	Start     string `xml:"start,attr,omitempty"`
	StartOpen string `xml:"startopen,attr,omitempty"`
	End       string `xml:"end,attr,omitempty"`
	EndOpen   string `xml:"endopen,attr,omitempty"`
}

Attributes holds a collection of potentially dynamic attributes associated with a graph.

type Color

type Color struct {
	Spells    *Spells `xml:"spells,omitempty"`
	R         byte    `xml:"r,attr"`
	G         byte    `xml:"g,attr"`
	B         byte    `xml:"b,attr"`
	A         float64 `xml:"a,attr,omitempty"`
	Start     string  `xml:"start,attr,omitempty"`
	StartOpen string  `xml:"startopen,attr,omitempty"`
	End       string  `xml:"end,attr,omitempty"`
	EndOpen   string  `xml:"endopen,attr,omitempty"`
}

Color represents a node or edge color and its associated dynamics.

type Content

type Content struct {
	XMLName xml.Name `xml:"http://www.gexf.net/1.2draft gexf"`
	Meta    *Meta    `xml:"meta,omitempty"`
	Graph   Graph    `xml:"graph"`
	// Version must be "1.2".
	Version string `xml:"version,attr"`
	Variant string `xml:"variant,attr,omitempty"`
}

Content holds a GEFX graph and metadata.

type Edge

type Edge struct {
	ID        string     `xml:"id,attr,omitempty"`
	AttValues *AttValues `xml:"attvalues"`
	Spells    *Spells    `xml:"spells"`
	Color     *Color     `xml:"http://www.gexf.net/1.2draft/viz color"`
	Thickness *Thickness `xml:"http://www.gexf.net/1.2draft/viz thickness"`
	Shape     *Edgeshape `xml:"http://www.gexf.net/1.2draft/viz shape"`
	Start     string     `xml:"start,attr,omitempty"`
	StartOpen string     `xml:"startopen,attr,omitempty"`
	End       string     `xml:"end,attr,omitempty"`
	EndOpen   string     `xml:"endopen,attr,omitempty"`
	// Type may be one of directed, undirected, mutual
	Type   string  `xml:"type,attr,omitempty"`
	Label  string  `xml:"label,attr,omitempty"`
	Source string  `xml:"source,attr"`
	Target string  `xml:"target,attr"`
	Weight float64 `xml:"weight,attr,omitempty"`
}

Edge is a single edge and its associated attributes.

type Edges

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

Edges holds a collection of edges constituting a graph or subgraph.

type Edgeshape

type Edgeshape struct {
	// Shape be one of solid, dotted, dashed, double
	Shape     string  `xml:"value,attr"`
	Spells    *Spells `xml:"spells,omitempty"`
	Start     string  `xml:"start,attr,omitempty"`
	StartOpen string  `xml:"startopen,attr,omitempty"`
	End       string  `xml:"end,attr,omitempty"`
	EndOpen   string  `xml:"endopen,attr,omitempty"`
}

EdgeShape holds the visual representation of an edge with associated dynamics.

type Graph

type Graph struct {
	Attributes []Attributes `xml:"attributes"`
	Nodes      Nodes        `xml:"nodes"`
	Edges      Edges        `xml:"edges"`
	// TimeFormat may be one of "integer", "double", "date" or "dateTime".
	TimeFormat string `xml:"timeformat,attr,omitempty"`
	Start      string `xml:"start,attr,omitempty"`
	StartOpen  string `xml:"startopen,attr,omitempty"`
	End        string `xml:"end,attr,omitempty"`
	EndOpen    string `xml:"endopen,attr,omitempty"`
	// DefaultEdgeType may be one of "directed", "undirected" or "mutual".
	DefaultEdgeType string `xml:"defaultedgetype,attr,omitempty"`
	// IDType may be one of "integer" or "string".
	IDType string `xml:"idtype,attr,omitempty"`
	// Mode may be "static" or "dynamic".
	Mode string `xml:"mode,attr,omitempty"`
}

Graph stores the graph nodes, edges, dynamics and visualization data.

type Meta

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

Meta holds optional metadata associated with the graph.

func (*Meta) MarshalXML

func (t *Meta) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML implements the xml.Marshaler interface.

func (*Meta) UnmarshalXML

func (t *Meta) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML implements the xml.Unmarshaler interface.

type Node

type Node struct {
	ID        string     `xml:"id,attr,omitempty"`
	Label     string     `xml:"label,attr,omitempty"`
	AttValues *AttValues `xml:"attvalues"`
	Spells    *Spells    `xml:"spells"`
	Nodes     *Nodes     `xml:"nodes"`
	Edges     *Edges     `xml:"edges"`
	ParentID  string     `xml:"pid,attr,omitempty"`
	Parents   *Parents   `xml:"parents"`
	Color     *Color     `xml:"http://www.gexf.net/1.2draft/viz color"`
	Position  *Position  `xml:"http://www.gexf.net/1.2draft/viz position"`
	Size      *Size      `xml:"http://www.gexf.net/1.2draft/viz size"`
	Shape     *NodeShape `xml:"http://www.gexf.net/1.2draft/viz shape"`
	Start     string     `xml:"start,attr,omitempty"`
	StartOpen string     `xml:"startopen,attr,omitempty"`
	End       string     `xml:"end,attr,omitempty"`
	EndOpen   string     `xml:"endopen,attr,omitempty"`
}

Node is a single node and its associated attributes.

type NodeShape

type NodeShape struct {
	Spells *Spells `xml:"spells,omitempty"`
	// Value be one of "disc", "square", "triangle",
	// "diamond" or "image".
	Shape     string `xml:"value,attr"`
	URI       string `xml:"uri,attr,omitempty"`
	Start     string `xml:"start,attr,omitempty"`
	StartOpen string `xml:"startopen,attr,omitempty"`
	End       string `xml:"end,attr,omitempty"`
	EndOpen   string `xml:"endopen,attr,omitempty"`
}

NodeShape holds the visual representation of a node with associated dynamics.

type Nodes

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

Nodes holds a collection of nodes constituting a graph or subgraph.

type Parent

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

Parent is a single parent relationship.

type Parents

type Parents struct {
	Parents []Parent `xml:"parent,omitempty"`
}

Parents holds parent relationships between nodes in a hierarchical graph.

type Position

type Position struct {
	X         float64 `xml:"x,attr"`
	Y         float64 `xml:"y,attr"`
	Z         float64 `xml:"z,attr"`
	Spells    *Spells `xml:"spells,omitempty"`
	Start     string  `xml:"start,attr,omitempty"`
	StartOpen string  `xml:"startopen,attr,omitempty"`
	End       string  `xml:"end,attr,omitempty"`
	EndOpen   string  `xml:"endopen,attr,omitempty"`
}

Position hold the spatial position of a node and its dynamics.

type Size

type Size struct {
	Value     float64 `xml:"value,attr"`
	Spells    *Spells `xml:"http://www.gexf.net/1.2draft/viz spells,omitempty"`
	Start     string  `xml:"start,attr,omitempty"`
	StartOpen string  `xml:"startopen,attr,omitempty"`
	End       string  `xml:"end,attr,omitempty"`
	EndOpen   string  `xml:"endopen,attr,omitempty"`
}

Size hold the visual size of a node and its dynamics.

type Spell

type Spell struct {
	Start     string `xml:"start,attr,omitempty"`
	StartOpen string `xml:"startopen,attr,omitempty"`
	End       string `xml:"end,attr,omitempty"`
	EndOpen   string `xml:"endopen,attr,omitempty"`
}

Spell is a time interval.

type Spells

type Spells struct {
	Spells []Spell `xml:"spell"`
}

Spells holds a collection of time dynamics for a graph entity.

type Thickness

type Thickness struct {
	Value     float64 `xml:"value,attr"`
	Spells    *Spells `xml:"http://www.gexf.net/1.2draft/viz spells,omitempty"`
	Start     string  `xml:"start,attr,omitempty"`
	StartOpen string  `xml:"startopen,attr,omitempty"`
	End       string  `xml:"end,attr,omitempty"`
	EndOpen   string  `xml:"endopen,attr,omitempty"`
}

Thickness hold the visual thickness of an edge and its dynamics.

Notes

Bugs

  • The namespace for GEFX1.2 is 1.2draft, though it has already been deprecated. There is no specification for 1.3, although it is being used in the wild.

Jump to

Keyboard shortcuts

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