package
2.0.0-rc.3+incompatible
Repository: https://github.com/gotoolkit/go-chart.git
Documentation: pkg.go.dev

# README

go-chart > drawing

The bulk of the code in this package is based on draw2d, but with significant modifications to make the APIs more golang friendly and careful about units (points vs. pixels).

# Functions

Bresenham draws a line between (x0, y0) and (x1, y1).
ColorFromHex returns a color from a css hex code.
DrawContour draws the given closed contour at the given sub-pixel offset.
DrawImage draws an image into dest using an affine transformation matrix, an op and a filter.
Extents returns the FontExtents for a font.
Flatten convert curves into straight segments keeping join segments info.
NewDashVertexConverter creates a new dash converter.
NewIdentityMatrix creates an identity transformation matrix.
NewLineStroker creates a new line stroker.
NewMatrixFromRects creates a transformation matrix, combining a scale and a translation, that transform rectangle1 into rectangle2.
NewRasterGraphicContext creates a new Graphic context from an image.
NewRasterGraphicContextWithPainter creates a new Graphic context from an image and a Painter (see Freetype-go).
NewRotationMatrix creates a rotation transformation matrix.
NewScaleMatrix creates a transformation matrix with a sx, sy scale factor.
NewStackGraphicContext Create a new Graphic context from an image.
NewTranslationMatrix creates a transformation matrix with a translation tx and ty translation parameter.
PixelsToPoints returns the points for a given number of pixels at a DPI.
PointsToPixels returns the pixels for a given number of points at a DPI.
PolylineBresenham draws a polyline to an image.
SubdivideCubic a Bezier cubic curve in 2 equivalents Bezier cubic curves.
SubdivideQuad a Bezier quad curve in 2 equivalents Bezier quad curves.
TraceArc trace an arc using a Liner.
TraceCubic generate lines subdividing the cubic curve using a Liner flattening_threshold helps determines the flattening expectation of the curve.
TraceQuad generate lines subdividing the curve using a Liner flattening_threshold helps determines the flattening expectation of the curve.

# Constants

ArcToComponent is a ArcTo component in a Path.
BevelJoin represents cut segments joint.
BicubicFilter defines a bicubic filter.
BilinearFilter defines a bilinear filter.
ButtCap defines a squared shape exactly at the end of the line.
CloseComponent is a ArcTo component in a Path.
CubicCurveToComponent is a CubicCurveTo component in a Path.
CurveRecursionLimit represents the maximum recursion that is really necessary to subsivide a curve into straight lines.
DefaultDPI is the default image DPI.
FillRuleEvenOdd determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction and counting the number of path segments from the given shape that the ray crosses.
FillRuleWinding determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction and then examining the places where a segment of the shape crosses the ray.
HalignCenter Horizontally align to center.
HalignLeft Horizontally align to left.
HalignRight Horizontally align to right.
LinearFilter defines a linear filter.
LineToComponent is a LineTo component in a Path.
MiterJoin represents peaker segments joint.
MoveToComponent is a MoveTo component in a Path.
QuadCurveToComponent is a QuadCurveTo component in a Path.
RoundCap defines a rounded shape at the end of the line.
RoundJoin represents rounded segments joint.
ScalingFill the image is scaled to the smallest scale that allow the image to fully cover a rectangle width x height.
ScalingFit the image is scaled to the largest scale that allow the image to fit within a rectangle width x height.
ScalingHeight the image is scaled so that its height is exactly the given height.
ScalingNone no scaling applied.
ScalingSameArea the image is scaled so that its area is exactly the area of the given rectangle width x height.
ScalingStretch the image is stretched so that its width and height are exactly the given width and height.
ScalingWidth the image is scaled so that its width is exactly the given width.
SquareCap defines a squared shape at the end of the line.
ValignBaseline align text with the baseline of the font.
ValignBottom bottom aligned text.
ValignCenter centered text.
ValignTop top align text.

# Variables

ColorBlack is black.
ColorBlue is blue.
ColorGreen is green.
ColorRed is red.
ColorTransparent is a fully transparent color.
ColorWhite is white.

# Structs

Color is our internal color type because color.Color is bullshit.
ContextStack is a graphic context implementation.
DashVertexConverter is a converter for dash vertexes.
DemuxFlattener is a flattener.
FontExtents contains font metric information.
FtLineBuilder is a builder for freetype raster glyphs.
ImageScaling style attributes used to display the image.
LineStroker draws the stroke portion of a line.
Path stores points.
RasterGraphicContext is the implementation of GraphicContext for a raster image.
SegmentedPath is a path of disparate point sectinos.
SolidFillStyle define style attributes for a solid fill style.
StackGraphicContext is a context that does thngs.
StrokeStyle keeps stroke style attributes that is used by the Stroke method of a Drawer.
TextStyle describe text property.
Transformer apply the Matrix transformation tr.

# Interfaces

Flattener receive segment definition.
GraphicContext describes the interface for the various backends (images, pdf, opengl, ...).
Liner receive segment definition.
Painter implements the freetype raster.Painter and has a SetColor method like the RGBAPainter.
PathBuilder describes the interface for path drawing.

# Type aliases

FillRule defines the type for fill rules.
Halign Horizontal Alignment of the text.
ImageFilter defines the type of filter to use.
LineCap is the style of line extremities.
LineJoin is the style of segments joint.
Matrix represents an affine transformation.
PathComponent represents component of a path.
ScalingPolicy is a constant to define how to scale an image.
Valign Vertical Alignment of the text.