Javascript chord graph generator