update weightGraph to support resize.