plot: github.com/sksullivan/plot/vg/recorder Index | Files

package recorder

import "github.com/sksullivan/plot/vg/recorder"

Package recorder provides support for vector graphics serialization.

Index

Package Files

recorder.go

type Action Uses

type Action interface {
    Call() string
    ApplyTo(vg.Canvas)
    // contains filtered or unexported methods
}

Action is a vector graphics action as defined by the vg.Canvas interface. Each method of Canvas has a corresponding Action type.

type Canvas Uses

type Canvas struct {
    // Resolution holds the canvas resolution in DPI.
    Resolution float64

    // Actions holds a log of all methods called on
    // the canvas.
    Actions []Action

    // KeepCaller indicates whether the Canvas will
    // retain runtime caller location for the actions.
    // This includes source filename and line number.
    KeepCaller bool
    // contains filtered or unexported fields
}

Canvas implements vg.Canvas operation serialization.

func New Uses

func New(dpi float64) *Canvas

New returns a new Canvas with the specified resolution.

func NewFrom Uses

func NewFrom(c vg.Canvas) *Canvas

NewFrom returns a new Canvas from an existing vg.Canvas. vg.Canvas methods called on the Canvas will also be passed to the provided backing vg.Canvas. The Resolution field is set to the value returned by c.DPI.

func (*Canvas) Comment Uses

func (c *Canvas) Comment(text string)

Comment adds a comment to a list of Actions..

func (*Canvas) DPI Uses

func (c *Canvas) DPI() float64

DPI implements the DPI method of the vg.Canvas interface.

func (*Canvas) Fill Uses

func (c *Canvas) Fill(path vg.Path)

Fill implements the Fill method of the vg.Canvas interface.

func (*Canvas) FillString Uses

func (c *Canvas) FillString(font vg.Font, x, y vg.Length, str string)

FillString implements the FillString method of the vg.Canvas interface.

func (*Canvas) Pop Uses

func (c *Canvas) Pop()

Pop implements the Pop method of the vg.Canvas interface.

func (*Canvas) Push Uses

func (c *Canvas) Push()

Push implements the Push method of the vg.Canvas interface.

func (*Canvas) ReplayOn Uses

func (c *Canvas) ReplayOn(dst vg.Canvas) error

ReplayOn applies the set of Actions recorded by the Recorder onto the destination Canvas.

func (*Canvas) Reset Uses

func (c *Canvas) Reset()

Reset resets the Canvas to the base state.

func (*Canvas) Rotate Uses

func (c *Canvas) Rotate(a float64)

Rotate implements the Rotate method of the vg.Canvas interface.

func (*Canvas) Scale Uses

func (c *Canvas) Scale(x, y float64)

Scale implements the Scale method of the vg.Canvas interface.

func (*Canvas) SetColor Uses

func (c *Canvas) SetColor(col color.Color)

SetColor implements the SetColor method of the vg.Canvas interface.

func (*Canvas) SetLineDash Uses

func (c *Canvas) SetLineDash(dashes []vg.Length, offs vg.Length)

SetLineDash implements the SetLineDash method of the vg.Canvas interface.

func (*Canvas) SetLineWidth Uses

func (c *Canvas) SetLineWidth(w vg.Length)

SetLineWidth implements the SetLineWidth method of the vg.Canvas interface.

func (*Canvas) Stroke Uses

func (c *Canvas) Stroke(path vg.Path)

Stroke implements the Stroke method of the vg.Canvas interface.

func (*Canvas) Translate Uses

func (c *Canvas) Translate(x, y vg.Length)

Translate implements the Translate method of the vg.Canvas interface.

type Comment Uses

type Comment struct {
    Text string
    // contains filtered or unexported fields
}

Comment implements a Recorder comment mechanism.

func (*Comment) ApplyTo Uses

func (a *Comment) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*Comment) Call Uses

func (a *Comment) Call() string

Call returns the method call that generated the action.

type Commenter Uses

type Commenter interface {
    Comment(string)
}

Commenter defines types that can record comments.

type DPI Uses

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

DPI corresponds to the vg.Canvas.DPI method.

func (*DPI) ApplyTo Uses

func (a *DPI) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*DPI) Call Uses

func (a *DPI) Call() string

Call returns the method call that generated the action.

type Fill Uses

type Fill struct {
    Path vg.Path
    // contains filtered or unexported fields
}

Fill corresponds to the vg.Canvas.Fill method.

func (*Fill) ApplyTo Uses

func (a *Fill) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*Fill) Call Uses

func (a *Fill) Call() string

Call returns the method call that generated the action.

type FillString Uses

type FillString struct {
    Font   string
    Size   vg.Length
    X, Y   vg.Length
    String string
    // contains filtered or unexported fields
}

FillString corresponds to the vg.Canvas.FillString method.

func (*FillString) ApplyTo Uses

func (a *FillString) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*FillString) Call Uses

func (a *FillString) Call() string

Call returns the pseudo method call that generated the action.

type Pop Uses

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

Pop corresponds to the vg.Canvas.Pop method.

func (*Pop) ApplyTo Uses

func (a *Pop) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*Pop) Call Uses

func (a *Pop) Call() string

Call returns the method call that generated the action.

type Push Uses

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

Push corresponds to the vg.Canvas.Push method.

func (*Push) ApplyTo Uses

func (a *Push) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*Push) Call Uses

func (a *Push) Call() string

Call returns the method call that generated the action.

type Rotate Uses

type Rotate struct {
    Angle float64
    // contains filtered or unexported fields
}

Rotate corresponds to the vg.Canvas.Rotate method.

func (*Rotate) ApplyTo Uses

func (a *Rotate) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*Rotate) Call Uses

func (a *Rotate) Call() string

Call returns the method call that generated the action.

type Scale Uses

type Scale struct {
    X, Y float64
    // contains filtered or unexported fields
}

Scale corresponds to the vg.Canvas.Scale method.

func (*Scale) ApplyTo Uses

func (a *Scale) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*Scale) Call Uses

func (a *Scale) Call() string

Call returns the method call that generated the action.

type SetColor Uses

type SetColor struct {
    Color color.Color
    // contains filtered or unexported fields
}

SetColor corresponds to the vg.Canvas.SetColor method.

func (*SetColor) ApplyTo Uses

func (a *SetColor) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*SetColor) Call Uses

func (a *SetColor) Call() string

Call returns the method call that generated the action.

type SetLineDash Uses

type SetLineDash struct {
    Dashes  []vg.Length
    Offsets vg.Length
    // contains filtered or unexported fields
}

SetLineDash corresponds to the vg.Canvas.SetLineDash method.

func (*SetLineDash) ApplyTo Uses

func (a *SetLineDash) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*SetLineDash) Call Uses

func (a *SetLineDash) Call() string

Call returns the method call that generated the action.

type SetLineWidth Uses

type SetLineWidth struct {
    Width vg.Length
    // contains filtered or unexported fields
}

SetLineWidth corresponds to the vg.Canvas.SetWidth method.

func (*SetLineWidth) ApplyTo Uses

func (a *SetLineWidth) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*SetLineWidth) Call Uses

func (a *SetLineWidth) Call() string

Call returns the method call that generated the action.

type Stroke Uses

type Stroke struct {
    Path vg.Path
    // contains filtered or unexported fields
}

Stroke corresponds to the vg.Canvas.Stroke method.

func (*Stroke) ApplyTo Uses

func (a *Stroke) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*Stroke) Call Uses

func (a *Stroke) Call() string

Call returns the method call that generated the action.

type Translate Uses

type Translate struct {
    X, Y vg.Length
    // contains filtered or unexported fields
}

Translate corresponds to the vg.Canvas.Translate method.

func (*Translate) ApplyTo Uses

func (a *Translate) ApplyTo(c vg.Canvas)

ApplyTo applies the action to the given vg.Canvas.

func (*Translate) Call Uses

func (a *Translate) Call() string

Call returns the method call that generated the action.

Package recorder imports 4 packages (graph). Updated 2016-08-04. Refresh now. Tools for package owners. This is a quick bug-fix fork (has fewer than three commits, and only during the week it was created).