gorgonia: gorgonia.org/gorgonia/encoding/dot Index | Examples | Files

package dot

import "gorgonia.org/gorgonia/encoding/dot"

Package dot creates a graphviz compatible version of the ExprGraph

Index

Examples

Package Files

constantgraph.go copy.go doc.go encode.go exprsubgraph.go graph.go inputsubgraph.go interface.go node.go operatorsubgraph.go topgraph.go

func Marshal Uses

func Marshal(g *gorgonia.ExprGraph) ([]byte, error)

Marshal the graph in a dot (graphviz) This methods also generates the subgraphs

Code:

g := gorgonia.NewGraph()

var x, y *gorgonia.Node
var err error

// define the expression
x = gorgonia.NewScalar(g, gorgonia.Float64, gorgonia.WithName("x"))
y = gorgonia.NewScalar(g, gorgonia.Float64, gorgonia.WithName("y"))
if _, err = gorgonia.Add(x, y); err != nil {
    log.Fatal(err)
}
if b, err := Marshal(g); err == nil {
    fmt.Println(string(b))
}

Package dot imports 9 packages (graph). Updated 2019-10-03. Refresh now. Tools for package owners.