{
const svg = d3.create('svg').attr('id','svg-vis1').attr('class', 'svg-vis').attr("viewBox", [0, 0, width, height]).style('background', background)
const groups = svg.selectAll('g').data(plastic_dataset_sorted).enter().append('g').attr('transform', x => `translate(${width*0.1},${height/2}) rotate(${arc_scaler(x.place)} ${0} ${0})`)
groups.append('path').attr('d', x => {
const stem = stem_scaler(x.mpw_oceans_2021)+1
const p_width = leaf_scaler(x.mpw_2021)+3
return `M 0 -${inner_radius} C -${0} -${stem-p_width} -${p_width}
-${stem-p_width} -${p_width} -${stem} C -${p_width} -${stem+p_width*1.3} ${p_width} -${stem+p_width*1.3} ${p_width} -${stem} C ${p_width} -${stem-p_width} 0 -${stem-p_width} 0 -${inner_radius}`
}).style("fill",petal_color).attr('stroke', stroke_line).attr('stroke-width', 0.5).attr('opacity', 0.8)
// return `M 0 -${inner_radius} L 0 -${total_len}`
// }).attr('stroke-width', 0.7)
// .style("stroke", stroke_line)
// // .style("stroke-dasharray", ("0.4,0.4"))
// groups.append('g').attr('transform', `rotate(${-90}, 0, 0)`).append('circle')
// .attr("cx", x => stem_scaler(x.mismanaged_pw_capita) + total_pw_scaler(x.pw_total) + leaf_scaler(x.mismanaged_pw_total) + 10)
// .attr("cy", 0)
// .attr("r", x => total_pw_scaler(x.pw_total))
// .attr('stroke-width', 0.4)
// .style("fill",pw_total_color)
// .attr("opacity", 0.5)
// .style("stroke", "gray").style("stroke-dasharray", ("0.4,0.4"))
// groups.append('text').attr('transform', `rotate(${-90})`).attr('x', x => {
// let total_pw_len = total_pw_scaler(x.pw_total) ? total_pw_scaler(x.pw_total) : 1
// let total_len = stem_scaler(x.mismanaged_pw_capita) + total_pw_len*2 + leaf_scaler(x.mismanaged_pw_total) + 30
// return total_len
// }).attr('y', 3).text(x => x.Entity).style('font-size', '0.65rem').attr('text-anchor', 'start').style('font-family',"Roboto").attr('fill', text_color)
// // circle markers
// groups.append('circle').attr('transform', `rotate(${-90}, 0, 0)`)
// .attr("cx", x => stem_scaler(x.mismanaged_pw_capita))
// .attr("cy", 0)
// .attr("r", x => leaf_scaler(x.mismanaged_pw_total))
// .attr('stroke-width', 1)
// .style("fill",'black')
// .attr("opacity", 0.5)
// // .style("stroke", "gray")
// groups.append('circle').attr('transform', `rotate(${-90}, 0, 0)`)
// .attr("cx", x => stem_scaler(x.mismanaged_pw_capita) + total_pw_scaler(x.pw_total) + leaf_scaler(x.mismanaged_pw_total) + 10)
// .attr("cy", 0)
// .attr("r", 1)
// .style("fill",'black')
// .attr("opacity", 1)
// groups.append('circle').attr('transform', `rotate(${-90}, 0, 0)`)
// .attr("cx", x => stem_scaler(x.mismanaged_pw_capita))
// .attr("cy", 0)
// .attr("r", 1)
// .style("fill",'white')
// .attr("opacity", 0.6)
// groups.append('circle').attr('transform', `rotate(${-90}, 0, 0)`)
// .attr('cx', x => {
// let total_pw_len = total_pw_scaler(x.pw_total) ? total_pw_scaler(x.pw_total) : 1
// let total_len = stem_scaler(x.mismanaged_pw_capita) + total_pw_len*2 + leaf_scaler(x.mismanaged_pw_total) + 20
// return total_len
// })
// .attr("cy", 0)
// .attr("r", 1)
// .style("fill",'black')
// .attr("opacity", 1)
// svg.append("circle")
// .attr('cx', 100)
// .attr('cy', 200)
// .attr("r", 100)
// .style("fill", t.url());
// svg.append("circle")
// .attr('cx', 100)
// .attr('cy', 30) transform-origin: center;
// .attr("r", 30)
// .style("fill", z.url());
// const g = svg.append('g').attr('transform', `translate(${25}, ${25}}`)
// g.append('path').attr("transform", `translate(${25}, ${25}) rotate(20, 0, 0)`).attr('d',`M 0 0 C 0 -${stem-2} -${p_width}
// -${stem-p_width} -${p_width} -${stem} C -${p_width} -${stem+p_width*1.2} ${p_width} -${stem+p_width*1.2} ${p_width} -${stem} C ${p_width} -${stem-p_width} 0 -${stem-2} 0 0`).style("fill",'tomato')
// M 0 0 C 0 -${stem} -${p_width} -5 -2 -7 C -2 -10 2 -10 2 -7 C 2 -5 0 -2 0 0
return svg.node()
}