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")
Source: stackoverflow.com
Related Query
- Why does a <h2> Header clip the succeeding SVG element?
- Why does this D3 code add the <p> element outside the body, instead of inside it?
- Why do the SVG properties of an SVG element sometimes show up as accessible and sometimes not?
- SVG ds.js - why does an append operation on defs modifies the data binding of svg selectAll
- Why is my D3 SVG not getting the correct width/height from Angular element
- d3.js - Why does my SVG tags get added inside the HTML tag
- Why does the text not appear inside the svg rects
- Why are the .selectAll() D3-created circles in my SVG said to be 1 element using .length?
- Why does the whole SVG disappear when I set map opacity to 0 in D3?
- How to access the DOM element that correlates to a D3 SVG object?
- How do I get the width of an svg element using d3js?
- SVG element loses event handlers if moved around the DOM
- mouseout/mouseleave gets fired when mouse moves INSIDE the svg path element
- Renderer2 does not render SVG element while using d3 js - Angular 4
- Why is the d3.js group element hopping at first drag?
- duplicating the whole svg element using d3.js
- Why does this SVG graphic bog down Webkit only when it's large?
- Why does this syntax work over the other one with d3.json requests?
- Rotate element thrown outside the SVG
- Why does a CSS transform,translate change the rotation for rotated elements?
- Why does rotating element make it bounce?
- What is the fastest way to get SVG element given a position (x,y)?
- D3.js Right click opens popup but does not affect the source svg when pop up closed
- Why does fill opacity change the shade of fill?
- Why does converting a negative string into a number ( +"-2.333" ) return NaN, only when the string came from d3.format function?
- Why d3.domain() has only one element when I use the whole data array as domain?
- Why isn't my text displaying in the svg axis label? (D3 Margin Convention)
- Why does the callback function called at the end and how to test the function?
- Target SVG path to the middle of rect element
- Using d3.behavior.drag, How to keep a drag image visible outside of the svg element
More Query from same tag
- Using D3 and blobs to render svg to image
- D3.js: Discontinuous Time Scales (Financial Data)
- How to show many links separate by value in D3.js forced directed graph
- How do I disable my zoom functionality in D3.js?
- Angular nvD3 Stacked Area Chart Data Series Format
- nvd3.js How to disable tooltips for one serie only
- TypeError: Cannot read property 'bar' of undefined
- How to set one label to the entire line of a graphic
- How to display "pie chart unavailable" message when all the data is 0 in a pie chart?
- Bring <path> to front on hover (when obscured by other element)
- _.sortBy object key value for d3 chart
- Limit drag area each node d3.js
- D3 graph example
- Desired label in center of pie chart not rendering DC/D3.js
- how to return values from python to html and vice versa
- Cubism callback array seemingly replaced
- d3.js - blank object when applying y-axis scale
- Rails, RequireJS, C3.js: c3 is undefined
- Img.onload not firing when dynamically setting src to dataURI
- Reorder elements of SVG ( z-index ) in D3.js
- Angular 2 & d3: How to call this when function this exists
- Canvas image data on retina display (MPB)
- D3: use .map() to rearrange an array of data
- Pie Chart not rendering in dashboard area using D3 v5
- Add count beside bar graph d3js
- MPLD3: label information of barplot
- CSV to D3: summing over values for multiple links
- Animating angular d3 donut on load
- D3v4 timeParse always returns null
- I am searching for way to customize Y-Axis in recharts react library?