(c vg.Canvas, v XY)
| 161 | } |
| 162 | |
| 163 | func drawVector(c vg.Canvas, v XY) { |
| 164 | if math.Hypot(v.X, v.Y) == 0 { |
| 165 | return |
| 166 | } |
| 167 | // TODO(kortschak): Improve this arrow. |
| 168 | var pa vg.Path |
| 169 | pa.Move(vg.Point{}) |
| 170 | pa.Line(vg.Point{X: 1, Y: 0}) |
| 171 | pa.Close() |
| 172 | c.Stroke(pa) |
| 173 | } |
| 174 | |
| 175 | // DataRange implements the DataRange method |
| 176 | // of the plot.DataRanger interface. |