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

Method DataRange

plotter/sankey.go:365–382  ·  view source on GitHub ↗

DataRange implements the plot.DataRanger interface.

()

Source from the content-addressed store, hash-verified

363
364// DataRange implements the plot.DataRanger interface.
365func (s *Sankey) DataRange() (xmin, xmax, ymin, ymax float64) {
366 catMin := math.Inf(1)
367 catMax := math.Inf(-1)
368 for cat := range s.stocks {
369 c := float64(cat)
370 catMin = math.Min(catMin, c)
371 catMax = math.Max(catMax, c)
372 }
373
374 stocks := s.stockList()
375 valMin := math.Inf(1)
376 valMax := math.Inf(-1)
377 for _, stk := range stocks {
378 valMin = math.Min(valMin, stk.min)
379 valMax = math.Max(valMax, stk.max)
380 }
381 return catMin, catMax, valMin, valMax
382}
383
384// GlyphBoxes implements the GlyphBoxer interface.
385func (s *Sankey) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox {

Callers

nothing calls this directly

Calls 3

stockListMethod · 0.95
MinMethod · 0.65
MaxMethod · 0.65

Tested by

no test coverage detected