sort graphic direction and space