final javascripts for graphs and shapes