I have not really added too much else yet, but the logic to restrict the dragging range of the minimap reticle should not be too hard to write. I would suggest that you start by adding some logic to keep the drag position within the bounds you want inside the drag handler with something like this:
...
.on("drag.minimap", function() {
d3.event.sourceEvent.stopImmediatePropagation();
frameX += d3.event.dx;
frameY += d3.event.dy;
// add logic to constrain x/y drag range (assume leftBoundaryX/Y = 0 and reticleWidth is 300 or whatever size you use for the minimap)
frameX = Math.min( (Math.max(frameX, leftBoundaryX), leftBoundaryX+reticleWidth)
frameY = Math.min( (Math.max(frameY, topBoundaryX), topBoundaryX+reticleHeight)
// end constrain logic
frame.attr("transform", "translate(" + frameX + "," + frameY + ")");
var translate = [(-frameX*scale),(-frameY*scale)];
target.attr("transform", "translate(" + translate + ")scale(" + scale + ")");
zoom.translate(translate);
});
I'm just throwing that example out so I'm sure there are some additional details to work out, but maybe that will point you in the right direction. :)