Skip to content

Commit

Permalink
gexf12: make slice fields plural and break words apart
Browse files Browse the repository at this point in the history
  • Loading branch information
kortschak committed Oct 13, 2018
1 parent 406984d commit b7aa608
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
52 changes: 26 additions & 26 deletions graph/formats/gexf12/gexf.go
Expand Up @@ -67,9 +67,9 @@ type Graph struct {
// 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"`
StartOpen string `xml:"startopen,attr,omitempty"`
End string `xml:"end,attr,omitempty"`
Endopen string `xml:"endopen,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".
Expand All @@ -87,9 +87,9 @@ type Attributes struct {
// Mode may be "static" or "dynamic".
Mode string `xml:"mode,attr,omitempty"`
Start string `xml:"start,attr,omitempty"`
Startopen string `xml:"startopen,attr,omitempty"`
StartOpen string `xml:"startopen,attr,omitempty"`
End string `xml:"end,attr,omitempty"`
Endopen string `xml:"endopen,attr,omitempty"`
EndOpen string `xml:"endopen,attr,omitempty"`
}

// Attribute holds a single graph attribute.
Expand Down Expand Up @@ -124,9 +124,9 @@ type Node struct {
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"`
StartOpen string `xml:"startopen,attr,omitempty"`
End string `xml:"end,attr,omitempty"`
Endopen string `xml:"endopen,attr,omitempty"`
EndOpen string `xml:"endopen,attr,omitempty"`
}

// NodeShape holds the visual representation of a node with associated
Expand All @@ -138,9 +138,9 @@ type NodeShape struct {
Shape string `xml:"value,attr"`
URI string `xml:"uri,attr,omitempty"`
Start string `xml:"start,attr,omitempty"`
Startopen string `xml:"startopen,attr,omitempty"`
StartOpen string `xml:"startopen,attr,omitempty"`
End string `xml:"end,attr,omitempty"`
Endopen string `xml:"endopen,attr,omitempty"`
EndOpen string `xml:"endopen,attr,omitempty"`
}

// Color represents a node or edge color and its associated dynamics.
Expand All @@ -151,9 +151,9 @@ type Color struct {
B byte `xml:"b,attr"`
A float64 `xml:"a,attr,omitempty"`
Start string `xml:"start,attr,omitempty"`
Startopen string `xml:"startopen,attr,omitempty"`
StartOpen string `xml:"startopen,attr,omitempty"`
End string `xml:"end,attr,omitempty"`
Endopen string `xml:"endopen,attr,omitempty"`
EndOpen string `xml:"endopen,attr,omitempty"`
}

// Edges holds a collection of edges constituting a graph or subgraph.
Expand All @@ -171,9 +171,9 @@ type Edge struct {
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"`
StartOpen string `xml:"startopen,attr,omitempty"`
End string `xml:"end,attr,omitempty"`
Endopen string `xml:"endopen,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"`
Expand All @@ -192,9 +192,9 @@ 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"`
StartOpen string `xml:"startopen,attr,omitempty"`
End string `xml:"end,attr,omitempty"`
Endopen string `xml:"endopen,attr,omitempty"`
EndOpen string `xml:"endopen,attr,omitempty"`
}

// EdgeShape holds the visual representation of an edge with associated
Expand All @@ -204,15 +204,15 @@ type Edgeshape struct {
Shape string `xml:"value,attr"`
Spells *Spells `xml:"spells,omitempty"`
Start string `xml:"start,attr,omitempty"`
Startopen string `xml:"startopen,attr,omitempty"`
StartOpen string `xml:"startopen,attr,omitempty"`
End string `xml:"end,attr,omitempty"`
Endopen string `xml:"endopen,attr,omitempty"`
EndOpen string `xml:"endopen,attr,omitempty"`
}

// Parents holds parent relationships between nodes in a hierarchical
// graph.
type Parents struct {
Parent []Parent `xml:"parent,omitempty"`
Parents []Parent `xml:"parent,omitempty"`
}

// Parent is a single parent relationship.
Expand All @@ -227,42 +227,42 @@ type Position struct {
Z float64 `xml:"z,attr"`
Spells *Spells `xml:"spells,omitempty"`
Start string `xml:"start,attr,omitempty"`
Startopen string `xml:"startopen,attr,omitempty"`
StartOpen string `xml:"startopen,attr,omitempty"`
End string `xml:"end,attr,omitempty"`
Endopen string `xml:"endopen,attr,omitempty"`
EndOpen string `xml:"endopen,attr,omitempty"`
}

// Size hold the visual size of a node and its dynamics.
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"`
StartOpen string `xml:"startopen,attr,omitempty"`
End string `xml:"end,attr,omitempty"`
Endopen string `xml:"endopen,attr,omitempty"`
EndOpen string `xml:"endopen,attr,omitempty"`
}

// Thickness hold the visual thickness of an edge and its dynamics.
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"`
StartOpen string `xml:"startopen,attr,omitempty"`
End string `xml:"end,attr,omitempty"`
Endopen string `xml:"endopen,attr,omitempty"`
EndOpen string `xml:"endopen,attr,omitempty"`
}

// Spells holds a collection of time dynamics for a graph entity.
type Spells struct {
Spell []Spell `xml:"spell"`
Spells []Spell `xml:"spell"`
}

// Spell is a time interval.
type Spell struct {
Start string `xml:"start,attr,omitempty"`
Startopen string `xml:"startopen,attr,omitempty"`
StartOpen string `xml:"startopen,attr,omitempty"`
End string `xml:"end,attr,omitempty"`
Endopen string `xml:"endopen,attr,omitempty"`
EndOpen string `xml:"endopen,attr,omitempty"`
}

type xsdDate time.Time
Expand Down
2 changes: 1 addition & 1 deletion graph/formats/gexf12/gexf_test.go
Expand Up @@ -351,7 +351,7 @@ var gexfExampleTests = []struct {
{ID: "a", Label: "cheese"},
{ID: "b", Label: "cherry"},
{ID: "c", Label: "cake", Parents: &Parents{
Parent: []Parent{
Parents: []Parent{
{For: "a"},
{For: "b"},
},
Expand Down

0 comments on commit b7aa608

Please sign in to comment.