dot

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package dot generates Graphviz DOT source text for a built plan without depending on a Graphviz runtime.

This package is the single source of truth for graph construction: the graphviz package renders svg/png by generating this DOT source and handing it to the Graphviz runtime, and callers that lay out the graph elsewhere (for example in a browser-side Graphviz build) can consume the source directly without linking github.com/goccy/go-graphviz and its WASM/font stack.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Source

func Source(plan *visualize.Plan) (string, error)

Source returns DOT source text with default options.

func SourceWithOptions

func SourceWithOptions(plan *visualize.Plan, opts Options) (string, error)

SourceWithOptions returns DOT source text using opts.

Types

type Options

type Options struct {
	// ShowQuery adds a node containing the query text, linked from the root.
	ShowQuery bool
	// ShowQueryStats adds query statistics to the query text node.
	ShowQueryStats bool
}

Options configures DOT source generation.

type Renderer

type Renderer struct {
	Options Options
}

Renderer generates DOT source for a built plan.

func NewRenderer

func NewRenderer(opts Options) *Renderer

NewRenderer returns a DOT source renderer.

func (*Renderer) Render

func (r *Renderer) Render(ctx context.Context, w io.Writer, plan *visualize.Plan) error

Render writes DOT source for plan to w.

Jump to

Keyboard shortcuts

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