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
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# termui

This is [gizak's termui](https://github.com/gizak/termui) with minor alterations

[<img src="./_assets/demo.gif" alt="demo cast under osx 10.10; Terminal.app; Menlo Regular 12pt.)" width="100%">](./_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

Expand Down Expand Up @@ -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() {
Expand Down
5 changes: 3 additions & 2 deletions _examples/barchart.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
// 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

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() {
Expand Down
3 changes: 2 additions & 1 deletion _examples/canvas.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ignore
// +build ignore

package main
Expand All @@ -6,7 +7,7 @@ import (
"image"
"log"

ui "github.com/gizak/termui/v3"
ui "github.com/keaysma/termui/v3"
)

func main() {
Expand Down
5 changes: 3 additions & 2 deletions _examples/demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand Down
5 changes: 3 additions & 2 deletions _examples/gauge.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand Down
5 changes: 3 additions & 2 deletions _examples/grid.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand Down
5 changes: 3 additions & 2 deletions _examples/hello_world.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
//go:build ignore
// +build ignore

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() {
Expand Down
5 changes: 3 additions & 2 deletions _examples/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand Down
7 changes: 4 additions & 3 deletions _examples/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
// 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

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() {
Expand All @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions _examples/paragraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
// 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

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() {
Expand Down
5 changes: 3 additions & 2 deletions _examples/piechart.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ignore
// +build ignore

package main
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions _examples/plot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand Down
5 changes: 3 additions & 2 deletions _examples/sparkline.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
// 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

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() {
Expand Down
5 changes: 3 additions & 2 deletions _examples/stacked_barchart.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
// 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

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() {
Expand Down
5 changes: 3 additions & 2 deletions _examples/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
// 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

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() {
Expand Down
5 changes: 3 additions & 2 deletions _examples/tabs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
// 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

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() {
Expand Down
4 changes: 2 additions & 2 deletions _examples/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion _test/log_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion canvas.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package termui
import (
"image"

"github.com/gizak/termui/v3/drawille"
"github.com/keaysma/termui/v3/drawille"
)

type Canvas struct {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/gizak/termui/v3
module github.com/keaysma/termui/v3

go 1.15

Expand Down
16 changes: 16 additions & 0 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion widgets/barchart.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

rw "github.com/mattn/go-runewidth"

. "github.com/gizak/termui/v3"
. "github.com/keaysma/termui/v3"
)

type BarChart struct {
Expand Down
2 changes: 1 addition & 1 deletion widgets/gauge.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"image"

. "github.com/gizak/termui/v3"
. "github.com/keaysma/termui/v3"
)

type Gauge struct {
Expand Down
Loading