Documentation ¶
Index ¶
- Constants
- Variables
- type Canvas_Driver
- func (driver *Canvas_Driver) BeginPath(colour RGB_colour) error
- func (driver *Canvas_Driver) Close() error
- func (driver *Canvas_Driver) Comment(text string)
- func (driver *Canvas_Driver) EndPath() error
- func (driver *Canvas_Driver) GetDimensions() (width, heigth int64)
- func (driver *Canvas_Driver) GetFont() (fontFamily string, fontSize uint8)
- func (driver *Canvas_Driver) GetTextBox(text string) (width, height int64)
- func (driver *Canvas_Driver) Line(x1, y1, x2, y2 int64, colour RGB_colour) error
- func (driver *Canvas_Driver) Point(x, y int64, colour RGB_colour) error
- func (driver *Canvas_Driver) PointToPath(x, y int64) error
- func (driver *Canvas_Driver) SetDimensions(width int64, height int64) error
- func (driver *Canvas_Driver) SetFont(fontFamily string, fontSize uint8) error
- func (driver *Canvas_Driver) Text(x, y, angle int64, text string, colour RGB_colour) error
- type DriverPoint
- type Function_2d
- type GraphicsDriver
- type Image_Driver
- func (driver *Image_Driver) BeginPath(colour RGB_colour) error
- func (driver *Image_Driver) Close() error
- func (driver *Image_Driver) Comment(text string)
- func (driver *Image_Driver) EndPath() error
- func (driver *Image_Driver) GetDimensions() (width, heigth int64)
- func (driver *Image_Driver) GetFont() (fontFamily string, fontSize uint8)
- func (driver *Image_Driver) GetTextBox(text string) (width, height int64)
- func (driver *Image_Driver) Line(x1, y1, x2, y2 int64, colour RGB_colour) error
- func (driver *Image_Driver) Point(x, y int64, colour RGB_colour) error
- func (driver *Image_Driver) PointToPath(x, y int64) error
- func (driver *Image_Driver) SetDimensions(width int64, height int64) error
- func (driver *Image_Driver) SetFont(fontFamily string, fontSize uint8) error
- func (driver *Image_Driver) Text(x, y, angle int64, text string, colour RGB_colour) error
- type Plot
- type Plot_2D
- type Point_2d
- type RGB_colour
- type SVG_Driver
- func (driver *SVG_Driver) BeginPath(colour RGB_colour) error
- func (driver *SVG_Driver) Close() error
- func (driver *SVG_Driver) Comment(text string)
- func (driver *SVG_Driver) EndPath() error
- func (driver *SVG_Driver) GetDimensions() (width, heigth int64)
- func (driver *SVG_Driver) GetFont() (fontFamily string, fontSize uint8)
- func (driver *SVG_Driver) GetTextBox(text string) (width, height int64)
- func (driver *SVG_Driver) Line(x1, y1, x2, y2 int64, colour RGB_colour) error
- func (driver *SVG_Driver) Point(x, y int64, colour RGB_colour) error
- func (driver *SVG_Driver) PointToPath(x, y int64) error
- func (driver *SVG_Driver) SetDimensions(width int64, height int64) error
- func (driver *SVG_Driver) SetFont(fontFamily string, fontSize uint8) error
- func (driver *SVG_Driver) Text(x, y, angle int64, text string, colour RGB_colour) error
- type Set_points_2d
Constants ¶
const ( TERMINAL_CANVAS = 1 TERMINAL_GIF = 2 TERMINAL_JPEG = 3 TERMINAL_PNG = 4 TERMINAL_SVG = 5 )
terminals to generate a plot
const ( X_MARGINS float64 = 30 Y_MARGINS float64 = 30 )
margins in pixels for the plot
const ( BOXES uint8 = 1 DOTS uint8 = 2 LINES uint8 = 3 LINES_POINTS uint8 = 4 POINTS uint8 = 5 FUNCTION_PATH uint8 = 6 )
styles for a plot of points
const ( MIN_X_SCALE_DIVISIONS = 10 MAX_X_SCALE_DIVISIONS = 20 MIN_Y_SCALE_DIVISIONS = 10 MAX_Y_SCALE_DIVISIONS = 20 SCALE_WIDTH = 6 POINT_WIDTH = 8 COLOUR_TITLE_WIDTH = 10 TITLE_MARGIN = 10 )
const (
DEFAULT_STYLE = "points"
)
Variables ¶
var ( BLACK = RGB_colour{/* contains filtered or unexported fields */} RED = RGB_colour{/* contains filtered or unexported fields */} GREEN = RGB_colour{/* contains filtered or unexported fields */} BLUE = RGB_colour{/* contains filtered or unexported fields */} )
colour pallete for plots
var ( Style = map[string]uint8{ "boxes": BOXES, "dots": DOTS, "lines": LINES, "linespoints": LINES_POINTS, "points": POINTS, } )
style descriptions for a plot of points
Functions ¶
This section is empty.
Types ¶
type Canvas_Driver ¶
type Canvas_Driver struct {
// contains filtered or unexported fields
}
func (*Canvas_Driver) BeginPath ¶
func (driver *Canvas_Driver) BeginPath(colour RGB_colour) error
Begin a path to draw a connection between a set of points
func (*Canvas_Driver) Close ¶
func (driver *Canvas_Driver) Close() error
Close finalize the Canvas graphic
func (*Canvas_Driver) Comment ¶
func (driver *Canvas_Driver) Comment(text string)
Comment write a comment int the the SVG graphic
func (*Canvas_Driver) GetDimensions ¶
func (driver *Canvas_Driver) GetDimensions() (width, heigth int64)
GetDimensions get the dimensions of the SVG graphic
func (*Canvas_Driver) GetFont ¶
func (driver *Canvas_Driver) GetFont() (fontFamily string, fontSize uint8)
GetFont get information about the font
func (*Canvas_Driver) GetTextBox ¶
func (driver *Canvas_Driver) GetTextBox(text string) (width, height int64)
GetTextBox evaluate the width and height of the rectangle required to draw the text string using a given font size
func (*Canvas_Driver) Line ¶
func (driver *Canvas_Driver) Line(x1, y1, x2, y2 int64, colour RGB_colour) error
Line draws a line between two points in the SVG graphic
func (*Canvas_Driver) Point ¶
func (driver *Canvas_Driver) Point(x, y int64, colour RGB_colour) error
Point draws a point in the SVG graphic
func (*Canvas_Driver) PointToPath ¶
func (driver *Canvas_Driver) PointToPath(x, y int64) error
Add a point to a path
func (*Canvas_Driver) SetDimensions ¶
func (driver *Canvas_Driver) SetDimensions(width int64, height int64) error
SetDimensions set the dimensions of the Canvas graphic
func (*Canvas_Driver) SetFont ¶
func (driver *Canvas_Driver) SetFont(fontFamily string, fontSize uint8) error
SetFont set information about the font
func (*Canvas_Driver) Text ¶
func (driver *Canvas_Driver) Text(x, y, angle int64, text string, colour RGB_colour) error
Text writes a string to the specified point in the SVG graphic
type Function_2d ¶
type Function_2d struct { Title string Style uint8 Function string Min_x float64 Max_x float64 // contains filtered or unexported fields }
2D function
type GraphicsDriver ¶
type GraphicsDriver interface { GetDimensions() (width, heigth int64) SetDimensions(width int64, height int64) error GetFont() (fontFamily string, fontSize uint8) SetFont(fontFamily string, fontSize uint8) error Comment(text string) Point(x, y int64, colour RGB_colour) error BeginPath(colour RGB_colour) error PointToPath(x, y int64) error EndPath() error Line(x1, y1, x2, y2 int64, colour RGB_colour) error GetTextBox(text string) (width, height int64) Text(x, y, angle int64, text string, colour RGB_colour) error Close() error }
func NewCanvas_Driver ¶
func NewCanvas_Driver(writer *bufio.Writer) GraphicsDriver
NewCanvas_Driver create a new Canvas_Driver
func NewPNG_Driver ¶
func NewPNG_Driver(writer *bufio.Writer) GraphicsDriver
create a new PNG_Driver
func NewSVG_Driver ¶
func NewSVG_Driver(writer *bufio.Writer) GraphicsDriver
create a new SVG_Driver
type Image_Driver ¶
type Image_Driver struct {
// contains filtered or unexported fields
}
func (*Image_Driver) BeginPath ¶
func (driver *Image_Driver) BeginPath(colour RGB_colour) error
Begin a path to draw a connection between a set of points
func (*Image_Driver) Close ¶
func (driver *Image_Driver) Close() error
Close finalize the Image graphic
func (*Image_Driver) Comment ¶
func (driver *Image_Driver) Comment(text string)
Comment write a comment int the the Image graphic
func (*Image_Driver) GetDimensions ¶
func (driver *Image_Driver) GetDimensions() (width, heigth int64)
GetDimensions get the dimensions of the Image graphic
func (*Image_Driver) GetFont ¶
func (driver *Image_Driver) GetFont() (fontFamily string, fontSize uint8)
GetFont get information about the font
func (*Image_Driver) GetTextBox ¶
func (driver *Image_Driver) GetTextBox(text string) (width, height int64)
GetTextBox evaluate the width and height of the rectangle required to draw the text string using a given font size
func (*Image_Driver) Line ¶
func (driver *Image_Driver) Line(x1, y1, x2, y2 int64, colour RGB_colour) error
Line draws a line between two points in the Image graphic
func (*Image_Driver) Point ¶
func (driver *Image_Driver) Point(x, y int64, colour RGB_colour) error
Point draws a point in the Image graphic
func (*Image_Driver) PointToPath ¶
func (driver *Image_Driver) PointToPath(x, y int64) error
Add a point to a path
func (*Image_Driver) SetDimensions ¶
func (driver *Image_Driver) SetDimensions(width int64, height int64) error
SetDimensions set the dimensions of the Image graphic
func (*Image_Driver) SetFont ¶
func (driver *Image_Driver) SetFont(fontFamily string, fontSize uint8) error
SetFont set information about the font
func (*Image_Driver) Text ¶
func (driver *Image_Driver) Text(x, y, angle int64, text string, colour RGB_colour) error
Text writes a string to the specified point in the Image graphic
type Plot_2D ¶
type Plot_2D struct { X_label string Y_label string Set_points []Set_points_2d Function []Function_2d Width int64 Height int64 Terminal uint8 // contains filtered or unexported fields }
attributes used to describe a 2D plot
func (*Plot_2D) GeneratePlot ¶
GeneratePlot implementation of 2D Go_Plot generation
func (*Plot_2D) GetOutputFileName ¶
GetOutputFileName return the plot's output file name
type RGB_colour ¶
type RGB_colour struct {
// contains filtered or unexported fields
}
func (*RGB_colour) Hexa ¶
func (c *RGB_colour) Hexa() string
Hexa return the colour as a hexadecimal value
type SVG_Driver ¶
type SVG_Driver struct {
// contains filtered or unexported fields
}
func (*SVG_Driver) BeginPath ¶
func (driver *SVG_Driver) BeginPath(colour RGB_colour) error
Begin a path to draw a connection between a set of points
func (*SVG_Driver) Comment ¶
func (driver *SVG_Driver) Comment(text string)
Comment write a comment int the the SVG graphic
func (*SVG_Driver) GetDimensions ¶
func (driver *SVG_Driver) GetDimensions() (width, heigth int64)
GetDimensions get the dimensions of the SVG graphic
func (*SVG_Driver) GetFont ¶
func (driver *SVG_Driver) GetFont() (fontFamily string, fontSize uint8)
GetFont get information about the font
func (*SVG_Driver) GetTextBox ¶
func (driver *SVG_Driver) GetTextBox(text string) (width, height int64)
GetTextBox evaluate the width and height of the rectangle required to draw the text string using a given font size
func (*SVG_Driver) Line ¶
func (driver *SVG_Driver) Line(x1, y1, x2, y2 int64, colour RGB_colour) error
Line draws a line between two points in the SVG graphic
func (*SVG_Driver) Point ¶
func (driver *SVG_Driver) Point(x, y int64, colour RGB_colour) error
Point draws a point in the SVG graphic
func (*SVG_Driver) PointToPath ¶
func (driver *SVG_Driver) PointToPath(x, y int64) error
Add a point to a path
func (*SVG_Driver) SetDimensions ¶
func (driver *SVG_Driver) SetDimensions(width int64, height int64) error
SetDimensions set the dimensions of the SVG graphic
func (*SVG_Driver) SetFont ¶
func (driver *SVG_Driver) SetFont(fontFamily string, fontSize uint8) error
SetFont set information about the font
func (*SVG_Driver) Text ¶
func (driver *SVG_Driver) Text(x, y, angle int64, text string, colour RGB_colour) error
Text writes a string to the specified point in the SVG graphic
type Set_points_2d ¶
type Set_points_2d struct { Title string Style uint8 Point []Point_2d // contains filtered or unexported fields }
2D points list