Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/navidys/tvxwidgets
tvxwidgets provides extra widgets for tview
https://github.com/navidys/tvxwidgets
golang terminal-interface user-interface
Last synced: 3 days ago
JSON representation
tvxwidgets provides extra widgets for tview
- Host: GitHub
- URL: https://github.com/navidys/tvxwidgets
- Owner: navidys
- License: mit
- Created: 2021-12-19T04:06:47.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-11T22:08:03.000Z (4 months ago)
- Last Synced: 2024-08-11T23:22:24.572Z (4 months ago)
- Topics: golang, terminal-interface, user-interface
- Language: Go
- Homepage:
- Size: 1.09 MB
- Stars: 123
- Watchers: 3
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# tvxwidgets
[![PkgGoDev](https://pkg.go.dev/badge/github.com/navidys/tvxwidgets)](https://pkg.go.dev/github.com/navidys/tvxwidgets)
![Go](https://github.com/navidys/tvxwidgets/workflows/Go/badge.svg)
[![codecov](https://codecov.io/gh/navidys/tvxwidgets/branch/main/graph/badge.svg)](https://codecov.io/gh/navidys/tvxwidgets)
[![Go Report](https://img.shields.io/badge/go%20report-A%2B-brightgreen.svg)](https://goreportcard.com/report/github.com/navidys/tvxwidgets)tvxwidgets provides extra widgets for [tview](https://github.com/rivo/tview).
![Screenshot](demo.gif)
## Widgets
* [bar chart](./demos/barchart/)
* [activity mode gauge](./demos/gauge_am/)
* [percentage mode gauge](./demos/gauge_pm/)
* [utilisation mode gauge](./demos/gauge_um/)
* [message dialog (info and error)](./demos/dialog/)
* [spinner](./demos/spinner/)
* [plot (linechart, scatter)](./demos/plot/)
* [sparkline](./demos/sparkline/)## Example
```go
package mainimport (
"time""github.com/gdamore/tcell/v2"
"github.com/navidys/tvxwidgets"
"github.com/rivo/tview"
)func main() {
app := tview.NewApplication()
gauge := tvxwidgets.NewActivityModeGauge()
gauge.SetTitle("activity mode gauge")
gauge.SetPgBgColor(tcell.ColorOrange)
gauge.SetRect(10, 4, 50, 3)
gauge.SetBorder(true)update := func() {
tick := time.NewTicker(500 * time.Millisecond)
for {
select {
case <-tick.C:
gauge.Pulse()
app.Draw()
}
}
}
go update()if err := app.SetRoot(gauge, false).EnableMouse(true).Run(); err != nil {
panic(err)
}
}```