mirror of
https://github.com/navidys/tvxwidgets.git
synced 2025-04-28 13:48:52 +08:00
![dependabot[bot]](/assets/img/avatar_default.png)
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.18.0 to 2.19.0. - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/ginkgo/compare/v2.18.0...v2.19.0) --- updated-dependencies: - dependency-name: github.com/onsi/ginkgo/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
tvxwidgets
tvxwidgets provides extra widgets for tview.
Widgets
- bar chart
- activity mode gauge
- percentage mode gauge
- utilisation mode gauge
- message dialog (info and error)
- spinner
- plot (linechart, scatter)
- sparkline
Example
package main
import (
"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)
}
}
Languages
Go
93.8%
Makefile
5.1%
Shell
1.1%