The name of the check box is viewof grouped and the value of that check box is grouped. If you examine the code, you’ll notice a block that looks like so:
if (grouped) svg.append("g")
.attr("fill", "none")
.attr("stroke", "#ccc")
.selectAll("circle")
.data(root.descendants().filter(d => d.height === 1))
.join("circle")
.attr("cx", d => d.x)
.attr("cy", d => d.y)
.attr("r", d => d.r);
Thus (to answer your question directly), the part after if (grouped) is exactly the portion that draws the circles. That’s a pretty standard D3 selection/join technique. The fact that code is called in response to the check box is handled by the Observable runtime.
How you set this all up in a vanilla HTML environment depends on how you chose to set up the overall structure in the first place. I guess that’s why mootari says that “It’s easier to explain if you can share your current code.”