MCPcopy Index your code
hub / github.com/gonum/plot / GlyphBoxes

Method GlyphBoxes

plotter/line.go:148–171  ·  view source on GitHub ↗

GlyphBoxes implements the plot.GlyphBoxer interface.

(plt *plot.Plot)

Source from the content-addressed store, hash-verified

146
147// GlyphBoxes implements the plot.GlyphBoxer interface.
148func (pts *Line) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox {
149 r := 0.5 * pts.LineStyle.Width
150 rect := vg.Rectangle{
151 Min: vg.Point{
152 X: -r,
153 Y: -r,
154 },
155 Max: vg.Point{
156 X: +r,
157 Y: +r,
158 },
159 }
160
161 bs := make([]plot.GlyphBox, pts.XYs.Len())
162 for i := range bs {
163 x, y := pts.XY(i)
164 bs[i] = plot.GlyphBox{
165 X: plt.X.Norm(x),
166 Y: plt.Y.Norm(y),
167 Rectangle: rect,
168 }
169 }
170 return bs
171}
172
173// Thumbnail returns the thumbnail for the Line, implementing the plot.Thumbnailer interface.
174func (pts *Line) Thumbnail(c *draw.Canvas) {

Callers

nothing calls this directly

Calls 3

NormMethod · 0.80
LenMethod · 0.65
XYMethod · 0.65

Tested by

no test coverage detected