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

Method setStockRange

plotter/sankey.go:326–342  ·  view source on GitHub ↗

setStockRange sets the minimum and maximum values of the stock plotting locations.

(stocks *[]*stock)

Source from the content-addressed store, hash-verified

324
325// setStockRange sets the minimum and maximum values of the stock plotting locations.
326func (s *Sankey) setStockRange(stocks *[]*stock) {
327 var cat int
328 var min float64
329 for _, stk := range *stocks {
330 if stk.category != cat {
331 min = 0
332 }
333 cat = stk.category
334 stk.min = min
335 if stk.sourceValue > stk.receptorValue {
336 stk.max = stk.min + stk.sourceValue
337 } else {
338 stk.max = stk.min + stk.receptorValue
339 }
340 min = stk.max
341 }
342}
343
344// bezier creates a bezier curve between the begin and end points.
345func (s *Sankey) bezier(begin, end vg.Point) []vg.Point {

Callers 1

NewSankeyFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected