add graph function for compatibility with previous version