score:0

i am going to guess it's because of this dimple method, "dimple._parentheight". it calculates the height of the parent element of the svg and has a workaround for a firefox issue, so you could see a difference based on the container of the svg (body, in this instance) having or not having another element in it.

your best bet (and what i've done for a similar reason) is to wrap the svg inside a div which will compute the height correctly :

       var svg = d3.select("body")
        .append("div")
        .append("svg")

Related Query