Adjacency matrix represented graph drawing with HTML5 canvas