GlyphBoxes implements the GlyphBoxes method of the plot.GlyphBoxer interface.
(plt *plot.Plot)
| 256 | // GlyphBoxes implements the GlyphBoxes method |
| 257 | // of the plot.GlyphBoxer interface. |
| 258 | func (h *HeatMap) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox { |
| 259 | c, r := h.GridXYZ.Dims() |
| 260 | b := make([]plot.GlyphBox, 0, r*c) |
| 261 | for i := range c { |
| 262 | for j := range r { |
| 263 | b = append(b, plot.GlyphBox{ |
| 264 | X: plt.X.Norm(h.GridXYZ.X(i)), |
| 265 | Y: plt.Y.Norm(h.GridXYZ.Y(j)), |
| 266 | Rectangle: vg.Rectangle{ |
| 267 | Min: vg.Point{X: -5, Y: -5}, |
| 268 | Max: vg.Point{X: +5, Y: +5}, |
| 269 | }, |
| 270 | }) |
| 271 | } |
| 272 | } |
| 273 | return b |
| 274 | } |