svgf

package
v0.0.0-...-61f9cfd Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Painter

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

Painter is a Geometric Visitor that renders SVG documents It translates the Zenna coordinate system (Y=up) to that of SVG (Y=down)

func NewSVGPainter

func NewSVGPainter(style string, canvas *svg.SVG) Painter

func (Painter) Paint

func (p Painter) Paint(g Geometric)

func (*Painter) Style

func (p *Painter) Style(newStyle string)

func (Painter) VisitCircle

func (p Painter) VisitCircle(c Circle)

func (Painter) VisitEllipse

func (p Painter) VisitEllipse(e Ellipse)

VisitEllipse is part of Visitor

func (Painter) VisitGroup

func (p Painter) VisitGroup(s Group)

func (Painter) VisitImage

func (p Painter) VisitImage(i Image)

func (Painter) VisitLineSegment

func (p Painter) VisitLineSegment(l LineSegment)

func (Painter) VisitPolygon

func (p Painter) VisitPolygon(poly Polygon)

func (Painter) VisitRectangle

func (p Painter) VisitRectangle(r Rectangle)

func (Painter) VisitRotate

func (p Painter) VisitRotate(r Rotate)

func (Painter) VisitRoundedRectangle

func (p Painter) VisitRoundedRectangle(r RoundedRectangle)

func (Painter) VisitScale

func (p Painter) VisitScale(s Scale)

func (Painter) VisitStyle

func (p Painter) VisitStyle(s Style)

func (Painter) VisitText

func (p Painter) VisitText(t Text)

func (Painter) VisitTranslate

func (p Painter) VisitTranslate(t Translate)

type SVGF

type SVGF struct {
	*svg.SVG
}

func (*SVGF) Circle

func (svgf *SVGF) Circle(x float64, y float64, r float64, s ...string)

Circle centered at x,y, with radius r, with optional style. Standard Reference: http://www.w3.org/TR/SVG11/shapes.html#CircleElement

func (*SVGF) Image

func (svgf *SVGF) Image(xc, yc float64, w, h float64, href, s string)

Image places at x,y (upper left hand corner), the image with width w, and height h, referenced at link, with optional style. Standard Reference: http://www.w3.org/TR/SVG11/struct.html#ImageElement

func (*SVGF) Line

func (svgf *SVGF) Line(x1 float64, y1 float64, x2 float64, y2 float64, s ...string)

Line draws a straight line between two points, with optional style. Standard Reference: http://www.w3.org/TR/SVG11/shapes.html#LineElement

func (*SVGF) Polygon

func (svgf *SVGF) Polygon(x []float64, y []float64, s ...string)

Polygon draws a series of line segments using an array of x, y coordinates, with optional style. Standard Reference: http://www.w3.org/TR/SVG11/shapes.html#PolygonElement

Jump to

Keyboard shortcuts

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