moved width and height and svg construction into javascript