Is there any accurate way to get the real size of a svg element that includes stroke, filters or other elements contributing to the element\'s real size from within Javascri
Here is an example using D3.js:
Starting with a div:
The javascript code looks like this:
var myDiv = d3.select('div');
var mySvg = myDiv.append('svg');
var myPath = mySvg.append('path');
myPath.attr({
'fill': '#F7931E',
'd': 'M37,17v15H14V17H37z M50,0H0v50h50V0z'
});
// Get height and width.
console.log(myPath.node().getBBox());