I have the the following code that successfully draws my text onto an SVG using d3.js:
var myRect = svgContainer.append("text")
.attr("x", 10)
.attr("y", 20)
.text("Lorem Ipsum")
.attr("font-weight", "bold")
.attr("fill", "white");
Now I want to get the bounding box of that text. How do I do it?? I tried the following:
console.log("getBBox = ", myRect.getBBox());
But it gave me this error:
Uncaught TypeError: myRect.getBBox is not a function