Creates and initializes a dynamic canvas element. Optionally attach the element to a parent element.