add callback attribute to calculatePosition for self-build.