I’m trying to put some html into svg via foreignObject
via d3 in a notebook.
The d3 docs (here) say that I need to use the namespace
method to do this. But I’m not smart enough to tell from the docs exactly how to use namespace
method in this particular case.
Say I have a cell in my notebook like this:
{
const svg = d3.create("svg")
.append("foreignObject")
.attr("width", 300)
.attr("height", 100)
.append("xhtml:div")
.html("<table><thead><th>A</th><th>B</th></thead></table>");
return svg.node()
}
Where exactly in this code do I need to add d3.namespace()
to make it work??? And what argument do I need to pass to d3.namespace()
?