(size image.Point)
| 386 | } |
| 387 | |
| 388 | func (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 | } |