Skip to content

Commit

Permalink
fix: hidden root node
Browse files Browse the repository at this point in the history
This fixes a regression from 894b2c3 that
caused the root node of all graphs to be hidden by being rendered
outside of the visible SVG area.
  • Loading branch information
felixge committed Oct 29, 2019
1 parent 1f580a8 commit c56f3e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/flamegraph.js
Expand Up @@ -379,7 +379,7 @@ export default function () {
g.transition()
.duration(transitionDuration)
.ease(transitionEase)
.attr('transform', function (d) { return 'translate(' + x(d.x0) + ',' + (inverted ? y(d.depth) : (h - y(d.depth))) + ')' })
.attr('transform', function (d) { return 'translate(' + x(d.x0) + ',' + (inverted ? y(d.depth) : (h - y(d.depth)) - c) + ')' })

g.select('rect')
.transition()
Expand All @@ -389,7 +389,7 @@ export default function () {

var node = g.enter()
.append('svg:g')
.attr('transform', function (d) { return 'translate(' + x(d.x0) + ',' + (inverted ? y(d.depth) : (h - y(d.depth))) + ')' })
.attr('transform', function (d) { return 'translate(' + x(d.x0) + ',' + (inverted ? y(d.depth) : (h - y(d.depth) - c)) + ')' })

node.append('svg:rect')
.transition()
Expand Down

0 comments on commit c56f3e4

Please sign in to comment.