Border.Label -> BorderLabel
This commit is contained in:
parent
23b25db083
commit
5915b71c94
@ -31,7 +31,7 @@ func main() {
|
|||||||
par2.Height = 5
|
par2.Height = 5
|
||||||
par2.Width = 37
|
par2.Width = 37
|
||||||
par2.Y = 0
|
par2.Y = 0
|
||||||
par2.Border.Label = "Keys"
|
par2.BorderLabel = "Keys"
|
||||||
par2.Border.FgColor = termui.ColorYellow
|
par2.Border.FgColor = termui.ColorYellow
|
||||||
tab1.AddBlocks(par2)
|
tab1.AddBlocks(par2)
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ func main() {
|
|||||||
bc := termui.NewBarChart()
|
bc := termui.NewBarChart()
|
||||||
data := []int{3, 2, 5, 3, 9, 5, 3, 2, 5, 8, 3, 2, 4, 5, 3, 2, 5, 7, 5, 3, 2, 6, 7, 4, 6, 3, 6, 7, 8, 3, 6, 4, 5, 3, 2, 4, 6, 4, 8, 5, 9, 4, 3, 6, 5, 3, 6}
|
data := []int{3, 2, 5, 3, 9, 5, 3, 2, 5, 8, 3, 2, 4, 5, 3, 2, 5, 7, 5, 3, 2, 6, 7, 4, 6, 3, 6, 7, 8, 3, 6, 4, 5, 3, 2, 4, 6, 4, 8, 5, 9, 4, 3, 6, 5, 3, 6}
|
||||||
bclabels := []string{"S0", "S1", "S2", "S3", "S4", "S5"}
|
bclabels := []string{"S0", "S1", "S2", "S3", "S4", "S5"}
|
||||||
bc.Border.Label = "Bar Chart"
|
bc.BorderLabel = "Bar Chart"
|
||||||
bc.Data = data
|
bc.Data = data
|
||||||
bc.Width = 26
|
bc.Width = 26
|
||||||
bc.Height = 10
|
bc.Height = 10
|
||||||
|
@ -23,12 +23,12 @@ func main() {
|
|||||||
p := ui.NewPar(":PRESS q TO QUIT DEMO")
|
p := ui.NewPar(":PRESS q TO QUIT DEMO")
|
||||||
p.Height = 3
|
p.Height = 3
|
||||||
p.Width = 50
|
p.Width = 50
|
||||||
p.Border.Label = "Text Box"
|
p.BorderLabel = "Text Box"
|
||||||
|
|
||||||
strs := []string{"[0] gizak/termui", "[1] editbox.go", "[2] iterrupt.go", "[3] keyboard.go", "[4] output.go", "[5] random_out.go", "[6] dashboard.go", "[7] nsf/termbox-go"}
|
strs := []string{"[0] gizak/termui", "[1] editbox.go", "[2] iterrupt.go", "[3] keyboard.go", "[4] output.go", "[5] random_out.go", "[6] dashboard.go", "[7] nsf/termbox-go"}
|
||||||
list := ui.NewList()
|
list := ui.NewList()
|
||||||
list.Items = strs
|
list.Items = strs
|
||||||
list.Border.Label = "List"
|
list.BorderLabel = "List"
|
||||||
list.Height = 7
|
list.Height = 7
|
||||||
list.Width = 25
|
list.Width = 25
|
||||||
list.Y = 4
|
list.Y = 4
|
||||||
@ -38,7 +38,7 @@ func main() {
|
|||||||
g.Width = 50
|
g.Width = 50
|
||||||
g.Height = 3
|
g.Height = 3
|
||||||
g.Y = 11
|
g.Y = 11
|
||||||
g.Border.Label = "Gauge"
|
g.BorderLabel = "Gauge"
|
||||||
|
|
||||||
spark := ui.NewSparkline()
|
spark := ui.NewSparkline()
|
||||||
spark.Title = "srv 0:"
|
spark.Title = "srv 0:"
|
||||||
@ -52,7 +52,7 @@ func main() {
|
|||||||
sp := ui.NewSparklines(spark, spark1)
|
sp := ui.NewSparklines(spark, spark1)
|
||||||
sp.Width = 25
|
sp.Width = 25
|
||||||
sp.Height = 7
|
sp.Height = 7
|
||||||
sp.Border.Label = "Sparkline"
|
sp.BorderLabel = "Sparkline"
|
||||||
sp.Y = 4
|
sp.Y = 4
|
||||||
sp.X = 25
|
sp.X = 25
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ func main() {
|
|||||||
return ps
|
return ps
|
||||||
})()
|
})()
|
||||||
|
|
||||||
lc.Border.Label = "Line Chart"
|
lc.BorderLabel = "Line Chart"
|
||||||
lc.Data = sinps
|
lc.Data = sinps
|
||||||
lc.Width = 50
|
lc.Width = 50
|
||||||
lc.Height = 11
|
lc.Height = 11
|
||||||
@ -77,7 +77,7 @@ func main() {
|
|||||||
bc := ui.NewBarChart()
|
bc := ui.NewBarChart()
|
||||||
bcdata := []int{3, 2, 5, 3, 9, 5, 3, 2, 5, 8, 3, 2, 4, 5, 3, 2, 5, 7, 5, 3, 2, 6, 7, 4, 6, 3, 6, 7, 8, 3, 6, 4, 5, 3, 2, 4, 6, 4, 8, 5, 9, 4, 3, 6, 5, 3, 6}
|
bcdata := []int{3, 2, 5, 3, 9, 5, 3, 2, 5, 8, 3, 2, 4, 5, 3, 2, 5, 7, 5, 3, 2, 6, 7, 4, 6, 3, 6, 7, 8, 3, 6, 4, 5, 3, 2, 4, 6, 4, 8, 5, 9, 4, 3, 6, 5, 3, 6}
|
||||||
bclabels := []string{"S0", "S1", "S2", "S3", "S4", "S5"}
|
bclabels := []string{"S0", "S1", "S2", "S3", "S4", "S5"}
|
||||||
bc.Border.Label = "Bar Chart"
|
bc.BorderLabel = "Bar Chart"
|
||||||
bc.Width = 26
|
bc.Width = 26
|
||||||
bc.Height = 10
|
bc.Height = 10
|
||||||
bc.X = 51
|
bc.X = 51
|
||||||
@ -85,7 +85,7 @@ func main() {
|
|||||||
bc.DataLabels = bclabels
|
bc.DataLabels = bclabels
|
||||||
|
|
||||||
lc1 := ui.NewLineChart()
|
lc1 := ui.NewLineChart()
|
||||||
lc1.Border.Label = "Line Chart"
|
lc1.BorderLabel = "Line Chart"
|
||||||
rndwalk := (func() []float64 {
|
rndwalk := (func() []float64 {
|
||||||
n := 150
|
n := 150
|
||||||
d := make([]float64, n)
|
d := make([]float64, n)
|
||||||
|
@ -212,7 +212,7 @@ func NewCpuTabElems(width int) *CpuTabElems {
|
|||||||
lc.Height = 12
|
lc.Height = 12
|
||||||
lc.X = 0
|
lc.X = 0
|
||||||
lc.Mode = "dot"
|
lc.Mode = "dot"
|
||||||
lc.Border.Label = "CPU"
|
lc.BorderLabel = "CPU"
|
||||||
return &CpuTabElems{GMap: make(map[string]*termui.Gauge),
|
return &CpuTabElems{GMap: make(map[string]*termui.Gauge),
|
||||||
LChart: lc}
|
LChart: lc}
|
||||||
}
|
}
|
||||||
@ -222,7 +222,7 @@ func (cte *CpuTabElems) AddGauge(key string, Y int, width int) *termui.Gauge {
|
|||||||
cte.GMap[key].Width = width
|
cte.GMap[key].Width = width
|
||||||
cte.GMap[key].Height = 3
|
cte.GMap[key].Height = 3
|
||||||
cte.GMap[key].Y = Y
|
cte.GMap[key].Y = Y
|
||||||
cte.GMap[key].Border.Label = key
|
cte.GMap[key].BorderLabel = key
|
||||||
cte.GMap[key].Percent = 0 //int(val.user + val.nice + val.system)
|
cte.GMap[key].Percent = 0 //int(val.user + val.nice + val.system)
|
||||||
return cte.GMap[key]
|
return cte.GMap[key]
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import "fmt"
|
|||||||
bc := termui.NewBarChart()
|
bc := termui.NewBarChart()
|
||||||
data := []int{3, 2, 5, 3, 9, 5}
|
data := []int{3, 2, 5, 3, 9, 5}
|
||||||
bclabels := []string{"S0", "S1", "S2", "S3", "S4", "S5"}
|
bclabels := []string{"S0", "S1", "S2", "S3", "S4", "S5"}
|
||||||
bc.Border.Label = "Bar Chart"
|
bc.BorderLabel = "Bar Chart"
|
||||||
bc.Data = data
|
bc.Data = data
|
||||||
bc.Width = 26
|
bc.Width = 26
|
||||||
bc.Height = 10
|
bc.Height = 10
|
||||||
|
2
gauge.go
2
gauge.go
@ -16,7 +16,7 @@ import (
|
|||||||
g.Percent = 40
|
g.Percent = 40
|
||||||
g.Width = 50
|
g.Width = 50
|
||||||
g.Height = 3
|
g.Height = 3
|
||||||
g.Border.Label = "Slim Gauge"
|
g.BorderLabel = "Slim Gauge"
|
||||||
g.BarColor = termui.ColorRed
|
g.BarColor = termui.ColorRed
|
||||||
g.PercentColor = termui.ColorBlue
|
g.PercentColor = termui.ColorBlue
|
||||||
*/
|
*/
|
||||||
|
@ -39,7 +39,7 @@ var rSingleBraille = [4]rune{'\u2880', '⠠', '⠐', '⠈'}
|
|||||||
// because one braille char can represent two data points.
|
// because one braille char can represent two data points.
|
||||||
/*
|
/*
|
||||||
lc := termui.NewLineChart()
|
lc := termui.NewLineChart()
|
||||||
lc.Border.Label = "braille-mode Line Chart"
|
lc.BorderLabel = "braille-mode Line Chart"
|
||||||
lc.Data = [1.2, 1.3, 1.5, 1.7, 1.5, 1.6, 1.8, 2.0]
|
lc.Data = [1.2, 1.3, 1.5, 1.7, 1.5, 1.6, 1.8, 2.0]
|
||||||
lc.Width = 50
|
lc.Width = 50
|
||||||
lc.Height = 12
|
lc.Height = 12
|
||||||
|
2
list.go
2
list.go
@ -24,7 +24,7 @@ import "strings"
|
|||||||
ls := termui.NewList()
|
ls := termui.NewList()
|
||||||
ls.Items = strs
|
ls.Items = strs
|
||||||
ls.ItemFgColor = termui.ColorYellow
|
ls.ItemFgColor = termui.ColorYellow
|
||||||
ls.Border.Label = "List"
|
ls.BorderLabel = "List"
|
||||||
ls.Height = 7
|
ls.Height = 7
|
||||||
ls.Width = 25
|
ls.Width = 25
|
||||||
ls.Y = 0
|
ls.Y = 0
|
||||||
|
@ -16,7 +16,7 @@ import (
|
|||||||
data[0] := []int{3, 2, 5, 7, 9, 4}
|
data[0] := []int{3, 2, 5, 7, 9, 4}
|
||||||
data[1] := []int{7, 8, 5, 3, 1, 6}
|
data[1] := []int{7, 8, 5, 3, 1, 6}
|
||||||
bclabels := []string{"S0", "S1", "S2", "S3", "S4", "S5"}
|
bclabels := []string{"S0", "S1", "S2", "S3", "S4", "S5"}
|
||||||
bc.Border.Label = "Bar Chart"
|
bc.BorderLabel = "Bar Chart"
|
||||||
bc.Data = data
|
bc.Data = data
|
||||||
bc.Width = 26
|
bc.Width = 26
|
||||||
bc.Height = 10
|
bc.Height = 10
|
||||||
|
Loading…
Reference in New Issue
Block a user