I've got some data inside WASM C++ code that needs to be displayed. The display is static, so binding isn't super important. I'm curious about runtime of two ways of doing this (and any other factor folks think worthy of consideration). Two options are: for the C++ code to put the data in a JavaScript array (call it theData) and then call something like
svg.selectAll("bars")
.data(theData)
.enter()
.append("rect")
.attr("x", ...)
.attr("y", ...)
.attr("width", ...)
.attr("height", ...)
OR should the WASM code call a JS function to generate each element:
function newRect(x, y, width, height) {
svg.append("rect")
.attr("x", x)
.attr("y", y)
.attr("width", width)
.attr("height", height)
}