graphviz

package
v3.3.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2018 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package graphviz helps to create graphviz dot files using the TSL package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Walk

func Walk(in string, n tsl.Node, nodeID string) (out string, err error)

Walk travel the TSL tree to create Graphviz dot nodes.

Users can call the Walk method to get the dot file graph string.

s, err = graphviz.Walk("", tree, "")

The return string will be a node list for a .dot file:

tcuA [shape=box color=black label="$eq"]
xhxK [shape=record color=red label="$ident | 'city'" ]
QFDa [shape=record color=blue label="$string | 'rome'" ]
tcuA -> { xhxK, QFDa }

For valid Graphviz dot file, the nodes must be wrapped in a `digraph` object:

 	s, err = graphviz.Walk("", tree, "")
	s = fmt.Sprintf("digraph {\n%s\n}\n", s)

Types

This section is empty.

Jump to

Keyboard shortcuts

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