From 8b1d581e7910e47f91e7e87ad0d4c8955f264f51 Mon Sep 17 00:00:00 2001 From: keaysma Date: Sun, 20 Oct 2024 15:03:55 -0400 Subject: [PATCH 1/4] plot: add minVal --- widgets/plot.go | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/widgets/plot.go b/widgets/plot.go index f4870de..3b13a34 100644 --- a/widgets/plot.go +++ b/widgets/plot.go @@ -20,6 +20,7 @@ type Plot struct { Data [][]float64 DataLabels []string + MinVal float64 MaxVal float64 LineColors []Color @@ -76,7 +77,8 @@ func NewPlot() *Plot { } } -func (self *Plot) renderBraille(buf *Buffer, drawArea image.Rectangle, maxVal float64) { +func (self *Plot) renderBraille(buf *Buffer, drawArea image.Rectangle, minVal float64, maxVal float64) { + r := maxVal - minVal canvas := NewCanvas() canvas.Rectangle = drawArea @@ -84,7 +86,7 @@ func (self *Plot) renderBraille(buf *Buffer, drawArea image.Rectangle, maxVal fl case ScatterPlot: for i, line := range self.Data { for j, val := range line { - height := int((val / maxVal) * float64(drawArea.Dy()-1)) + height := int(((val-minVal)/r)*float64(drawArea.Dy()-1)) - int(val*float64(drawArea.Dy()-1)) canvas.SetPoint( image.Pt( (drawArea.Min.X+(j*self.HorizontalScale))*2, @@ -96,9 +98,9 @@ func (self *Plot) renderBraille(buf *Buffer, drawArea image.Rectangle, maxVal fl } case LineChart: for i, line := range self.Data { - previousHeight := int((line[1] / maxVal) * float64(drawArea.Dy()-1)) + previousHeight := int(((line[1] - minVal) / r) * float64(drawArea.Dy()-1)) for j, val := range line[1:] { - height := int((val / maxVal) * float64(drawArea.Dy()-1)) + height := int(((val - minVal) / r) * float64(drawArea.Dy()-1)) canvas.SetLine( image.Pt( (drawArea.Min.X+(j*self.HorizontalScale))*2, @@ -118,12 +120,13 @@ func (self *Plot) renderBraille(buf *Buffer, drawArea image.Rectangle, maxVal fl canvas.Draw(buf) } -func (self *Plot) renderDot(buf *Buffer, drawArea image.Rectangle, maxVal float64) { +func (self *Plot) renderDot(buf *Buffer, drawArea image.Rectangle, minVal float64, maxVal float64) { + r := maxVal - minVal switch self.PlotType { case ScatterPlot: for i, line := range self.Data { for j, val := range line { - height := int((val / maxVal) * float64(drawArea.Dy()-1)) + height := int(((val - minVal) / r) * float64(drawArea.Dy()-1)) point := image.Pt(drawArea.Min.X+(j*self.HorizontalScale), drawArea.Max.Y-1-height) if point.In(drawArea) { buf.SetCell( @@ -137,7 +140,7 @@ func (self *Plot) renderDot(buf *Buffer, drawArea image.Rectangle, maxVal float6 for i, line := range self.Data { for j := 0; j < len(line) && j*self.HorizontalScale < drawArea.Dx(); j++ { val := line[j] - height := int((val / maxVal) * float64(drawArea.Dy()-1)) + height := int(((val - minVal) / r) * float64(drawArea.Dy()-1)) buf.SetCell( NewCell(self.DotMarkerRune, NewStyle(SelectColor(self.LineColors, i))), image.Pt(drawArea.Min.X+(j*self.HorizontalScale), drawArea.Max.Y-1-height), @@ -147,7 +150,7 @@ func (self *Plot) renderDot(buf *Buffer, drawArea image.Rectangle, maxVal float6 } } -func (self *Plot) plotAxes(buf *Buffer, maxVal float64) { +func (self *Plot) plotAxes(buf *Buffer, minVal float64, maxVal float64) { // draw origin cell buf.SetCell( NewCell(BOTTOM_LEFT, NewStyle(ColorWhite)), @@ -188,10 +191,10 @@ func (self *Plot) plotAxes(buf *Buffer, maxVal float64) { x += (len(label) + xAxisLabelsGap) * self.HorizontalScale } // draw y axis labels - verticalScale := maxVal / float64(self.Inner.Dy()-xAxisLabelsHeight-1) + verticalScale := (maxVal - minVal) / float64(self.Inner.Dy()-xAxisLabelsHeight-1) for i := 0; i*(yAxisLabelsGap+1) < self.Inner.Dy()-1; i++ { buf.SetString( - fmt.Sprintf("%.2f", float64(i)*verticalScale*(yAxisLabelsGap+1)), + fmt.Sprintf("%.2f", (float64(i)*verticalScale*(yAxisLabelsGap+1))+minVal), NewStyle(ColorWhite), image.Pt(self.Inner.Min.X, self.Inner.Max.Y-(i*(yAxisLabelsGap+1))-2), ) @@ -201,13 +204,13 @@ func (self *Plot) plotAxes(buf *Buffer, maxVal float64) { func (self *Plot) Draw(buf *Buffer) { self.Block.Draw(buf) - maxVal := self.MaxVal + minVal, maxVal := self.MinVal, self.MaxVal if maxVal == 0 { maxVal, _ = GetMaxFloat64From2dSlice(self.Data) } if self.ShowAxes { - self.plotAxes(buf, maxVal) + self.plotAxes(buf, minVal, maxVal) } drawArea := self.Inner @@ -220,8 +223,8 @@ func (self *Plot) Draw(buf *Buffer) { switch self.Marker { case MarkerBraille: - self.renderBraille(buf, drawArea, maxVal) + self.renderBraille(buf, drawArea, minVal, maxVal) case MarkerDot: - self.renderDot(buf, drawArea, maxVal) + self.renderDot(buf, drawArea, minVal, maxVal) } } From 8da7bb6861bf589d96c0ed6b6a4316ff48c8e8c7 Mon Sep 17 00:00:00 2001 From: keaysma Date: Sun, 20 Oct 2024 15:09:53 -0400 Subject: [PATCH 2/4] remove bad factor from renderBraille --- widgets/plot.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets/plot.go b/widgets/plot.go index 3b13a34..2eae7a1 100644 --- a/widgets/plot.go +++ b/widgets/plot.go @@ -86,7 +86,7 @@ func (self *Plot) renderBraille(buf *Buffer, drawArea image.Rectangle, minVal fl case ScatterPlot: for i, line := range self.Data { for j, val := range line { - height := int(((val-minVal)/r)*float64(drawArea.Dy()-1)) - int(val*float64(drawArea.Dy()-1)) + height := int(((val-minVal)/r)*float64(drawArea.Dy()-1)) canvas.SetPoint( image.Pt( (drawArea.Min.X+(j*self.HorizontalScale))*2, From d372d9e539f31d28fa10977e62683f875116eae5 Mon Sep 17 00:00:00 2001 From: keaysma Date: Sun, 20 Oct 2024 15:16:23 -0400 Subject: [PATCH 3/4] Implement GetMinFloat64From2dSlice --- utils.go | 16 ++++++++++++++++ widgets/plot.go | 5 ++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/utils.go b/utils.go index e53d531..d6ea30b 100644 --- a/utils.go +++ b/utils.go @@ -93,6 +93,22 @@ func GetMaxFloat64FromSlice(slice []float64) (float64, error) { return max, nil } +func GetMinFloat64From2dSlice(slices [][]float64) (float64, error) { + if len(slices) == 0 { + return 0, fmt.Errorf("cannot get min value from empty slice") + } + var min float64 + for _, slice := range slices { + for _, val := range slice { + if val < min { + min = val + } + } + } + + return min, nil +} + func GetMaxFloat64From2dSlice(slices [][]float64) (float64, error) { if len(slices) == 0 { return 0, fmt.Errorf("cannot get max value from empty slice") diff --git a/widgets/plot.go b/widgets/plot.go index 2eae7a1..2b5737c 100644 --- a/widgets/plot.go +++ b/widgets/plot.go @@ -86,7 +86,7 @@ func (self *Plot) renderBraille(buf *Buffer, drawArea image.Rectangle, minVal fl case ScatterPlot: for i, line := range self.Data { for j, val := range line { - height := int(((val-minVal)/r)*float64(drawArea.Dy()-1)) + height := int(((val - minVal) / r) * float64(drawArea.Dy()-1)) canvas.SetPoint( image.Pt( (drawArea.Min.X+(j*self.HorizontalScale))*2, @@ -208,6 +208,9 @@ func (self *Plot) Draw(buf *Buffer) { if maxVal == 0 { maxVal, _ = GetMaxFloat64From2dSlice(self.Data) } + if minVal == 0 { + minVal, _ = GetMinFloat64From2dSlice(self.Data) + } if self.ShowAxes { self.plotAxes(buf, minVal, maxVal) From 3a1e439947a180830b93dbcb53d6a3d222533568 Mon Sep 17 00:00:00 2001 From: keaysma Date: Sun, 20 Oct 2024 15:31:57 -0400 Subject: [PATCH 4/4] rename the module and add quick attribution --- README.md | 8 +++++--- _examples/barchart.go | 5 +++-- _examples/canvas.go | 3 ++- _examples/demo.go | 5 +++-- _examples/gauge.go | 5 +++-- _examples/grid.go | 5 +++-- _examples/hello_world.go | 5 +++-- _examples/image.go | 5 +++-- _examples/list.go | 7 ++++--- _examples/paragraph.go | 5 +++-- _examples/piechart.go | 5 +++-- _examples/plot.go | 5 +++-- _examples/sparkline.go | 5 +++-- _examples/stacked_barchart.go | 5 +++-- _examples/table.go | 5 +++-- _examples/tabs.go | 5 +++-- _examples/tree.go | 4 ++-- _test/log_events.go | 3 ++- canvas.go | 2 +- go.mod | 2 +- widgets/barchart.go | 2 +- widgets/gauge.go | 2 +- widgets/image.go | 2 +- widgets/list.go | 2 +- widgets/paragraph.go | 2 +- widgets/piechart.go | 2 +- widgets/plot.go | 2 +- widgets/sparkline.go | 2 +- widgets/stacked_barchart.go | 2 +- widgets/table.go | 5 +++-- widgets/tabs.go | 2 +- widgets/tree.go | 2 +- 32 files changed, 70 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 11e3d25..e077caa 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ # termui +This is [gizak's termui](https://github.com/gizak/termui) with minor alterations + [demo cast under osx 10.10; Terminal.app; Menlo Regular 12pt.)](./_examples/demo.go) termui is a cross-platform and fully-customizable terminal dashboard and widget library built on top of [termbox-go](https://github.com/nsf/termbox-go). It is inspired by [blessed-contrib](https://github.com/yaronn/blessed-contrib) and [tui-rs](https://github.com/fdehau/tui-rs) and written purely in Go. ## Note -Please be aware that due to my fluctuating availability, the frequency of updates to this project may not always follow a consistent schedule. I would like to invite potential maintainers to contribute to this project. If you are interested in becoming a maintainer, please do not hesitate to reach out to me. +~Please be aware that due to my fluctuating availability, the frequency of updates to this project may not always follow a consistent schedule. I would like to invite potential maintainers to contribute to this project. If you are interested in becoming a maintainer, please do not hesitate to reach out to me.~ ## Versions @@ -38,8 +40,8 @@ package main import ( "log" - ui "github.com/gizak/termui/v3" - "github.com/gizak/termui/v3/widgets" + ui "github.com/keaysma/termui/v3" + "github.com/keaysma/termui/v3/widgets" ) func main() { diff --git a/_examples/barchart.go b/_examples/barchart.go index fb6a2ca..04b0688 100644 --- a/_examples/barchart.go +++ b/_examples/barchart.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a MIT license that can // be found in the LICENSE file. +//go:build ignore // +build ignore package main @@ -9,8 +10,8 @@ package main import ( "log" - ui "github.com/gizak/termui/v3" - "github.com/gizak/termui/v3/widgets" + ui "github.com/keaysma/termui/v3" + "github.com/keaysma/termui/v3/widgets" ) func main() { diff --git a/_examples/canvas.go b/_examples/canvas.go index 5eb7387..f52dd93 100644 --- a/_examples/canvas.go +++ b/_examples/canvas.go @@ -1,3 +1,4 @@ +//go:build ignore // +build ignore package main @@ -6,7 +7,7 @@ import ( "image" "log" - ui "github.com/gizak/termui/v3" + ui "github.com/keaysma/termui/v3" ) func main() { diff --git a/_examples/demo.go b/_examples/demo.go index dd579c3..b769f84 100644 --- a/_examples/demo.go +++ b/_examples/demo.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a MIT license that can // be found in the LICENSE file. +//go:build ignore // +build ignore package main @@ -11,8 +12,8 @@ import ( "math" "time" - ui "github.com/gizak/termui/v3" - "github.com/gizak/termui/v3/widgets" + ui "github.com/keaysma/termui/v3" + "github.com/keaysma/termui/v3/widgets" ) func main() { diff --git a/_examples/gauge.go b/_examples/gauge.go index 93bc1ce..345396e 100644 --- a/_examples/gauge.go +++ b/_examples/gauge.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a MIT license that can // be found in the LICENSE file. +//go:build ignore // +build ignore package main @@ -10,8 +11,8 @@ import ( "fmt" "log" - ui "github.com/gizak/termui/v3" - "github.com/gizak/termui/v3/widgets" + ui "github.com/keaysma/termui/v3" + "github.com/keaysma/termui/v3/widgets" ) func main() { diff --git a/_examples/grid.go b/_examples/grid.go index 8783ef1..d5ea65a 100644 --- a/_examples/grid.go +++ b/_examples/grid.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a MIT license that can // be found in the LICENSE file. +//go:build ignore // +build ignore package main @@ -11,8 +12,8 @@ import ( "math" "time" - ui "github.com/gizak/termui/v3" - "github.com/gizak/termui/v3/widgets" + ui "github.com/keaysma/termui/v3" + "github.com/keaysma/termui/v3/widgets" ) func main() { diff --git a/_examples/hello_world.go b/_examples/hello_world.go index 3ff1c02..d99fb54 100644 --- a/_examples/hello_world.go +++ b/_examples/hello_world.go @@ -1,3 +1,4 @@ +//go:build ignore // +build ignore package main @@ -5,8 +6,8 @@ package main import ( "log" - ui "github.com/gizak/termui/v3" - "github.com/gizak/termui/v3/widgets" + ui "github.com/keaysma/termui/v3" + "github.com/keaysma/termui/v3/widgets" ) func main() { diff --git a/_examples/image.go b/_examples/image.go index e0d4aba..a6c186a 100644 --- a/_examples/image.go +++ b/_examples/image.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a MIT license that can // be found in the LICENSE file. +//go:build ignore // +build ignore package main @@ -18,8 +19,8 @@ import ( "os" "strings" - ui "github.com/gizak/termui/v3" - "github.com/gizak/termui/v3/widgets" + ui "github.com/keaysma/termui/v3" + "github.com/keaysma/termui/v3/widgets" ) func main() { diff --git a/_examples/list.go b/_examples/list.go index 0657191..1325b74 100644 --- a/_examples/list.go +++ b/_examples/list.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a MIT license that can // be found in the LICENSE file. +//go:build ignore // +build ignore package main @@ -9,8 +10,8 @@ package main import ( "log" - ui "github.com/gizak/termui/v3" - "github.com/gizak/termui/v3/widgets" + ui "github.com/keaysma/termui/v3" + "github.com/keaysma/termui/v3/widgets" ) func main() { @@ -22,7 +23,7 @@ func main() { l := widgets.NewList() l.Title = "List" l.Rows = []string{ - "[0] github.com/gizak/termui/v3", + "[0] github.com/keaysma/termui/v3", "[1] [你好,世界](fg:blue)", "[2] [こんにちは世界](fg:red)", "[3] [color](fg:white,bg:green) output", diff --git a/_examples/paragraph.go b/_examples/paragraph.go index 819101d..ee4316a 100644 --- a/_examples/paragraph.go +++ b/_examples/paragraph.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a MIT license that can // be found in the LICENSE file. +//go:build ignore // +build ignore package main @@ -9,8 +10,8 @@ package main import ( "log" - ui "github.com/gizak/termui/v3" - "github.com/gizak/termui/v3/widgets" + ui "github.com/keaysma/termui/v3" + "github.com/keaysma/termui/v3/widgets" ) func main() { diff --git a/_examples/piechart.go b/_examples/piechart.go index daf81b9..d17def5 100644 --- a/_examples/piechart.go +++ b/_examples/piechart.go @@ -1,3 +1,4 @@ +//go:build ignore // +build ignore package main @@ -9,8 +10,8 @@ import ( "math/rand" "time" - ui "github.com/gizak/termui/v3" - "github.com/gizak/termui/v3/widgets" + ui "github.com/keaysma/termui/v3" + "github.com/keaysma/termui/v3/widgets" ) var run = true diff --git a/_examples/plot.go b/_examples/plot.go index ad71f8a..7b7b0a9 100644 --- a/_examples/plot.go +++ b/_examples/plot.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a MIT license that can // be found in the LICENSE file. +//go:build ignore // +build ignore package main @@ -10,8 +11,8 @@ import ( "log" "math" - ui "github.com/gizak/termui/v3" - "github.com/gizak/termui/v3/widgets" + ui "github.com/keaysma/termui/v3" + "github.com/keaysma/termui/v3/widgets" ) func main() { diff --git a/_examples/sparkline.go b/_examples/sparkline.go index 388bfb4..181368b 100644 --- a/_examples/sparkline.go +++ b/_examples/sparkline.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a MIT license that can // be found in the LICENSE file. +//go:build ignore // +build ignore package main @@ -9,8 +10,8 @@ package main import ( "log" - ui "github.com/gizak/termui/v3" - "github.com/gizak/termui/v3/widgets" + ui "github.com/keaysma/termui/v3" + "github.com/keaysma/termui/v3/widgets" ) func main() { diff --git a/_examples/stacked_barchart.go b/_examples/stacked_barchart.go index 46e0f39..4e34ca3 100644 --- a/_examples/stacked_barchart.go +++ b/_examples/stacked_barchart.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a MIT license that can // be found in the LICENSE file. +//go:build ignore // +build ignore package main @@ -9,8 +10,8 @@ package main import ( "log" - ui "github.com/gizak/termui/v3" - "github.com/gizak/termui/v3/widgets" + ui "github.com/keaysma/termui/v3" + "github.com/keaysma/termui/v3/widgets" ) func main() { diff --git a/_examples/table.go b/_examples/table.go index af74957..080043b 100644 --- a/_examples/table.go +++ b/_examples/table.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a MIT license that can // be found in the LICENSE file. +//go:build ignore // +build ignore package main @@ -9,8 +10,8 @@ package main import ( "log" - ui "github.com/gizak/termui/v3" - "github.com/gizak/termui/v3/widgets" + ui "github.com/keaysma/termui/v3" + "github.com/keaysma/termui/v3/widgets" ) func main() { diff --git a/_examples/tabs.go b/_examples/tabs.go index f6e0641..f982529 100644 --- a/_examples/tabs.go +++ b/_examples/tabs.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a MIT license that can // be found in the LICENSE file. +//go:build ignore // +build ignore package main @@ -9,8 +10,8 @@ package main import ( "log" - ui "github.com/gizak/termui/v3" - "github.com/gizak/termui/v3/widgets" + ui "github.com/keaysma/termui/v3" + "github.com/keaysma/termui/v3/widgets" ) func main() { diff --git a/_examples/tree.go b/_examples/tree.go index b572925..baf7aef 100644 --- a/_examples/tree.go +++ b/_examples/tree.go @@ -5,8 +5,8 @@ package main import ( "log" - ui "github.com/gizak/termui/v3" - "github.com/gizak/termui/v3/widgets" + ui "github.com/keaysma/termui/v3" + "github.com/keaysma/termui/v3/widgets" ) type nodeValue string diff --git a/_test/log_events.go b/_test/log_events.go index ae948be..d92e12f 100644 --- a/_test/log_events.go +++ b/_test/log_events.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a MIT license that can // be found in the LICENSE file. +//go:build ignore // +build ignore package main @@ -10,7 +11,7 @@ import ( "fmt" "log" - ui "github.com/gizak/termui/v3" + ui "github.com/keaysma/termui/v3" ) // logs all events to the termui window diff --git a/canvas.go b/canvas.go index 9001d98..b0621aa 100644 --- a/canvas.go +++ b/canvas.go @@ -3,7 +3,7 @@ package termui import ( "image" - "github.com/gizak/termui/v3/drawille" + "github.com/keaysma/termui/v3/drawille" ) type Canvas struct { diff --git a/go.mod b/go.mod index b405cdf..a88aaf7 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/gizak/termui/v3 +module github.com/keaysma/termui/v3 go 1.15 diff --git a/widgets/barchart.go b/widgets/barchart.go index d76de3b..b4f43d7 100644 --- a/widgets/barchart.go +++ b/widgets/barchart.go @@ -10,7 +10,7 @@ import ( rw "github.com/mattn/go-runewidth" - . "github.com/gizak/termui/v3" + . "github.com/keaysma/termui/v3" ) type BarChart struct { diff --git a/widgets/gauge.go b/widgets/gauge.go index 3dd921b..64ce69a 100644 --- a/widgets/gauge.go +++ b/widgets/gauge.go @@ -8,7 +8,7 @@ import ( "fmt" "image" - . "github.com/gizak/termui/v3" + . "github.com/keaysma/termui/v3" ) type Gauge struct { diff --git a/widgets/image.go b/widgets/image.go index 280802b..83ff1bc 100644 --- a/widgets/image.go +++ b/widgets/image.go @@ -8,7 +8,7 @@ import ( "image" "image/color" - . "github.com/gizak/termui/v3" + . "github.com/keaysma/termui/v3" ) type Image struct { diff --git a/widgets/list.go b/widgets/list.go index a4a6cb1..c6b99f4 100644 --- a/widgets/list.go +++ b/widgets/list.go @@ -9,7 +9,7 @@ import ( rw "github.com/mattn/go-runewidth" - . "github.com/gizak/termui/v3" + . "github.com/keaysma/termui/v3" ) type List struct { diff --git a/widgets/paragraph.go b/widgets/paragraph.go index 5b54dd8..b8f765d 100644 --- a/widgets/paragraph.go +++ b/widgets/paragraph.go @@ -7,7 +7,7 @@ package widgets import ( "image" - . "github.com/gizak/termui/v3" + . "github.com/keaysma/termui/v3" ) type Paragraph struct { diff --git a/widgets/piechart.go b/widgets/piechart.go index 24d0fb5..8d919a6 100644 --- a/widgets/piechart.go +++ b/widgets/piechart.go @@ -4,7 +4,7 @@ import ( "image" "math" - . "github.com/gizak/termui/v3" + . "github.com/keaysma/termui/v3" ) const ( diff --git a/widgets/plot.go b/widgets/plot.go index 2b5737c..f93461a 100644 --- a/widgets/plot.go +++ b/widgets/plot.go @@ -8,7 +8,7 @@ import ( "fmt" "image" - . "github.com/gizak/termui/v3" + . "github.com/keaysma/termui/v3" ) // Plot has two modes: line(default) and scatter. diff --git a/widgets/sparkline.go b/widgets/sparkline.go index ec963b5..edd65c4 100644 --- a/widgets/sparkline.go +++ b/widgets/sparkline.go @@ -7,7 +7,7 @@ package widgets import ( "image" - . "github.com/gizak/termui/v3" + . "github.com/keaysma/termui/v3" ) // Sparkline is like: ▅▆▂▂▅▇▂▂▃▆▆▆▅▃. The data points should be non-negative integers. diff --git a/widgets/stacked_barchart.go b/widgets/stacked_barchart.go index 255bb4a..6685084 100644 --- a/widgets/stacked_barchart.go +++ b/widgets/stacked_barchart.go @@ -10,7 +10,7 @@ import ( rw "github.com/mattn/go-runewidth" - . "github.com/gizak/termui/v3" + . "github.com/keaysma/termui/v3" ) type StackedBarChart struct { diff --git a/widgets/table.go b/widgets/table.go index 05391ad..0eaa830 100644 --- a/widgets/table.go +++ b/widgets/table.go @@ -7,10 +7,11 @@ package widgets import ( "image" - . "github.com/gizak/termui/v3" + . "github.com/keaysma/termui/v3" ) -/*Table is like: +/* +Table is like: ┌ Awesome Table ───────────────────────────────────────────────┐ │ Col0 | Col1 | Col2 | Col3 | Col4 | Col5 | Col6 | │──────────────────────────────────────────────────────────────│ diff --git a/widgets/tabs.go b/widgets/tabs.go index 8cbc92c..b24fc7b 100644 --- a/widgets/tabs.go +++ b/widgets/tabs.go @@ -7,7 +7,7 @@ package widgets import ( "image" - . "github.com/gizak/termui/v3" + . "github.com/keaysma/termui/v3" ) // TabPane is a renderable widget which can be used to conditionally render certain tabs/views. diff --git a/widgets/tree.go b/widgets/tree.go index ae1d305..9ab9d47 100644 --- a/widgets/tree.go +++ b/widgets/tree.go @@ -5,7 +5,7 @@ import ( "image" "strings" - . "github.com/gizak/termui/v3" + . "github.com/keaysma/termui/v3" rw "github.com/mattn/go-runewidth" )