chart = {
const width = 928;
const height = 928;
const grid_length = Math.ceil(Math.sqrt(grid_count))
const grid_base_length = calculate_triangle_base_count(grid_count)
const radius = (width/grid_base_length)/2
let circle_counter = 1
console.log("great")
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height])
.attr("width", width)
.attr("height", height)
.attr("style", "max-width: 100%; height: auto; background-color:whitesmoke;");
svg
.selectAll("circle")
.data(d3.range(grid_count))
.join("circle")
.attr("cx", d => {
d = d+1
let output = ((circle_counter-d)*(radius*2) )
console.log(d, circle_counter)
if (d+1 == circle_counter) {
circle_counter = circle_counter + d+1
console.log("ff",d, circle_counter)
}
return output
})
.attr("cy", d => { return ((d+1)%(grid_base_length+2))*(radius*2)})
.attr("r", radius - margin)
.attr("fill", "#001b42");
return svg.node();
}