graph

package
v0.3.14-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GraphFileVersion is the version of the graph file that is generated.
	GraphFileVersion = "1.0.0"
	// GraphFileName is the default file name used to save the graph.
	GraphFileName = "m2k-graph.json"
	// GraphSourceVertexKey is used to track an artifact across iterations. It contains the transformer that created this artifact.
	GraphSourceVertexKey = "m2k-logging-source-vertex"
	// GraphProcessVertexKey is used to track an artifact across iterations. It contains the transformer that last processed this artifact.
	GraphProcessVertexKey = "m2k-logging-process-vertex"
	// GraphEdgeArrowClosed is used to indicate a closed arrow edge ending.
	GraphEdgeArrowClosed = "arrowclosed"
	// GraphNodeTypeInput is used to indicate that the Node is an input/starting node.
	GraphNodeTypeInput = "input"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Label        string `json:"label"`
	PathMappings string `json:"pathMappings,omitempty"`
}

Data contains the label for a vertex.

type Edge

type Edge struct {
	Id   int                    `json:"id"`
	From int                    `json:"from"`
	To   int                    `json:"to"`
	Name string                 `json:"name"`
	Data map[string]interface{} `json:"data,omitempty"`
}

Edge is an artifact.

type EdgeT

type EdgeT struct {
	Id        string    `json:"id"`
	Source    string    `json:"source"`
	Target    string    `json:"target"`
	Label     string    `json:"label"`
	MarkerEnd MarkerEnd `json:"markerEnd"`
}

EdgeT is the web UI version of Edge.

type Graph

type Graph struct {
	SourceVertexId int

	Version  string         `json:"version"`
	Vertices map[int]Vertex `json:"vertices,omitempty"`
	Edges    map[int]Edge   `json:"edges,omitempty"`
	// contains filtered or unexported fields
}

Graph contains transformers and artifacts being passed between them.

func NewGraph

func NewGraph() *Graph

NewGraph creates a new graph.

func (*Graph) AddEdge

func (g *Graph) AddEdge(from, to int, name string, data map[string]interface{}) int

AddEdge adds a new edge to the graph.

func (*Graph) AddVertex

func (g *Graph) AddVertex(name string, iteration int, data map[string]interface{}) int

AddVertex adds a new vertex to the graph.

type GraphT

type GraphT struct {
	Nodes []Node  `json:"nodes,omitempty"`
	Edges []EdgeT `json:"edges,omitempty"`
}

GraphT is the final graph used by the web server.

type MarkerEnd

type MarkerEnd struct {
	Type string `json:"type"`
}

MarkerEnd is used to indicate the style of edge endings.

type Node

type Node struct {
	Id       string   `json:"id"`
	Type     string   `json:"type,omitempty"`
	Position Position `json:"position"`
	Data     Data     `json:"data"`
}

Node is the web UI version of Vertex.

type Position

type Position struct {
	X int `json:"x"`
	Y int `json:"y"`
}

Position is the 2d position of a Node.

type Vertex

type Vertex struct {
	Id           int                    `json:"id"`
	Iteration    int                    `json:"iteration"`
	SubIteration int                    `json:"subiteration"`
	Name         string                 `json:"name"`
	Data         map[string]interface{} `json:"data,omitempty"`
}

Vertex is a single transformer.

Jump to

Keyboard shortcuts

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