An anchor is a function that takes a node and an edge, and returns a function that is used to calculate the anchor point. That function takes the anchor point - the point that the function will manipulate and a reference point, which is used by the anchor function to determine where to locate the anchor.
The "this" pointer for an anchor function is always the display
function centerAnchor(edge,node) {
return function(anchorPoint,referencePoint) {
anchorPoint.set(this.position(node));
};
}