Documentation
¶
Index ¶
- Constants
- Variables
- func Float32(v interface{}) float32
- type Canvas
- type CanvasElement
- type CanvasGroup
- type CanvasPath
- type CanvasStyle
- type CanvasText
- type CanvasTransform
- type Color
- type CompareFunc
- type DOMOption
- type DOMValidateNodeFunc
- type Document
- type Error
- type FillRule
- type IteratorFunc
- type Labels
- type LineCap
- type LineJoin
- type Node
- type Point
- type Points
- type Scale
- type Series
- type SeriesIteratorFunc
- type Set
- type Size
- type Table
- type TableCellFlag
- type TableCol
- type TableOpt
- type TextAlign
- type TransformFunc
- type Type
- type Unit
- type Values
- type Viz
- type VizGroup
- type Writer
Constants ¶
View Source
const ( XmlNamespaceSVG = "http://www.w3.org/2000/svg" // Scalable Vector Graphics XmlNamespaceXLink = "http://www.w3.org/1999/xlink" // XLink XmlNamespaceXHTML = "http://www.w3.org/1999/xhtml" // XHTML )
View Source
const ( BorderDefault = "+++++++++|-" BorderLines = "┌┬┐├┼┤└┴┘│─" )
Variables ¶
Functions ¶
Types ¶
type CanvasElement ¶
type CanvasElement interface {
Id(string) CanvasElement
Class(string) CanvasElement
Style(...CanvasStyle) CanvasElement
Transform(...CanvasTransform) CanvasElement
}
type CanvasGroup ¶
type CanvasGroup interface {
CanvasElement
Desc(string) CanvasGroup
Group(...CanvasElement) CanvasGroup
}
type CanvasPath ¶
type CanvasPath interface {
CanvasElement
MoveTo(Point) CanvasPath
LineTo(Point) CanvasPath
QuadraticTo(pt, c Point) CanvasPath
CubicTo(pt, c1, c2 Point) CanvasPath
ClosePath() CanvasPath
}
type CanvasStyle ¶
type CanvasStyle interface{}
type CanvasText ¶
type CanvasText interface{}
type CanvasTransform ¶
type CanvasTransform interface{}
type Color ¶
type Color struct {
R, G, B uint8
}
Color represents an 24-bit RGB colour without opacity
type CompareFunc ¶
type CompareFunc func(a, b []interface{}) bool
type DOMValidateNodeFunc ¶
type IteratorFunc ¶
type Node ¶
type Node interface {
Name() xml.Name
Cdata() string
Parent() Node
GetElementsByTagName(string) []Node
GetElementsByTagNameNS(string, string) []Node
Children() []Node
AddChild(Node) error
RemoveChild(Node) error
FirstChild() Node
LastChild() Node
InsertChildBefore(Node, Node) error
RemoveAllChildren() error
Attrs() []xml.Attr
Attr(string) (xml.Attr, bool)
AttrNS(string, string) (xml.Attr, bool)
SetAttr(string, string) error
SetAttrNS(string, string, string) error
}
type Scale ¶
type Scale interface {
// Return name associated with the scale
Name() string
// Return minimum represented value on scale
Min() float32
// Return maximum represented value on scale
Max() float32
// Write scale to canvas
WritePath(Canvas) CanvasGroup
}
Scale is an X or Y scale (currently linear) which can represent all values
type Series ¶
type Series interface {
// Read series from a table, the iterator function can return
// ErrSkipTransform if a returned values can be discarded. The
// values returned should be float32, data.Point or string
// which respectively appends Values, Points and Labels
Read(Table, SeriesIteratorFunc) error
// Sets returns sets contained with the series
Sets() []Set
}
type SeriesIteratorFunc ¶
type Table ¶
type Table interface {
// Read CSV data with table options
Read(io.Reader, ...TableOpt) error
// Write data with table options
Write(io.Writer, ...TableOpt) error
// Append a row to the table
Append(...interface{})
// Len returns the number of rows
Len() int
// Row returns values for a zero-indexed table row
// or nil if the row does not exist
Row(int) []interface{}
// Col returns column information for a zero-indexed table column
// or nil if the column doesn't exist
Col(int) TableCol
// Sort sorts the rows using a comparison function, which should return
// true if the first argument is less than the second argument
Sort(CompareFunc)
// OptHeader used on Read to indicate there is a CSV header and
// with Write to output header in addition to data. Ignored for
// ForMap and ForArray
OptHeader() TableOpt
// OptTransform used on Read, or Write transforms a value.
// Several transform functions can be used in series on a value.
// Transformation functions are called in series until nil or
// error returned. If ErrSkipTransform is returned, the next
// transformation is tried
OptTransform(...TransformFunc) TableOpt
// OptType used on Read to indicate transformation of values into
// native types. If a type cannot be transformed, string is used.
// Use "DefaultTypes" for all types, and "Nil" to interpret empty strings
// as nil values. For example:
//
// t := data.NewTable(data.ZeroSize)
// t.Read(os.Stdin,data.OptType(data.DefaultTypes|data.Nil))
//
OptType(Type) TableOpt
// OptAscii used on Write to output ASCII table instead of CSV. Option
// is ignored for Read. Arguments are maximum table width and the border
// characters (data.BorderDefault or data.BorderLines). Setting width
// to zero makes unconstrained width, setting string to empty sets default
// table line output
OptAscii(uint, string) TableOpt
// OptCsv used to Read or Write CSV files, with delimiter character, or if
// zero then comma is used
OptCsv(rune) TableOpt
// OptSql used to Write SQL format with the provided table name. The output
// can be directly ingested by SQLite. Including OptHeader() option will also
// include a statement to create the table
OptSql(string) TableOpt
// OptDuration used on Read to interpret values into durations (h,m,s,ms,ns)
// and truncate to the provided duration
OptDuration(time.Duration) TableOpt
// OptTimezone used on Read to set timezone for dates and times which do not
// include timezone explicitly. If timezone is nil, current local timezone is used.
OptTimezone(tz *time.Location) TableOpt
// OptRowIterator called on read before appending row to table. If error returned
// by iterator function is ErrSkipTransform then the row is not appended to the table
OptRowIterator(IteratorFunc) TableOpt
}
type TableCol ¶
type TableCol interface {
// Name returns the column name
Name() string
// Type returns the types that the column represents
Type() Type
// Min returns the minimum value of all column numbers or zero
Min() float64
// Max returns the maximum value of all column numbers or zero
Max() float64
// Sum returns the sum of all column numbers or zero
Sum() float64
// Count returns the count of all column numbers
Count() uint64
// Mean returns the mean average value of all column numbers
// or +Inf if no numbers in the column
Mean() float64
}
TableCol represents information about a table column
type TransformFunc ¶
type Type ¶
type Type uint
func (Type) FlagString ¶
type VizGroup ¶
type VizGroup interface {
CanvasGroup
}
Click to show internal directories.
Click to hide internal directories.