pycallgraph2 icon indicating copy to clipboard operation
pycallgraph2 copied to clipboard

meaning of different colored boxes

Open vainaixr opened this issue 5 years ago • 1 comments

what is the meaning of different colored boxes, and what is the difference between them?

vainaixr avatar Aug 20 '19 14:08 vainaixr

The colored boxes are a rough indication of both the time spent on the method, and the number of times that method was called. The script uses a formula to calculate a (hue, saturation, value) code that is transformed to rgb.

Broadly, the scale goes from gray/light blue -> purple -> pink based on how much time that method took as a fraction of the entire time.

You can see this calculation in the output.py code:

    def node_color(self, node):
        value = float(node.time.fraction * 2 + node.calls.fraction) / 3
        return Color.hsv(value / 2 + .5, value, 0.9)

    def edge_color(self, edge):
        value = float(edge.time.fraction * 2 + edge.calls.fraction) / 3
        return Color.hsv(value / 2 + .5, value, 0.7)

daneads avatar Aug 26 '19 22:08 daneads