MCPcopy
hub / github.com/mum4k/termdash / renderVizStatus

Function renderVizStatus

termdashdemo/termdashdemo.go:1271–1296  ·  view source on GitHub ↗

renderVizStatus updates the Visualize tab status panel.

(w *text.Text, contacts int, load float64)

Source from the content-addressed store, hash-verified

1269
1270// renderVizStatus updates the Visualize tab status panel.
1271func renderVizStatus(w *text.Text, contacts int, load float64) error {
1272 w.Reset()
1273 label := cell.FgColor(cell.ColorNumber(245))
1274 value := cell.FgColor(cell.ColorNumber(252))
1275 lines := []struct{ k, v string }{
1276 {"Radar contacts: ", fmt.Sprintf("%d active", contacts)},
1277 {"System load: ", fmt.Sprintf("%.0f%%", load)},
1278 {"Threshold line: ", "0.75 (red dashed)"},
1279 {"Heatmap palette:", "7-step thermal blue"},
1280 {"Pie segments: ", "5 bands"},
1281 {"Drag windows: ", "click & drag modal panels"},
1282 }
1283 for i, ln := range lines {
1284 if err := w.Write(ln.k, text.WriteCellOpts(label)); err != nil {
1285 return err
1286 }
1287 nl := "\n"
1288 if i == len(lines)-1 {
1289 nl = ""
1290 }
1291 if err := w.Write(ln.v+nl, text.WriteCellOpts(value)); err != nil {
1292 return err
1293 }
1294 }
1295 return nil
1296}
1297
1298// ─────────────────────────────────────────────────────────────────────────────
1299// Tab 4 – Explorer (catalog · live previews · timeline scrubber)

Callers 2

newVisualizeTabFunction · 0.85
animateVisualizeFunction · 0.85

Calls 5

FgColorFunction · 0.92
ColorNumberFunction · 0.92
WriteCellOptsFunction · 0.92
ResetMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected