Canvas interactive function