Visualize algorithm execution in javascript