MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / _getLimits

Method _getLimits

graphs/gui/canvasPanel.py:298–313  ·  view source on GitHub ↗
(vals, minExtra=0, maxExtra=0)

Source from the content-addressed store, hash-verified

296
297 @staticmethod
298 def _getLimits(vals, minExtra=0, maxExtra=0):
299 minVal = min(vals, default=0)
300 maxVal = max(vals, default=0)
301 # Extend range a little for some visual space
302 valRange = maxVal - minVal
303 minVal -= valRange * minExtra
304 maxVal += valRange * maxExtra
305 # Extend by % of value if we show function of a constant
306 if minVal == maxVal:
307 minVal -= minVal * 0.05
308 maxVal += minVal * 0.05
309 # If still equal, function is 0, spread out visual space as special case
310 if minVal == maxVal:
311 minVal -= 5
312 maxVal += 5
313 return minVal, maxVal
314
315 @staticmethod
316 def _interpolateX(x, x1, y1, x2, y2):

Callers 1

drawMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected