Thumbnail fulfills the plot.Thumbnailer interface.
(c *draw.Canvas)
| 446 | |
| 447 | // Thumbnail fulfills the plot.Thumbnailer interface. |
| 448 | func (t sankeyFlowThumbnailer) Thumbnail(c *draw.Canvas) { |
| 449 | // Here we draw the fill. |
| 450 | pts := []vg.Point{ |
| 451 | {X: c.Min.X, Y: c.Min.Y}, |
| 452 | {X: c.Min.X, Y: c.Max.Y}, |
| 453 | {X: c.Max.X, Y: c.Max.Y}, |
| 454 | {X: c.Max.X, Y: c.Min.Y}, |
| 455 | } |
| 456 | poly := c.ClipPolygonY(pts) |
| 457 | c.FillPolygon(t.Color, poly) |
| 458 | |
| 459 | // Here we draw the upper border. |
| 460 | pts = []vg.Point{ |
| 461 | {X: c.Min.X, Y: c.Max.Y}, |
| 462 | {X: c.Max.X, Y: c.Max.Y}, |
| 463 | } |
| 464 | outline := c.ClipLinesY(pts) |
| 465 | c.StrokeLines(t.LineStyle, outline...) |
| 466 | |
| 467 | // Here we draw the lower border. |
| 468 | pts = []vg.Point{ |
| 469 | {X: c.Min.X, Y: c.Min.Y}, |
| 470 | {X: c.Max.X, Y: c.Min.Y}, |
| 471 | } |
| 472 | outline = c.ClipLinesY(pts) |
| 473 | c.StrokeLines(t.LineStyle, outline...) |
| 474 | } |
nothing calls this directly
no test coverage detected