bg = {
let svg = d3.create("svg")
.attr("width", width)
.attr("height", size * 3.5)
svg.append("rect").attr("width", width).attr("height", size*3.5)
.attr("fill", "#111")
let data = d3.range(100).map(d => {
return {
i: d,
color: d3.schemeCategory10[Math.floor(Math.random() * 10)]
}
})
let n = 10
svg.selectAll("g.logo").data(data)
.enter()
.append("g").classed("logo", true)
.attr("transform", (d,i) => {
return `scale(.5)translate(${10 + (i % n) * (size + 20)}, ${ 10 + Math.floor(i / n) * (size + 20)})`
})
.style("opacity", 0.5)
.each(function(d,i) {
simpleRender(d3.select(this), "dee", d.color)
simpleRender(d3.select(this), "three", d.color)
})
return svg.node()
}