plotsvg

package
v0.0.0-...-6b31088 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: MIT Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

type Canvas struct {
	Style string
	// contains filtered or unexported fields
}

Canvas describes the top-level svg drawing context.

func New

func New(width, height plot.Length) *Canvas

New creates a new SVG canvas.

func (*Canvas) Bounds

func (svg *Canvas) Bounds() plot.Rect

Bounds returns the bounds in the global size.

func (*Canvas) Bytes

func (svg *Canvas) Bytes() []byte

Bytes returns svg context as a byte array.

func (*Canvas) Clip

func (svg *Canvas) Clip(r plot.Rect) plot.Canvas

Clip clips to rect.

func (*Canvas) Context

func (svg *Canvas) Context(r plot.Rect) plot.Canvas

context creates a subcontext bounded to r.

func (*Canvas) Layer

func (svg *Canvas) Layer(index int) plot.Canvas

Layer returns an layer above or below current state.

func (*Canvas) Poly

func (svg *Canvas) Poly(points []plot.Point, style *plot.Style)

Poly draws a polygon.

func (*Canvas) Rect

func (svg *Canvas) Rect(r plot.Rect, style *plot.Style)

Rect draws a rectangle.

func (*Canvas) Size

func (svg *Canvas) Size() plot.Point

Size returns the size of the context.

func (*Canvas) Text

func (svg *Canvas) Text(text string, at plot.Point, style *plot.Style)

Text draws text.

func (*Canvas) WriteTo

func (svg *Canvas) WriteTo(dst io.Writer) (n int64, err error)

WriteTo writes svg content to dst.

Jump to

Keyboard shortcuts

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