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

Method visibleCapacity

widgets/heatmap/heatmap.go:388–406  ·  view source on GitHub ↗
(size image.Point)

Source from the content-addressed store, hash-verified

386}
387
388func (hp *HeatMap) visibleCapacity(size image.Point) int {
389 if len(hp.values) == 0 || hp.opts == nil {
390 return 0
391 }
392 yDetails, _ := axes.NewYDetails(hp.yLabels)
393 graphWidth := size.X - yDetails.Width
394 graphHeight := size.Y
395 if len(hp.xLabels) > 0 {
396 graphHeight--
397 }
398 if graphWidth <= 0 || graphHeight <= 0 {
399 return 0
400 }
401 cols := graphWidth / hp.opts.cellWidth
402 if cols < 0 {
403 cols = 0
404 }
405 return cols * graphHeight
406}

Callers 1

DrawMethod · 0.95

Calls 1

NewYDetailsFunction · 0.92

Tested by

no test coverage detected