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

Method Thumbnail

plotter/sankey.go:448–474  ·  view source on GitHub ↗

Thumbnail fulfills the plot.Thumbnailer interface.

(c *draw.Canvas)

Source from the content-addressed store, hash-verified

446
447// Thumbnail fulfills the plot.Thumbnailer interface.
448func (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}

Callers

nothing calls this directly

Calls 4

ClipPolygonYMethod · 0.80
FillPolygonMethod · 0.80
ClipLinesYMethod · 0.80
StrokeLinesMethod · 0.80

Tested by

no test coverage detected