3d graph visualization code