Pulse is a Go library that draws live line charts in the terminal. It is for developers who build terminal apps with Charm's Lip Gloss and Bubble Tea: you push values, and View() returns a chart that slides left as new points arrive, drawn with box-drawing curves or braille dots. Pulse is made by Igor Churmeev.
- Smooth box-drawing curves, thin and rounded or bold, or braille dots with spline smoothing for a denser line.
- Several named series on one chart, each with its own Lip Gloss style, and a legend box with the latest values.
- Area fill under the curves, stippled, tinted or solid, over a grid aligned to the Y ticks.
- A Y range that fits the visible data, for metrics without a fixed scale.
- Charts around zero: a zero baseline, mirrored series such as network RX and TX, a symmetric range and byte-rate labels.
- A second Y axis on the right, with its own range and labels, for two metrics on different scales.
- Logarithmic Y scale for values that span orders of magnitude.
- Thresholds: dashed limit lines with labels, and series colored where they cross a limit.
- Events such as deploys and alerts, pinned to points on the timeline with a marker and a vertical line.
- An optional time axis with labels from your own function, at the quarter columns or at the columns you choose.
- A cursor that shows each series' value at a past point, and scrolling back through the kept history.
- One-line sparklines for tables and lists, with blocks or braille dots.
- Donut charts in a separate package: a ring or a frame split into sections, with the total in the middle.
- Gaps for missing samples:
NaNand±Infdraw nothing.
go get github.com/ingvarch/pulsechart := pulse.New(80, 13, pulse.WithRange(0, 100))
for i := 0; i < 80; i++ {
chart.Push(50 + 38*math.Sin(float64(i)*0.16))
}
fmt.Println(chart.View())You need Go 1.26 or newer, see docs/development.md.
git clone https://github.com/ingvarch/pulse.git
cd pulse
go test ./...
go -C examples run ./livedemo- Getting Started: install, the sliding window, history and resizing, missing points, several series, styling and themes, legends, runtime settings
- Rendering Modes: box-drawing curves, braille dots, area fill
- Axes and Grid: Y ticks, the grid, the time axis, automatic range, logarithmic scale, right axis, symmetric range, label formatters
- Zero-Crossing and RX/TX: zero baseline, mirrored series, negative styles, byte-rate labels
- Thresholds: limit lines, labels, colors by threshold
- Timeline Events: deploys and alerts on the chart, the events card
- Cursor and Scrolling: a value cursor, the values at a past point, scrolling back through the history
- Sparklines: a one-line trend with blocks or braille, for a table row
- Donut: a ring or a frame split into sections, glyph sets, the legend
- Bubble Tea Integration: a chart inside a Bubble Tea model, ticks, hotkeys, resizing
- Development: checks, demos, screenshots, releases, project structure
- API reference on pkg.go.dev
MIT, see LICENSE.
See CONTRIBUTING.md and the Code of Conduct. Report security issues privately, as SECURITY.md describes.
