basic code for mouse reactions on graph panel