added custom gravity function support to the force layout.