aboutsummaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/gizak/termui/example
diff options
context:
space:
mode:
Diffstat (limited to 'Godeps/_workspace/src/github.com/gizak/termui/example')
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/barchart.go35
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/barchart.pngbin15386 -> 0 bytes
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/dashboard.gifbin453764 -> 0 bytes
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/dashboard.go148
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/gauge.go62
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/gauge.pngbin32431 -> 0 bytes
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/grid.gifbin800288 -> 0 bytes
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/grid.go134
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/linechart.go68
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/linechart.pngbin139361 -> 0 bytes
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/list.go41
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/list.pngbin37227 -> 0 bytes
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/mbarchart.go50
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/mbarchart.pngbin20075 -> 0 bytes
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/par.go48
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/par.pngbin65773 -> 0 bytes
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/sparklines.go65
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/sparklines.pngbin43431 -> 0 bytes
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/theme.go143
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/themedefault.pngbin105508 -> 0 bytes
-rw-r--r--Godeps/_workspace/src/github.com/gizak/termui/example/themehelloworld.pngbin90111 -> 0 bytes
21 files changed, 0 insertions, 794 deletions
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/barchart.go b/Godeps/_workspace/src/github.com/gizak/termui/example/barchart.go
deleted file mode 100644
index 83947f580..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/barchart.go
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2015 Zack Guo <gizak@icloud.com>. All rights reserved.
-// Use of this source code is governed by a MIT license that can
-// be found in the LICENSE file.
-
-// +build ignore
-
-package main
-
-import "github.com/gizak/termui"
-
-func main() {
- err := termui.Init()
- if err != nil {
- panic(err)
- }
- defer termui.Close()
-
- termui.UseTheme("helloworld")
-
- 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}
- bclabels := []string{"S0", "S1", "S2", "S3", "S4", "S5"}
- bc.Border.Label = "Bar Chart"
- bc.Data = data
- bc.Width = 26
- bc.Height = 10
- bc.DataLabels = bclabels
- bc.TextColor = termui.ColorGreen
- bc.BarColor = termui.ColorRed
- bc.NumColor = termui.ColorYellow
-
- termui.Render(bc)
-
- <-termui.EventCh()
-}
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/barchart.png b/Godeps/_workspace/src/github.com/gizak/termui/example/barchart.png
deleted file mode 100644
index a37912f7f..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/barchart.png
+++ /dev/null
Binary files differ
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/dashboard.gif b/Godeps/_workspace/src/github.com/gizak/termui/example/dashboard.gif
deleted file mode 100644
index 8e1859c72..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/dashboard.gif
+++ /dev/null
Binary files differ
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/dashboard.go b/Godeps/_workspace/src/github.com/gizak/termui/example/dashboard.go
deleted file mode 100644
index c14bb4413..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/dashboard.go
+++ /dev/null
@@ -1,148 +0,0 @@
-// Copyright 2015 Zack Guo <gizak@icloud.com>. All rights reserved.
-// Use of this source code is governed by a MIT license that can
-// be found in the LICENSE file.
-
-// +build ignore
-
-package main
-
-import ui "github.com/gizak/termui"
-import "math"
-
-import "time"
-
-func main() {
- err := ui.Init()
- if err != nil {
- panic(err)
- }
- defer ui.Close()
-
- p := ui.NewPar(":PRESS q TO QUIT DEMO")
- p.Height = 3
- p.Width = 50
- p.TextFgColor = ui.ColorWhite
- p.Border.Label = "Text Box"
- p.Border.FgColor = ui.ColorCyan
-
- 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.Items = strs
- list.ItemFgColor = ui.ColorYellow
- list.Border.Label = "List"
- list.Height = 7
- list.Width = 25
- list.Y = 4
-
- g := ui.NewGauge()
- g.Percent = 50
- g.Width = 50
- g.Height = 3
- g.Y = 11
- g.Border.Label = "Gauge"
- g.BarColor = ui.ColorRed
- g.Border.FgColor = ui.ColorWhite
- g.Border.LabelFgColor = ui.ColorCyan
-
- spark := ui.Sparkline{}
- spark.Height = 1
- spark.Title = "srv 0:"
- spdata := []int{4, 2, 1, 6, 3, 9, 1, 4, 2, 15, 14, 9, 8, 6, 10, 13, 15, 12, 10, 5, 3, 6, 1, 7, 10, 10, 14, 13, 6, 4, 2, 1, 6, 3, 9, 1, 4, 2, 15, 14, 9, 8, 6, 10, 13, 15, 12, 10, 5, 3, 6, 1, 7, 10, 10, 14, 13, 6, 4, 2, 1, 6, 3, 9, 1, 4, 2, 15, 14, 9, 8, 6, 10, 13, 15, 12, 10, 5, 3, 6, 1, 7, 10, 10, 14, 13, 6, 4, 2, 1, 6, 3, 9, 1, 4, 2, 15, 14, 9, 8, 6, 10, 13, 15, 12, 10, 5, 3, 6, 1, 7, 10, 10, 14, 13, 6}
- spark.Data = spdata
- spark.LineColor = ui.ColorCyan
- spark.TitleColor = ui.ColorWhite
-
- spark1 := ui.Sparkline{}
- spark1.Height = 1
- spark1.Title = "srv 1:"
- spark1.Data = spdata
- spark1.TitleColor = ui.ColorWhite
- spark1.LineColor = ui.ColorRed
-
- sp := ui.NewSparklines(spark, spark1)
- sp.Width = 25
- sp.Height = 7
- sp.Border.Label = "Sparkline"
- sp.Y = 4
- sp.X = 25
-
- sinps := (func() []float64 {
- n := 220
- ps := make([]float64, n)
- for i := range ps {
- ps[i] = 1 + math.Sin(float64(i)/5)
- }
- return ps
- })()
-
- lc := ui.NewLineChart()
- lc.Border.Label = "dot-mode Line Chart"
- lc.Data = sinps
- lc.Width = 50
- lc.Height = 11
- lc.X = 0
- lc.Y = 14
- lc.AxesColor = ui.ColorWhite
- lc.LineColor = ui.ColorRed | ui.AttrBold
- lc.Mode = "dot"
-
- 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}
- bclabels := []string{"S0", "S1", "S2", "S3", "S4", "S5"}
- bc.Border.Label = "Bar Chart"
- bc.Width = 26
- bc.Height = 10
- bc.X = 51
- bc.Y = 0
- bc.DataLabels = bclabels
- bc.BarColor = ui.ColorGreen
- bc.NumColor = ui.ColorBlack
-
- lc1 := ui.NewLineChart()
- lc1.Border.Label = "braille-mode Line Chart"
- lc1.Data = sinps
- lc1.Width = 26
- lc1.Height = 11
- lc1.X = 51
- lc1.Y = 14
- lc1.AxesColor = ui.ColorWhite
- lc1.LineColor = ui.ColorYellow | ui.AttrBold
-
- p1 := ui.NewPar("Hey!\nI am a borderless block!")
- p1.HasBorder = false
- p1.Width = 26
- p1.Height = 2
- p1.TextFgColor = ui.ColorMagenta
- p1.X = 52
- p1.Y = 11
-
- draw := func(t int) {
- g.Percent = t % 101
- list.Items = strs[t%9:]
- sp.Lines[0].Data = spdata[:30+t%50]
- sp.Lines[1].Data = spdata[:35+t%50]
- lc.Data = sinps[t/2:]
- lc1.Data = sinps[2*t:]
- bc.Data = bcdata[t/2%10:]
- ui.Render(p, list, g, sp, lc, bc, lc1, p1)
- }
-
- evt := ui.EventCh()
-
- i := 0
- for {
- select {
- case e := <-evt:
- if e.Type == ui.EventKey && e.Ch == 'q' {
- return
- }
- default:
- draw(i)
- i++
- if i == 102 {
- return
- }
- time.Sleep(time.Second / 2)
- }
- }
-}
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/gauge.go b/Godeps/_workspace/src/github.com/gizak/termui/example/gauge.go
deleted file mode 100644
index b7033580f..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/gauge.go
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2015 Zack Guo <gizak@icloud.com>. All rights reserved.
-// Use of this source code is governed by a MIT license that can
-// be found in the LICENSE file.
-
-// +build ignore
-
-package main
-
-import "github.com/gizak/termui"
-
-func main() {
- err := termui.Init()
- if err != nil {
- panic(err)
- }
- defer termui.Close()
-
- termui.UseTheme("helloworld")
-
- g0 := termui.NewGauge()
- g0.Percent = 40
- g0.Width = 50
- g0.Height = 3
- g0.Border.Label = "Slim Gauge"
- g0.BarColor = termui.ColorRed
- g0.Border.FgColor = termui.ColorWhite
- g0.Border.LabelFgColor = termui.ColorCyan
-
- g2 := termui.NewGauge()
- g2.Percent = 60
- g2.Width = 50
- g2.Height = 3
- g2.PercentColor = termui.ColorBlue
- g2.Y = 3
- g2.Border.Label = "Slim Gauge"
- g2.BarColor = termui.ColorYellow
- g2.Border.FgColor = termui.ColorWhite
-
- g1 := termui.NewGauge()
- g1.Percent = 30
- g1.Width = 50
- g1.Height = 5
- g1.Y = 6
- g1.Border.Label = "Big Gauge"
- g1.PercentColor = termui.ColorYellow
- g1.BarColor = termui.ColorGreen
- g1.Border.FgColor = termui.ColorWhite
- g1.Border.LabelFgColor = termui.ColorMagenta
-
- g3 := termui.NewGauge()
- g3.Percent = 50
- g3.Width = 50
- g3.Height = 3
- g3.Y = 11
- g3.Border.Label = "Gauge with custom label"
- g3.Label = "{{percent}}% (100MBs free)"
- g3.LabelAlign = termui.AlignRight
-
- termui.Render(g0, g1, g2, g3)
-
- <-termui.EventCh()
-}
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/gauge.png b/Godeps/_workspace/src/github.com/gizak/termui/example/gauge.png
deleted file mode 100644
index 5c20e6e8a..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/gauge.png
+++ /dev/null
Binary files differ
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/grid.gif b/Godeps/_workspace/src/github.com/gizak/termui/example/grid.gif
deleted file mode 100644
index 7490043de..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/grid.gif
+++ /dev/null
Binary files differ
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/grid.go b/Godeps/_workspace/src/github.com/gizak/termui/example/grid.go
deleted file mode 100644
index 49121411f..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/grid.go
+++ /dev/null
@@ -1,134 +0,0 @@
-// Copyright 2015 Zack Guo <gizak@icloud.com>. All rights reserved.
-// Use of this source code is governed by a MIT license that can
-// be found in the LICENSE file.
-
-// +build ignore
-
-package main
-
-import ui "github.com/gizak/termui"
-import "math"
-import "time"
-
-func main() {
- err := ui.Init()
- if err != nil {
- panic(err)
- }
- defer ui.Close()
-
- sinps := (func() []float64 {
- n := 400
- ps := make([]float64, n)
- for i := range ps {
- ps[i] = 1 + math.Sin(float64(i)/5)
- }
- return ps
- })()
- sinpsint := (func() []int {
- ps := make([]int, len(sinps))
- for i, v := range sinps {
- ps[i] = int(100*v + 10)
- }
- return ps
- })()
-
- ui.UseTheme("helloworld")
-
- spark := ui.Sparkline{}
- spark.Height = 8
- spdata := sinpsint
- spark.Data = spdata[:100]
- spark.LineColor = ui.ColorCyan
- spark.TitleColor = ui.ColorWhite
-
- sp := ui.NewSparklines(spark)
- sp.Height = 11
- sp.Border.Label = "Sparkline"
-
- lc := ui.NewLineChart()
- lc.Border.Label = "braille-mode Line Chart"
- lc.Data = sinps
- lc.Height = 11
- lc.AxesColor = ui.ColorWhite
- lc.LineColor = ui.ColorYellow | ui.AttrBold
-
- gs := make([]*ui.Gauge, 3)
- for i := range gs {
- gs[i] = ui.NewGauge()
- gs[i].Height = 2
- gs[i].HasBorder = false
- gs[i].Percent = i * 10
- gs[i].PaddingBottom = 1
- gs[i].BarColor = ui.ColorRed
- }
-
- ls := ui.NewList()
- ls.HasBorder = false
- ls.Items = []string{
- "[1] Downloading File 1",
- "", // == \newline
- "[2] Downloading File 2",
- "",
- "[3] Uploading File 3",
- }
- ls.Height = 5
-
- par := ui.NewPar("<> This row has 3 columns\n<- Widgets can be stacked up like left side\n<- Stacked widgets are treated as a single widget")
- par.Height = 5
- par.Border.Label = "Demonstration"
-
- // build layout
- ui.Body.AddRows(
- ui.NewRow(
- ui.NewCol(6, 0, sp),
- ui.NewCol(6, 0, lc)),
- ui.NewRow(
- ui.NewCol(3, 0, ls),
- ui.NewCol(3, 0, gs[0], gs[1], gs[2]),
- ui.NewCol(6, 0, par)))
-
- // calculate layout
- ui.Body.Align()
-
- done := make(chan bool)
- redraw := make(chan bool)
-
- update := func() {
- for i := 0; i < 103; i++ {
- for _, g := range gs {
- g.Percent = (g.Percent + 3) % 100
- }
-
- sp.Lines[0].Data = spdata[:100+i]
- lc.Data = sinps[2*i:]
-
- time.Sleep(time.Second / 2)
- redraw <- true
- }
- done <- true
- }
-
- evt := ui.EventCh()
-
- ui.Render(ui.Body)
- go update()
-
- for {
- select {
- case e := <-evt:
- if e.Type == ui.EventKey && e.Ch == 'q' {
- return
- }
- if e.Type == ui.EventResize {
- ui.Body.Width = ui.TermWidth()
- ui.Body.Align()
- go func() { redraw <- true }()
- }
- case <-done:
- return
- case <-redraw:
- ui.Render(ui.Body)
- }
- }
-}
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/linechart.go b/Godeps/_workspace/src/github.com/gizak/termui/example/linechart.go
deleted file mode 100644
index 1db543496..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/linechart.go
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2015 Zack Guo <gizak@icloud.com>. All rights reserved.
-// Use of this source code is governed by a MIT license that can
-// be found in the LICENSE file.
-
-// +build ignore
-
-package main
-
-import (
- "math"
-
- "github.com/gizak/termui"
-)
-
-func main() {
- err := termui.Init()
- if err != nil {
- panic(err)
- }
- defer termui.Close()
-
- termui.UseTheme("helloworld")
-
- sinps := (func() []float64 {
- n := 220
- ps := make([]float64, n)
- for i := range ps {
- ps[i] = 1 + math.Sin(float64(i)/5)
- }
- return ps
- })()
-
- lc0 := termui.NewLineChart()
- lc0.Border.Label = "braille-mode Line Chart"
- lc0.Data = sinps
- lc0.Width = 50
- lc0.Height = 12
- lc0.X = 0
- lc0.Y = 0
- lc0.AxesColor = termui.ColorWhite
- lc0.LineColor = termui.ColorGreen | termui.AttrBold
-
- lc1 := termui.NewLineChart()
- lc1.Border.Label = "dot-mode Line Chart"
- lc1.Mode = "dot"
- lc1.Data = sinps
- lc1.Width = 26
- lc1.Height = 12
- lc1.X = 51
- lc1.DotStyle = '+'
- lc1.AxesColor = termui.ColorWhite
- lc1.LineColor = termui.ColorYellow | termui.AttrBold
-
- lc2 := termui.NewLineChart()
- lc2.Border.Label = "dot-mode Line Chart"
- lc2.Mode = "dot"
- lc2.Data = sinps[4:]
- lc2.Width = 77
- lc2.Height = 16
- lc2.X = 0
- lc2.Y = 12
- lc2.AxesColor = termui.ColorWhite
- lc2.LineColor = termui.ColorCyan | termui.AttrBold
-
- termui.Render(lc0, lc1, lc2)
-
- <-termui.EventCh()
-}
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/linechart.png b/Godeps/_workspace/src/github.com/gizak/termui/example/linechart.png
deleted file mode 100644
index 655ef435f..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/linechart.png
+++ /dev/null
Binary files differ
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/list.go b/Godeps/_workspace/src/github.com/gizak/termui/example/list.go
deleted file mode 100644
index d33a3616c..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/list.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2015 Zack Guo <gizak@icloud.com>. All rights reserved.
-// Use of this source code is governed by a MIT license that can
-// be found in the LICENSE file.
-
-// +build ignore
-
-package main
-
-import "github.com/gizak/termui"
-
-func main() {
- err := termui.Init()
- if err != nil {
- panic(err)
- }
- defer termui.Close()
-
- termui.UseTheme("helloworld")
-
- strs := []string{
- "[0] github.com/gizak/termui",
- "[1] 你好,世界",
- "[2] こんにちは世界",
- "[3] keyboard.go",
- "[4] output.go",
- "[5] random_out.go",
- "[6] dashboard.go",
- "[7] nsf/termbox-go"}
-
- ls := termui.NewList()
- ls.Items = strs
- ls.ItemFgColor = termui.ColorYellow
- ls.Border.Label = "List"
- ls.Height = 7
- ls.Width = 25
- ls.Y = 0
-
- termui.Render(ls)
-
- <-termui.EventCh()
-}
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/list.png b/Godeps/_workspace/src/github.com/gizak/termui/example/list.png
deleted file mode 100644
index 8ca08c079..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/list.png
+++ /dev/null
Binary files differ
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/mbarchart.go b/Godeps/_workspace/src/github.com/gizak/termui/example/mbarchart.go
deleted file mode 100644
index a32a28e0a..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/mbarchart.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2015 Zack Guo <gizak@icloud.com>. All rights reserved.
-// Use of this source code is governed by a MIT license that can
-// be found in the LICENSE file.
-
-// +build ignore
-
-package main
-
-import "github.com/gizak/termui"
-
-func main() {
- err := termui.Init()
- if err != nil {
- panic(err)
- }
- defer termui.Close()
-
- termui.UseTheme("helloworld")
-
- bc := termui.NewMBarChart()
- math := []int{90, 85, 90, 80}
- english := []int{70, 85, 75, 60}
- science := []int{75, 60, 80, 85}
- compsci := []int{100, 100, 100, 100}
- bc.Data[0] = math
- bc.Data[1] = english
- bc.Data[2] = science
- bc.Data[3] = compsci
- studentsName := []string{"Ken", "Rob", "Dennis", "Linus"}
- bc.Border.Label = "Student's Marks X-Axis=Name Y-Axis=Marks[Math,English,Science,ComputerScience] in %"
- bc.Width = 100
- bc.Height = 50
- bc.Y = 10
- bc.BarWidth = 10
- bc.DataLabels = studentsName
- bc.ShowScale = true //Show y_axis scale value (min and max)
- bc.SetMax(400)
-
- bc.TextColor = termui.ColorGreen //this is color for label (x-axis)
- bc.BarColor[3] = termui.ColorGreen //BarColor for computerscience
- bc.BarColor[1] = termui.ColorYellow //Bar Color for english
- bc.NumColor[3] = termui.ColorRed // Num color for computerscience
- bc.NumColor[1] = termui.ColorRed // num color for english
-
- //Other colors are automatically populated, btw All the students seems do well in computerscience. :p
-
- termui.Render(bc)
-
- <-termui.EventCh()
-}
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/mbarchart.png b/Godeps/_workspace/src/github.com/gizak/termui/example/mbarchart.png
deleted file mode 100644
index 9a4252616..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/mbarchart.png
+++ /dev/null
Binary files differ
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/par.go b/Godeps/_workspace/src/github.com/gizak/termui/example/par.go
deleted file mode 100644
index ffbc60aa8..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/par.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2015 Zack Guo <gizak@icloud.com>. All rights reserved.
-// Use of this source code is governed by a MIT license that can
-// be found in the LICENSE file.
-
-// +build ignore
-
-package main
-
-import "github.com/gizak/termui"
-
-func main() {
- err := termui.Init()
- if err != nil {
- panic(err)
- }
- defer termui.Close()
-
- termui.UseTheme("helloworld")
-
- par0 := termui.NewPar("Borderless Text")
- par0.Height = 1
- par0.Width = 20
- par0.Y = 1
- par0.HasBorder = false
-
- par1 := termui.NewPar("你好,世界。")
- par1.Height = 3
- par1.Width = 17
- par1.X = 20
- par1.Border.Label = "标签"
-
- par2 := termui.NewPar("Simple text\nwith label. It can be multilined with \\n or break automatically")
- par2.Height = 5
- par2.Width = 37
- par2.Y = 4
- par2.Border.Label = "Multiline"
- par2.Border.FgColor = termui.ColorYellow
-
- par3 := termui.NewPar("Long text with label and it is auto trimmed.")
- par3.Height = 3
- par3.Width = 37
- par3.Y = 9
- par3.Border.Label = "Auto Trim"
-
- termui.Render(par0, par1, par2, par3)
-
- <-termui.EventCh()
-}
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/par.png b/Godeps/_workspace/src/github.com/gizak/termui/example/par.png
deleted file mode 100644
index a85e64415..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/par.png
+++ /dev/null
Binary files differ
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/sparklines.go b/Godeps/_workspace/src/github.com/gizak/termui/example/sparklines.go
deleted file mode 100644
index f04baf570..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/sparklines.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2015 Zack Guo <gizak@icloud.com>. All rights reserved.
-// Use of this source code is governed by a MIT license that can
-// be found in the LICENSE file.
-
-// +build ignore
-
-package main
-
-import "github.com/gizak/termui"
-
-func main() {
- err := termui.Init()
- if err != nil {
- panic(err)
- }
- defer termui.Close()
-
- termui.UseTheme("helloworld")
-
- data := []int{4, 2, 1, 6, 3, 9, 1, 4, 2, 15, 14, 9, 8, 6, 10, 13, 15, 12, 10, 5, 3, 6, 1, 7, 10, 10, 14, 13, 6}
- spl0 := termui.NewSparkline()
- spl0.Data = data[3:]
- spl0.Title = "Sparkline 0"
- spl0.LineColor = termui.ColorGreen
-
- // single
- spls0 := termui.NewSparklines(spl0)
- spls0.Height = 2
- spls0.Width = 20
- spls0.HasBorder = false
-
- spl1 := termui.NewSparkline()
- spl1.Data = data
- spl1.Title = "Sparkline 1"
- spl1.LineColor = termui.ColorRed
-
- spl2 := termui.NewSparkline()
- spl2.Data = data[5:]
- spl2.Title = "Sparkline 2"
- spl2.LineColor = termui.ColorMagenta
-
- // group
- spls1 := termui.NewSparklines(spl0, spl1, spl2)
- spls1.Height = 8
- spls1.Width = 20
- spls1.Y = 3
- spls1.Border.Label = "Group Sparklines"
-
- spl3 := termui.NewSparkline()
- spl3.Data = data
- spl3.Title = "Enlarged Sparkline"
- spl3.Height = 8
- spl3.LineColor = termui.ColorYellow
-
- spls2 := termui.NewSparklines(spl3)
- spls2.Height = 11
- spls2.Width = 30
- spls2.Border.FgColor = termui.ColorCyan
- spls2.X = 21
- spls2.Border.Label = "Tweeked Sparkline"
-
- termui.Render(spls0, spls1, spls2)
-
- <-termui.EventCh()
-}
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/sparklines.png b/Godeps/_workspace/src/github.com/gizak/termui/example/sparklines.png
deleted file mode 100644
index 9dd7c82b1..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/sparklines.png
+++ /dev/null
Binary files differ
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/theme.go b/Godeps/_workspace/src/github.com/gizak/termui/example/theme.go
deleted file mode 100644
index 30c51a343..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/theme.go
+++ /dev/null
@@ -1,143 +0,0 @@
-// Copyright 2015 Zack Guo <gizak@icloud.com>. All rights reserved.
-// Use of this source code is governed by a MIT license that can
-// be found in the LICENSE file.
-
-// +build ignore
-
-package main
-
-import ui "github.com/gizak/termui"
-import "math"
-
-import "time"
-
-func main() {
- err := ui.Init()
- if err != nil {
- panic(err)
- }
- defer ui.Close()
-
- ui.UseTheme("helloworld")
-
- p := ui.NewPar(":PRESS q TO QUIT DEMO")
- p.Height = 3
- p.Width = 50
- p.Border.Label = "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"}
- list := ui.NewList()
- list.Items = strs
- list.Border.Label = "List"
- list.Height = 7
- list.Width = 25
- list.Y = 4
-
- g := ui.NewGauge()
- g.Percent = 50
- g.Width = 50
- g.Height = 3
- g.Y = 11
- g.Border.Label = "Gauge"
-
- spark := ui.NewSparkline()
- spark.Title = "srv 0:"
- spdata := []int{4, 2, 1, 6, 3, 9, 1, 4, 2, 15, 14, 9, 8, 6, 10, 13, 15, 12, 10, 5, 3, 6, 1, 7, 10, 10, 14, 13, 6}
- spark.Data = spdata
-
- spark1 := ui.NewSparkline()
- spark1.Title = "srv 1:"
- spark1.Data = spdata
-
- sp := ui.NewSparklines(spark, spark1)
- sp.Width = 25
- sp.Height = 7
- sp.Border.Label = "Sparkline"
- sp.Y = 4
- sp.X = 25
-
- lc := ui.NewLineChart()
- sinps := (func() []float64 {
- n := 100
- ps := make([]float64, n)
- for i := range ps {
- ps[i] = 1 + math.Sin(float64(i)/4)
- }
- return ps
- })()
-
- lc.Border.Label = "Line Chart"
- lc.Data = sinps
- lc.Width = 50
- lc.Height = 11
- lc.X = 0
- lc.Y = 14
- lc.Mode = "dot"
-
- 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}
- bclabels := []string{"S0", "S1", "S2", "S3", "S4", "S5"}
- bc.Border.Label = "Bar Chart"
- bc.Width = 26
- bc.Height = 10
- bc.X = 51
- bc.Y = 0
- bc.DataLabels = bclabels
-
- lc1 := ui.NewLineChart()
- lc1.Border.Label = "Line Chart"
- rndwalk := (func() []float64 {
- n := 150
- d := make([]float64, n)
- for i := 1; i < n; i++ {
- if i < 20 {
- d[i] = d[i-1] + 0.01
- }
- if i > 20 {
- d[i] = d[i-1] - 0.05
- }
- }
- return d
- })()
- lc1.Data = rndwalk
- lc1.Width = 26
- lc1.Height = 11
- lc1.X = 51
- lc1.Y = 14
-
- p1 := ui.NewPar("Hey!\nI am a borderless block!")
- p1.HasBorder = false
- p1.Width = 26
- p1.Height = 2
- p1.X = 52
- p1.Y = 11
-
- draw := func(t int) {
- g.Percent = t % 101
- list.Items = strs[t%9:]
- sp.Lines[0].Data = spdata[t%10:]
- sp.Lines[1].Data = spdata[t/2%10:]
- lc.Data = sinps[t/2:]
- lc1.Data = rndwalk[t:]
- bc.Data = bcdata[t/2%10:]
- ui.Render(p, list, g, sp, lc, bc, lc1, p1)
- }
-
- evt := ui.EventCh()
- i := 0
- for {
- select {
- case e := <-evt:
- if e.Type == ui.EventKey && e.Ch == 'q' {
- return
- }
- default:
- draw(i)
- i++
- if i == 102 {
- return
- }
- time.Sleep(time.Second / 2)
- }
- }
-}
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/themedefault.png b/Godeps/_workspace/src/github.com/gizak/termui/example/themedefault.png
deleted file mode 100644
index 23b574f96..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/themedefault.png
+++ /dev/null
Binary files differ
diff --git a/Godeps/_workspace/src/github.com/gizak/termui/example/themehelloworld.png b/Godeps/_workspace/src/github.com/gizak/termui/example/themehelloworld.png
deleted file mode 100644
index eaf4d9303..000000000
--- a/Godeps/_workspace/src/github.com/gizak/termui/example/themehelloworld.png
+++ /dev/null
Binary files differ