Implement functions for visualization.