{
const width = 600,
height = 500;
const pack = d3
.pack()
.size([width, height])
.padding(options.padSize);
const hierarchy = d3.hierarchy(data).sum(d => d.value);
if (options.sortFlag == "Sorted") hierarchy.sort((a, b) => b.value - a.value);
const root = pack(hierarchy);
const svgNode = DOM.svg(width, height);
const svg = d3.select(svgNode);
svg
.append('g')
.selectAll("circle")
.data(root.leaves())
.join('circle')
.attr('transform', d => `translate(${d.x},${d.y})`)
.attr('r', d => d.r)
.style("fill", "steelblue")
.style("stroke", "none");
svg
.append("circle")
.datum(root)
.attr('transform', d => `translate(${d.x},${d.y})`)
.attr("r", d => d.r)
.style("fill", "none")
.style("stroke", "black");
return svgNode;
}