tikibar icon indicating copy to clipboard operation
tikibar copied to clipboard

Stacks deeper than 30 function calls are not displayed properly

Open ebpitts opened this issue 8 years ago • 2 comments

You can see that the raw data is there if you export the tikibar data as json, but functions beyond the lowest thirty are not displayed when you look at the flamegraph in tikibar.

ebpitts avatar Oct 23 '17 21:10 ebpitts

I think the problem is with the height of the flamegraph component. Height is set to 540, and the JS calculates the position of the bar for the function call based on the height of each box on the total height of the component, and the functions at the top end up being outside the visible space. For example, this is a HTML component for an non visible function call: <g transform="translate(437.39583333333326,-342)" width="46.04166666666666" height="18" name="function" class="frame"><rect width="46.04166666666666" height="18" fill="rgb(239,68,16)" style="visibility: visible;"></rect><foreignObject width="46.04166666666666" height="18"><div class="label" style="display: block;">functions</div></foreignObject></g>

Notice the negative value on transform="translate(437.39583333333326,-342)

eb-enzo avatar Oct 24 '17 14:10 eb-enzo

For reference, this is the calculation on the library: https://github.com/spiermar/d3-flame-graph/blob/master/src/d3.flameGraph.js#L336

eb-enzo avatar Oct 24 '17 14:10 eb-enzo