Documentation
¶
Overview ¶
Package graphjson defines ELK's JSON graph interchange model.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Edge ¶
type Edge struct {
ID ID `json:"id,omitempty"`
Labels []*Label `json:"labels,omitempty"`
LayoutOptions LayoutOptions `json:"layoutOptions,omitempty"`
Sources []ID `json:"sources,omitempty"`
Targets []ID `json:"targets,omitempty"`
Sections []*EdgeSection `json:"sections,omitempty"`
JunctionPoints []Point `json:"junctionPoints,omitempty"`
Source *ID `json:"source,omitempty"`
SourcePort *ID `json:"sourcePort,omitempty"`
Target *ID `json:"target,omitempty"`
TargetPort *ID `json:"targetPort,omitempty"`
SourcePoint *Point `json:"sourcePoint,omitempty"`
TargetPoint *Point `json:"targetPoint,omitempty"`
BendPoints []Point `json:"bendPoints,omitempty"`
Container *ID `json:"container,omitempty"`
AdditionalFields map[string]json.RawMessage `json:"-"`
// contains filtered or unexported fields
}
Edge accepts both ELK's extended sources/targets form and its deprecated primitive source/target form.
func (*Edge) LayoutOptionKeys ¶
LayoutOptionKeys returns the layout-option member order captured while decoding JSON. Programmatically constructed edges return nil.
func (Edge) MarshalJSON ¶
func (*Edge) UnmarshalJSON ¶
type EdgeSection ¶
type EdgeSection struct {
ID ID `json:"id,omitempty"`
LayoutOptions LayoutOptions `json:"layoutOptions,omitempty"`
StartPoint *Point `json:"startPoint,omitempty"`
EndPoint *Point `json:"endPoint,omitempty"`
BendPoints []Point `json:"bendPoints,omitempty"`
IncomingShape *ID `json:"incomingShape,omitempty"`
OutgoingShape *ID `json:"outgoingShape,omitempty"`
IncomingSections []ID `json:"incomingSections,omitempty"`
OutgoingSections []ID `json:"outgoingSections,omitempty"`
AdditionalFields map[string]json.RawMessage `json:"-"`
// contains filtered or unexported fields
}
EdgeSection is one connected piece of an edge route.
func (*EdgeSection) LayoutOptionKeys ¶
func (section *EdgeSection) LayoutOptionKeys() []string
LayoutOptionKeys returns the layout-option member order captured while decoding JSON. Programmatically constructed sections return nil.
func (EdgeSection) MarshalJSON ¶
func (section EdgeSection) MarshalJSON() ([]byte, error)
func (*EdgeSection) UnmarshalJSON ¶
func (section *EdgeSection) UnmarshalJSON(data []byte) error
type ID ¶
type ID struct {
// contains filtered or unexported fields
}
ID is an ELK graph identifier. ELK's documented API uses string IDs, while its JSON importer also accepts integral JSON numbers. ID preserves which representation was supplied.
func (ID) MarshalJSON ¶
func (*ID) UnmarshalJSON ¶
type Label ¶
type Label struct {
ID *ID `json:"id,omitempty"`
Text *string `json:"text,omitempty"`
Labels []*Label `json:"labels,omitempty"`
LayoutOptions LayoutOptions `json:"layoutOptions,omitempty"`
X *float64 `json:"x,omitempty"`
Y *float64 `json:"y,omitempty"`
Width *float64 `json:"width,omitempty"`
Height *float64 `json:"height,omitempty"`
AdditionalFields map[string]json.RawMessage `json:"-"`
// contains filtered or unexported fields
}
Label is a shape attached to a node, port, or edge.
func (*Label) LayoutOptionKeys ¶
LayoutOptionKeys returns the layout-option member order captured while decoding JSON. Programmatically constructed labels return nil.
func (Label) MarshalJSON ¶
func (*Label) UnmarshalJSON ¶
type LayoutOptions ¶
LayoutOptions contains layout option values. ELK's JavaScript facade accepts strings as documented as well as JSON booleans and numbers.
type Node ¶
type Node struct {
ID ID `json:"id,omitempty"`
Labels []*Label `json:"labels,omitempty"`
LayoutOptions LayoutOptions `json:"layoutOptions,omitempty"`
IndividualSpacings LayoutOptions `json:"individualSpacings,omitempty"`
X *float64 `json:"x,omitempty"`
Y *float64 `json:"y,omitempty"`
Width *float64 `json:"width,omitempty"`
Height *float64 `json:"height,omitempty"`
Children []*Node `json:"children,omitempty"`
Ports []*Port `json:"ports,omitempty"`
Edges []*Edge `json:"edges,omitempty"`
AdditionalFields map[string]json.RawMessage `json:"-"`
// contains filtered or unexported fields
}
Node is both ELK's root graph type and its recursive node type. Nil slices are absent JSON members; non-nil empty slices are emitted as empty arrays.
func (*Node) IndividualSpacingKeys ¶
IndividualSpacingKeys returns the individual-spacing member order captured while decoding JSON. Programmatically constructed nodes return nil.
func (*Node) LayoutOptionKeys ¶
LayoutOptionKeys returns the layout-option member order captured while decoding JSON. Programmatically constructed nodes return nil.
func (Node) MarshalJSON ¶
func (*Node) UnmarshalJSON ¶
type Point ¶
Point is a two-dimensional point in parent-relative ELK coordinates.
func (Point) MarshalJSON ¶
type Port ¶
type Port struct {
ID ID `json:"id,omitempty"`
Labels []*Label `json:"labels,omitempty"`
LayoutOptions LayoutOptions `json:"layoutOptions,omitempty"`
X *float64 `json:"x,omitempty"`
Y *float64 `json:"y,omitempty"`
Width *float64 `json:"width,omitempty"`
Height *float64 `json:"height,omitempty"`
AdditionalFields map[string]json.RawMessage `json:"-"`
// contains filtered or unexported fields
}
Port is a connectable shape owned by a node.
func (*Port) LayoutOptionKeys ¶
LayoutOptionKeys returns the layout-option member order captured while decoding JSON. Programmatically constructed ports return nil.