Documentation ¶
Index ¶
- type CircleConfig
- type GridConfig
- func (g *GridConfig) GetBackgroundColor() color.Color
- func (g *GridConfig) GetBorderColor() color.Color
- func (g *GridConfig) GetBorderDashes() float64
- func (g *GridConfig) GetBorderStrokeWidth() float64
- func (g *GridConfig) GetColumns() int
- func (g *GridConfig) GetHeight(imageHeight int) int
- func (g *GridConfig) GetLineColor() color.Color
- func (g *GridConfig) GetLineDashes() float64
- func (g *GridConfig) GetLineStrokeWidth() float64
- func (g *GridConfig) GetMarginWidth() int
- func (g *GridConfig) GetRows() int
- func (g *GridConfig) GetWidth(imageWidth int) int
- type Gridder
- func (g *Gridder) DrawCircle(row int, column int, circleConfigs ...CircleConfig) error
- func (g *Gridder) DrawLine(row int, column int, lineConfigs ...LineConfig) error
- func (g *Gridder) DrawPath(row1 int, column1 int, row2 int, column2 int, pathConfigs ...PathConfig) error
- func (g *Gridder) DrawRectangle(row int, column int, rectangleConfigs ...RectangleConfig) error
- func (g *Gridder) DrawString(row int, column int, text string, fontFace font.Face, ...) error
- func (g *Gridder) DrawStringDirect(row int, column int, text string, stringConfigs ...StringConfig) error
- func (g *Gridder) EncodePNG(w io.Writer) error
- func (g *Gridder) MeasureString(s string) (w, h float64)
- func (g *Gridder) PaintCell(row int, column int, color color.Color) error
- func (g *Gridder) SaveJPG(quality int) error
- func (g *Gridder) SavePNG() error
- func (g *Gridder) SetFontFace(fontFace font.Face)
- type ImageConfig
- type LineConfig
- type PathConfig
- type RectangleConfig
- func (g *RectangleConfig) GetColor() color.Color
- func (g *RectangleConfig) GetDashes() float64
- func (g *RectangleConfig) GetHeight() float64
- func (g *RectangleConfig) GetRotate() float64
- func (g *RectangleConfig) GetStrokeWidth() float64
- func (g *RectangleConfig) GetWidth() float64
- func (g *RectangleConfig) IsStroke() bool
- type StringConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CircleConfig ¶
type CircleConfig struct { Radius float64 Color color.Color Dashes float64 Stroke bool StrokeWidth float64 }
CircleConfig Grid Circle Configuration
func (*CircleConfig) GetStrokeWidth ¶
func (g *CircleConfig) GetStrokeWidth() float64
GetStrokeWidth gets stroke width
func (*CircleConfig) IsStroke ¶
func (g *CircleConfig) IsStroke() bool
IsStroke determines if Stroke or Fill
type GridConfig ¶
type GridConfig struct { Rows int Columns int MarginWidth int LineDashes float64 LineStrokeWidth float64 BorderDashes float64 BorderStrokeWidth float64 LineColor color.Color BorderColor color.Color BackgroundColor color.Color }
GridConfig Grid Configuration
func (*GridConfig) GetBackgroundColor ¶
func (g *GridConfig) GetBackgroundColor() color.Color
GetBackgroundColor gets background color
func (*GridConfig) GetBorderColor ¶
func (g *GridConfig) GetBorderColor() color.Color
GetBorderColor gets border color
func (*GridConfig) GetBorderDashes ¶
func (g *GridConfig) GetBorderDashes() float64
GetBorderDashes gets border dashes
func (*GridConfig) GetBorderStrokeWidth ¶
func (g *GridConfig) GetBorderStrokeWidth() float64
GetBorderStrokeWidth gets border stroke width
func (*GridConfig) GetHeight ¶
func (g *GridConfig) GetHeight(imageHeight int) int
GetHeight gets grid height
func (*GridConfig) GetLineColor ¶
func (g *GridConfig) GetLineColor() color.Color
GetLineColor gets line color
func (*GridConfig) GetLineDashes ¶
func (g *GridConfig) GetLineDashes() float64
GetLineDashes gets line dashes
func (*GridConfig) GetLineStrokeWidth ¶
func (g *GridConfig) GetLineStrokeWidth() float64
GetLineStrokeWidth gets line stroke width
func (*GridConfig) GetMarginWidth ¶
func (g *GridConfig) GetMarginWidth() int
GetMarginWidth gets margin width
func (*GridConfig) GetWidth ¶
func (g *GridConfig) GetWidth(imageWidth int) int
GetWidth gets grid width
type Gridder ¶
type Gridder struct {
// contains filtered or unexported fields
}
Gridder gridder structure
func New ¶
func New(imageConfig ImageConfig, gridConfig GridConfig) (*Gridder, error)
New creates a new gridder and sets it up with its configuration
func (*Gridder) DrawCircle ¶
func (g *Gridder) DrawCircle(row int, column int, circleConfigs ...CircleConfig) error
DrawCircle draws a circle in a cell
func (*Gridder) DrawLine ¶
func (g *Gridder) DrawLine(row int, column int, lineConfigs ...LineConfig) error
DrawLine draws a line in a cell
func (*Gridder) DrawPath ¶
func (g *Gridder) DrawPath(row1 int, column1 int, row2 int, column2 int, pathConfigs ...PathConfig) error
DrawPath draws a path between two cells
func (*Gridder) DrawRectangle ¶
func (g *Gridder) DrawRectangle(row int, column int, rectangleConfigs ...RectangleConfig) error
DrawRectangle draws a rectangle in a cell
func (*Gridder) DrawString ¶
func (g *Gridder) DrawString(row int, column int, text string, fontFace font.Face, stringConfigs ...StringConfig) error
DrawString draws a string in a cell
func (*Gridder) DrawStringDirect ¶
func (g *Gridder) DrawStringDirect(row int, column int, text string, stringConfigs ...StringConfig) error
DrawString draws a string in a cell
func (*Gridder) EncodePNG ¶
EncodePNG encodes the image as a PNG and writes it to the provided io.Writer.
func (*Gridder) MeasureString ¶
func (*Gridder) SetFontFace ¶
type ImageConfig ¶
ImageConfig Grid Configuration
type LineConfig ¶
type LineConfig struct { Length float64 Rotate float64 StrokeWidth float64 Dashes float64 Color color.Color }
LineConfig Line Configuration
func (*LineConfig) GetStrokeWidth ¶
func (g *LineConfig) GetStrokeWidth() float64
GetStrokeWidth gets stroke width
type PathConfig ¶
PathConfig Path Configuration
func (*PathConfig) GetStrokeWidth ¶
func (g *PathConfig) GetStrokeWidth() float64
GetStrokeWidth gets stroke width
type RectangleConfig ¶
type RectangleConfig struct { Width float64 Height float64 Rotate float64 Dashes float64 Color color.Color Stroke bool StrokeWidth float64 }
RectangleConfig Rectangle Configuration
func (*RectangleConfig) GetColor ¶
func (g *RectangleConfig) GetColor() color.Color
GetColor gets color
func (*RectangleConfig) GetDashes ¶
func (g *RectangleConfig) GetDashes() float64
GetDashes gets dashes
func (*RectangleConfig) GetHeight ¶
func (g *RectangleConfig) GetHeight() float64
GetHeight gets height
func (*RectangleConfig) GetRotate ¶
func (g *RectangleConfig) GetRotate() float64
GetRotate gets rotation
func (*RectangleConfig) GetStrokeWidth ¶
func (g *RectangleConfig) GetStrokeWidth() float64
GetStrokeWidth gets stroke width
func (*RectangleConfig) IsStroke ¶
func (g *RectangleConfig) IsStroke() bool
IsStroke determines if Stroke or Fill
type StringConfig ¶
StringConfig Grid String Configuration