How to use 'getdatarange' in Go

Every line of 'getdatarange' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Go code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
368func (s *Sankey) DataRange() (xmin, xmax, ymin, ymax float64) {
369 catMin := math.Inf(1)
370 catMax := math.Inf(-1)
371 for cat := range s.stocks {
372 c := float64(cat)
373 catMin = math.Min(catMin, c)
374 catMax = math.Max(catMax, c)
375 }
376
377 stocks := s.stockList()
378 valMin := math.Inf(1)
379 valMax := math.Inf(-1)
380 for _, stk := range stocks {
381 valMin = math.Min(valMin, stk.min)
382 valMax = math.Max(valMax, stk.max)
383 }
384 return catMin, catMax, valMin, valMax
385}
180func (e ErrorBars) xDataRange() (xmin, xmax float64) {
181 xmin, xmax = Range(XValues{e})
182 xerr, ok := e.XYer.(XErrorer)
183 if !ok {
184 return
185 }
186 for i := 0; i < e.Len(); i++ {
187 x := e.X(i)
188 errlow, errhigh := xerr.XError(i)
189 xmin = math.Min(xmin, x+errlow)
190 xmax = math.Max(xmax, x+errlow)
191 xmin = math.Min(xmin, x+errhigh)
192 xmax = math.Max(xmax, x+errhigh)
193 }
194 return
195}

Related snippets