dot

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dot renders directed graphs in the Graphviz DOT language.

It knows the syntax and nothing about what is being drawn: callers describe their graph with the model below and stay free of DOT quoting and attribute rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(w io.Writer, g Graph) error

Write renders the graph and writes it to w.

Types

type Cluster

type Cluster struct {
	Label string
	Nodes []Node
}

Cluster is a group of nodes drawn in a labelled box of its own.

type Edge

type Edge struct {
	From  int
	To    int
	Style Style
}

Edge points from one node to another.

type Graph

type Graph struct {
	Name     string
	Clusters []Cluster
	Nodes    []Node // nodes outside of any cluster
	Edges    []Edge
}

Graph is a directed graph ready to be rendered.

type Node

type Node struct {
	ID    int
	Label string
	Style Style
}

Node is a single box, identified by a number unique within the Graph.

type Style

type Style uint8

Style is how a node or an edge is drawn.

const (
	Solid Style = iota
	Dashed
	Highlighted
)

Jump to

Keyboard shortcuts

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