Made some changes in diagram generation. Added Save as SVG option