graphics

package
v0.0.0-...-54b116d Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const Inf = 1e6

Variables

This section is empty.

Functions

This section is empty.

Types

type Arc

type Arc struct{}

type Axis

type Axis []f32.Point

func (Axis) Layout

func (a Axis) Layout(bbox f32.Rectangle, gtx *layout.Context)

type Box

type Box f32.Rectangle

func (Box) Height

func (b Box) Height() (h float32)

func (Box) Width

func (b Box) Width() (w float32)

type CMYKColor

type CMYKColor struct{}

type Canvas

type Canvas struct {
	Width, Height float32
}

type Circle

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

func (Circle) BoundingBox

func (c Circle) BoundingBox() (bbox f32.Rectangle)

func (Circle) Draw

func (c Circle) Draw(ctx *context, gtx *layout.Context)

type ContinuousSeries

type ContinuousSeries struct {
	Style Style

	XValues []float32
	YValues []float32
}

type Directive

type Directive interface {
	Set(style *Style)
}

type Ellipse

type Ellipse struct{}

type Graphics

type Graphics struct {
	BBox f32.Rectangle
	// contains filtered or unexported fields
}

func FromEx

func FromEx(expr *atoms.Expression, st *Style) (*Graphics, error)

func (*Graphics) Dimensions

func (g *Graphics) Dimensions(gtx *layout.Context, s style.Style) layout.Dimensions

func (*Graphics) Layout

func (g *Graphics) Layout(gtx *layout.Context, s style.Style)

type Line

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

func (Line) BoundingBox

func (l Line) BoundingBox() (bb f32.Rectangle)

func (Line) Draw

func (l Line) Draw(ctx *context, gtx *layout.Context)

type Options

type Options struct {
	Axis bool
}

type Primitive

type Primitive interface {
	Draw(ctx *context, gtx *layout.Context)
	BoundingBox() (bbox f32.Rectangle)
}

type RGBColor

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

func (RGBColor) BoundingBox

func (c RGBColor) BoundingBox() (bbox f32.Rectangle)

func (RGBColor) Draw

func (c RGBColor) Draw(ctx *context, gtx *layout.Context)

type Rectangle

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

func (Rectangle) BoundingBox

func (r Rectangle) BoundingBox() (bbox f32.Rectangle)

func (Rectangle) Draw

func (r Rectangle) Draw(ctx *context, gtx *layout.Context)

type Style

type Style struct {
	Shaper    *text.Shaper
	Font      text.Font
	TextColor color.RGBA
	TextSize  unit.Value

	StrokeWidth float32
	StrokeColor *color.RGBA

	Thickness float32
}

func NewStyle

func NewStyle() *Style

type Tag

type Tag struct {
	// Alignment specify the text alignment.
	Alignment text.Alignment
	// MaxLines limits the number of lines. Zero means no limit.
	MaxLines int
	MaxWidth int
}

func (Tag) Layout

func (l Tag) Layout(gtx *layout.Context, st *Style, txt string)

type Thickness

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

func (Thickness) Set

func (t Thickness) Set(style *Style)

type Triangle

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

func (Triangle) BoundingBox

func (r Triangle) BoundingBox() (bbox f32.Rectangle)

func (Triangle) Draw

func (t Triangle) Draw(ctx *context, gtx *layout.Context)

Jump to

Keyboard shortcuts

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