dot

package
v1.0.0-beta9 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const HALIGN_CENTER = "CENTER"
View Source
const HALIGN_LEFT = "LEFT"
View Source
const HALIGN_RIGHT = "RIGHT"
View Source
const HALIGN_TEXT = "TEXT"
View Source
const VALIGN_BOTTOM = "BOTTOM"
View Source
const VALIGN_MIDDLE = "MIDDLE"
View Source
const VALIGN_TOP = "TOP"

Variables

View Source
var DefaultFontConfig = FontConfig{
	Face:  "Courier",
	Size:  10,
	Color: "gray20",
}

Functions

This section is empty.

Types

type EdgeOptions

type EdgeOptions struct {
	Font  FontConfig
	Color string
}

func (EdgeOptions) String

func (e EdgeOptions) String() string

type FontConfig

type FontConfig struct {
	Face  string
	Size  int
	Color string
}

func (FontConfig) String

func (f FontConfig) String() string

func (FontConfig) Write

func (f FontConfig) Write(s string) string

type HorizontalAlignment

type HorizontalAlignment string

type Options

type Options struct {
	Font  FontConfig
	Color string

	Table      TableOptions
	Labels     TableCellOptions
	Properties TableCellOptions
	Edges      EdgeOptions
}

func DefaultOptions

func DefaultOptions() Options

type Renderer

type Renderer struct {
	Options          Options
	NodeSelectorFunc func(graph.Node) bool
	EdgeSelectorFunc func(graph.Edge) bool
}

func (Renderer) EdgeRenderer

func (r Renderer) EdgeRenderer(fromID, toID string, edge graph.Edge, w io.Writer) (bool, error)

func (Renderer) NodeRenderer

func (r Renderer) NodeRenderer(ID string, node graph.Node, wr io.Writer) (bool, error)

func (Renderer) Render

func (r Renderer) Render(g graph.Graph, graphName string, out io.Writer) error

type TableCellOptions

type TableCellOptions struct {
	Align       HorizontalAlignment `dot:"ALIGN"`
	Balign      HorizontalAlignment `dot:"BALIGN"`
	BGColor     string              `dot:"BGCOLOR"`
	Border      string              `dot:"BORDER"`
	CellPadding string              `dot:"CELLPADDING"`
	CellSpacing string              `dot:"CELLSPACING"`
	Color       string              `dot:"COLOR"`
	ColSpan     int                 `dot:"COLSPAN"`
	HRef        string              `dot:"HREF"`
	Port        string              `dot:"PORT"`
	RowSpan     int                 `dot:"ROWSPAN"`
	Style       string              `dot:"STYLE"`
	Target      string              `dot:"TARGET"`
	Valign      VerticalAlignment   `dot:"VALIGN"`
	Font        FontConfig
}

func (TableCellOptions) String

func (t TableCellOptions) String() string

type TableOptions

type TableOptions struct {
	Align       HorizontalAlignment `dot:"ALIGN"`
	BGColor     string              `dot:"BGCOLOR"`
	Border      string              `dot:"BORDER"`
	CellBorder  string              `dot:"CELLBORDER"`
	CellPadding string              `dot:"CELLPADDING"`
	CellSpacing string              `dot:"CELLSPACING"`
	Color       string              `dot:"COLOR"`
	Columns     int                 `dot:"COLUMNS"`
	HRef        string              `dot:"HREF"`
	ID          string              `dot:"ID"`
	Port        string              `dot:"PORT"`
	Rows        int                 `dot:"ROWS"`
	Sides       int                 `dot:"SIDES"`
	Style       string              `dot:"STYLE"`
	Target      string              `dot:"TARGET"`
	Title       string              `dot:"TITLE"`
	Valign      VerticalAlignment   `dot:"VALIGN"`
}

func (TableOptions) String

func (t TableOptions) String() string

type VerticalAlignment

type VerticalAlignment string

Jump to

Keyboard shortcuts

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