graph

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: GPL-3.0, GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TB view = "TB" // top bottom
	BT view = "BT" // bottom top
	RL view = "RL" // right left
	LR view = "LR" // left right
	TD view = "TD" // same as TB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Edge

type Edge struct {
	LeftNode  string `@Ident[" "|"\t"]"-""-"["-"]`
	Directed  bool   `[@">"][" "|"\t"]`
	RightNode string `@Ident[";"]`
}

type Graph

type Graph struct {
	View      view        `"graph" @Ident`
	Edges     []*Edge     `@@*`
	SubGraphs []*SubGraph `@@*`
	// contains filtered or unexported fields
}

Graph implements semantics of markdown flowchart, aka graph, http://mermaid-js.github.io/mermaid/#/flowchart

func FromFile

func FromFile(path string) (*Graph, error)

func Parse

func Parse(reader io.Reader) (*Graph, error)

func (*Graph) GetEdges

func (gr *Graph) GetEdges(index int) []int

GetEdges assumes that SetNodeName was called for all nodes in the graphs

func (*Graph) GetNames

func (gr *Graph) GetNames() []string

func (Graph) GetView

func (gr Graph) GetView() view

func (*Graph) SetNodeName

func (gr *Graph) SetNodeName(name string, index int)

type SubGraph

type SubGraph struct {
	Name  string  `"subgraph" @Ident`
	Edges []*Edge `@@*"end"`
}

Jump to

Keyboard shortcuts

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