Back to godoc.org

Package dot

v0.9.14
Latest Go to latest

The latest major version is .

Published: Sep 10, 2020 | License: Apache-2.0 | Module: gorgonia.org/gorgonia

Overview

Package dot creates a graphviz compatible version of the ExprGraph

Index

Examples

func Marshal

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

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

Example

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))
}
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier