in pkg/heatmap/heatmap.go [162:186]
func (hp *HeatMap) Draw(cvs *canvas.Canvas, _ *widgetapi.Meta) error {
hp.mu.Lock()
defer hp.mu.Unlock()
// Check if the canvas has enough area to draw HeatMap.
needAr, err := area.FromSize(hp.minSize())
if err != nil {
return err
}
if !needAr.In(cvs.Area()) {
return draw.ResizeNeeded(cvs)
}
xd, yd, err := hp.axesDetails(cvs)
if err != nil {
return err
}
err = hp.drawColumns(cvs, xd, yd)
if err != nil {
return err
}
return hp.drawAxes(cvs, xd, yd)
}