Implementing scroll operation on the diagram