Adding gradient visualization in graphical optimization.