I've come across a challenge while working with d3.js to draw text onto an SVG using the following code:
var myText = svgContainer.append("text")
.attr("x", 10)
.attr("y", 20)
.text("Lorem Ipsum")
.attr("font-weight", "bold")
.attr("fill", "white");
Now, I need to find the bounding box of this text. How can I achieve this? I attempted the following:
console.log("getBBox = ", myText.getBBox());
However, it resulted in this error message:
Uncaught TypeError: myText.getBBox is not a function