I have a Javascript function that creates a shape in my UI. This function sets up the parts of the shape and draws lines between them, and has methods which can be called to ch