I want to add a reset button in an interactive plotting shiny app. The app does the following thing: Capture the position of the mouse when mouse clicks, draws a red dot on that position and connect all the previous positions with blue lines. If the reset button is pressed, then all the red dots and blue lines should be removed and a new plotting process should begin. However, in practice when I click the reset button, the last red dot is still on the plotting region. I am not sure what goes wrong. Thank you for your help.I want to add a reset button in an interactive