{
const area = d3.create('div');
const header = area.append('div');
const g = add_board(area);
const N = 10000;
let cnt_in = 0;
for (let i =0; i<N; i++) {
let [x, y] = random_point_in_square();
let color = 'blue'
if (x*x + y*y <= 1) {
color = 'red';
cnt_in += 1;
}
add_point(g, {x, y}, color);
}
add_square_frame(g);
header.text(`Ratio: ${cnt_in} / ${N} = ${cnt_in / N}`);
return area.node();
}