diff --git a/graphics.go b/graphics.go index 322584d..44359e4 100644 --- a/graphics.go +++ b/graphics.go @@ -667,7 +667,7 @@ func fillWedge(mg MinimalGraphics, xi, yi, ro, ri int, phi, psi, epsilon float64 } } -// GeenricRings draws wedges for pie/ring charts charts. The pie's/ring's center is at (x,y) +// GenericRings: draws wedges for pie/ring charts charts. The pie's/ring's center is at (x,y) // with ri and ro the inner and outer diameter. Eccentricity allows to correct for non-square // pixels (e.g. in text mode). func GenericRings(bg BasicGraphics, wedges []Wedgeinfo, x, y, ro, ri int, eccentricity float64) { diff --git a/stat.go b/stat.go index 1ba42c7..789e34e 100755 --- a/stat.go +++ b/stat.go @@ -5,7 +5,7 @@ import ( "sort" ) -// Return p percentil of pre-sorted integer data. 0 <= p <= 100. +// PercentilInt returns p percentil of pre-sorted integer data. 0 <= p <= 100. func PercentilInt(data []int, p int) int { n := len(data) if n == 0 { @@ -57,7 +57,7 @@ func percentilFloat64(data []float64, p int) float64 { return val } -// Compute minimum, p percentil, median, average, 100-p percentil and maximum of values in data. +// SixvalInt: Compute minimum, p percentil, median, average, 100-p percentil and maximum of values in data. func SixvalInt(data []int, p int) (min, lq, med, avg, uq, max int) { min, max = math.MaxInt32, math.MinInt32 sum, n := 0, len(data) @@ -98,7 +98,7 @@ func SixvalInt(data []int, p int) (min, lq, med, avg, uq, max int) { return } -// Compute minimum, p percentil, median, average, 100-p percentil and maximum of values in data. +// SixvalFloat64: Compute minimum, p percentil, median, average, 100-p percentil and maximum of values in data. func SixvalFloat64(data []float64, p int) (min, lq, med, avg, uq, max float64) { n := len(data) diff --git a/txtg/buf.go b/txtg/buf.go index 87ce750..0754b3e 100644 --- a/txtg/buf.go +++ b/txtg/buf.go @@ -13,7 +13,7 @@ type TextBuf struct { W, H int // Width and Height } -// Set up a new TextBuf with width w and height h. +// NewTextBuf: Set up a new TextBuf with width w and height h. func NewTextBuf(w, h int) (tb *TextBuf) { tb = new(TextBuf) tb.W, tb.H = w, h @@ -38,7 +38,7 @@ func (tb *TextBuf) Put(x, y int, c rune) { tb.Buf[i] = c } -// Draw rectangle of width w and height h from corner at (x,y). +// Rect: Draw rectangle of width w and height h from corner at (x,y). // Use one of the corner style defined in Edge. // Interior is filled with charater fill iff != 0. func (tb *TextBuf) Rect(x, y, w, h int, style int, fill rune) { @@ -88,7 +88,7 @@ func (tb *TextBuf) Block(x, y, w, h int, fill rune) { } } -// Return real character len of s (rune count). +// StrLen returns real character len of s (rune count). func StrLen(s string) (n int) { for _, _ = range s { n++ @@ -96,7 +96,7 @@ func StrLen(s string) (n int) { return } -// Print text txt at (x,y). Horizontal display for align in [-1,1], +// Text: Print text txt at (x,y). Horizontal display for align in [-1,1], // vasrtical alignment for align in [2,4] // align: -1: left; 0: centered; 1: right; 2: top, 3: center, 4: bottom func (tb *TextBuf) Text(x, y int, txt string, align int) { @@ -178,7 +178,7 @@ func (tb *TextBuf) Line(x0, y0, x1, y1 int, symbol rune) { } } -// Convert to plain (utf8) string. +// String: Convert to plain (utf8) string. func (tb *TextBuf) String() string { return string(tb.Buf) }