dot

package
v0.0.0-...-8b2ea39 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultNodeStyleType is default style type.
	DefaultNodeStyleType = "rounded,filled,solid"
	// DefaultNodeShape is default node shape.
	DefaultNodeShape = "hexagon"
	// DefaultEdgeStyleType is default edge style.
	DefaultEdgeStyleType = ""
	// EdgeShape is default edge shape.
	DefaultEdgeShape = "normal"
	// UnknownShape is unknown shape.
	UnknownShape = "unknown"
)

Variables

View Source
var (
	// DefaultEdgeColor is default edge color.
	DefaultEdgeColor = color.RGBA{R: 0, G: 0, B: 0}
	// DefaultNodeColor is default color for unknown entity.
	DefaultNodeColor = color.RGBA{R: 230, G: 230, B: 230}
)

Functions

This section is empty.

Types

type Marshaler

type Marshaler struct {
	// contains filtered or unexported fields
}

Marshaler is used for marshaling graph to DOT format.

func NewMarshaler

func NewMarshaler(name, prefix, indent string, opts ...Option) (*Marshaler, error)

NewMarshaler creates a new DOT graph marshaler and returns it.

func (*Marshaler) Marshal

func (m *Marshaler) Marshal(g hypher.Graph) ([]byte, error)

Marshal marshal g into DOT and returns it.

type Option

type Option func(*Options)

Option is functional graph option.

func WithEdgeStyle

func WithEdgeStyle(s Style) Option

WithEdgeStyle sets Edge Style.

func WithGraphStyle

func WithGraphStyle(s Style) Option

WithGraphStyle sets Gra[h style.

func WithNodeStyle

func WithNodeStyle(s Style) Option

WithNodeStyle sets Node Style.

type Options

type Options struct {
	// NodeStyle configures Node style.
	NodeStyle Style
	// EdgeStyle configures Edge style.
	EdgeStyle Style
	// GraphStyle configures Graphe style.
	GraphStyle Style
}

Options configure graph.

type Style

type Style struct {
	// Type is style type.
	Type string
	// Shape is style shape.
	Shape string
	// Color is style color.
	Color color.RGBA
	// Attrs are style attributes
	Attrs map[string]any
}

Style defines styling.

func DefaultEdgeStyle

func DefaultEdgeStyle() Style

DefaultEdgeStyle returns default edge style

func DefaultGraphStyle

func DefaultGraphStyle() Style

DefaultGraphStyle returns default graph style.

func DefaultNodeStyle

func DefaultNodeStyle() Style

DefaultNodeStyle returns default node style

Jump to

Keyboard shortcuts

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