{
const svg = html`<svg width=${width} height=${svgHeight}></svg>`;
const g = d3.select(svg).selectAll("g").data(flowers).enter().append("g").attr('transform', d => `translate(${d.translate})`);
g.selectAll("path")
.data((d) => {
return _.times(d.numPetals, (i) =>
Object.assign({}, d, { rotate: i * (360 / d.numPetals) })
);
})
.enter()
.append('path')
.attr('transform', d=> `rotate(${d.rotate})scale(${d.scale})`)
.attr('d', d=> d.path)
.attr('fill', d=>d.color)
.attr('stroke', d=>d.color)
.attr('fill-opacity', 0.2)
.attr('stroke-width', 2)
g.append('text')
.text(d=> _.truncate(d.title, 18))
.style('font-size', '.57em')
.style('font-style', 'italic')
.attr('text-anchor', 'middle')
.attr('dy', '.35em')
return scrollSVG(svg);
}