I am somewhat of a noob to SVG, but I\'ve been playing with D3 and have started to undestand the basics.
What I am trying to achieve is to take a square image and cr
If you want to generate the same html code as in @Thomas's answer programmatically with D3 you can do the following:
var svg = d3.select("body").append("svg")
.attr("width", "100%")
.attr("height", "100%");
svg.append("clipPath")
.attr("id", "clipCircle")
.append("circle")
.attr("r", 50)
.attr("cx", 50)
.attr("cy", 50);
svg.append("rect")
.attr("width", 100)
.attr("height", 100)
.attr("clip-path", "url(#clipCircle)");