Fix ordering by weight on graphs page
