Documentation
¶
Overview ¶
Shared formatting and small layout helpers used by the renderers in ui.go: number/duration/byte formatting plus visible-width text cutting. Rendering primitives live in spark.go, styles in theme.go.
Package ui renders the toktop dashboard.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BrailleChart ¶
func BrailleChart(vals []float64, w, h int, st ChartStyle) string
BrailleChart renders an area chart as braille dot-matrix, btop-style: every terminal cell is a 2x4 dot grid, so a w*h chart resolves w*2 by h*4 dots - far finer than the block ramp. Values fill upward from the baseline. With FadeAge, older columns fade toward black; Grid columns draw a faint dotted baseline guide through empty cells (used to mark timescale boundaries).
Types ¶
type ChartStyle ¶
type ChartStyle struct {
Heat func(float64) lipgloss.Color
FadeAge bool // bloom: older columns melt into the background
Grid map[int]bool // columns marked true get a faint vertical guide
}
ChartStyle tunes BrailleChart rendering.
type Config ¶
type Config struct {
Version string
Demo bool
IngestAddr string
PollEvery time.Duration // sampling cadence; anchors the chart timescale
Prober Prober // nil disables manual probing
// FeedErr receives one message if the ingest endpoint dies after startup.
// nil (or silent) means it is up: stderr is invisible under the alternate
// screen, so without this in-band signal the UI would advertise a dead
// endpoint forever.
FeedErr <-chan string
}
Config wires the dashboard to its data source.