function circlePct(datum, {
axis = [25, 50, 75, 100],
size = 400,
strokeAxis = '#00b8b8',
axisLabelsFill = '#00b8b8',
circleFill = '#de3d83',
valueFill = '#e4bd0b'
} = {}) {
const svg = d3.create("svg").attr("width", size).attr("height", size + 20);
const sqrtScale = d3.scaleSqrt()
.domain([0, 100])
.range([0, 200]);
svg.append('g')
.attr('class', 'axis-wrap')
.selectAll('circle')
.data(axis)
.join('circle')
.attr('r', d => sqrtScale(d))
.attr('cx', size / 2)
.attr('cy', size / 2)
.style('fill', 'none')
.style('stroke', strokeAxis)
.style('opacity', 0.5);
svg.append('g')
.attr('class', 'axis-labels-wrap')
.selectAll('text')
.data(axis)
.join('text')
.attr('x', size / 2)
.attr('y', d => size / 2 + sqrtScale(d) + 5)
.style('text-anchor', 'middle')
.style('fill', axisLabelsFill)
.text(d => d + '%');
svg.append('circle')
.attr('cx', size / 2)
.attr('cy', size / 2)
.style('fill', circleFill)
.style('opacity', 0.9)
.attr('r', sqrtScale(datum));
svg.append('text')
.attr('x', size / 2)
.attr('y', size / 2 + 12)
.style('text-anchor', 'middle')
.style('font-size', '48px')
.style('fill', valueFill)
.text(datum + '%');
return svg.node();
}