GlyphBoxes implements the GlyphBoxes method of the plot.GlyphBoxer interface.
(plt *plot.Plot)
| 198 | // GlyphBoxes implements the GlyphBoxes method |
| 199 | // of the plot.GlyphBoxer interface. |
| 200 | func (f *Field) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox { |
| 201 | c, r := f.FieldXY.Dims() |
| 202 | b := make([]plot.GlyphBox, 0, r*c) |
| 203 | for i := range c { |
| 204 | for j := range r { |
| 205 | b = append(b, plot.GlyphBox{ |
| 206 | X: plt.X.Norm(f.FieldXY.X(i)), |
| 207 | Y: plt.Y.Norm(f.FieldXY.Y(j)), |
| 208 | Rectangle: vg.Rectangle{ |
| 209 | Min: vg.Point{X: -5, Y: -5}, |
| 210 | Max: vg.Point{X: +5, Y: +5}, |
| 211 | }, |
| 212 | }) |
| 213 | } |
| 214 | } |
| 215 | return b |
| 216 | } |