Graph coloring in HTML5+js using django