add some events for surface plot
some refactoring