Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion graphics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down
10 changes: 5 additions & 5 deletions txtg/buf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down Expand Up @@ -88,15 +88,15 @@ 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++
}
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) {
Expand Down Expand Up @@ -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)
}
Expand Down