learning to change the display state of an object and rendering the image in canvas