added R graphic, added viewport clamping for tooltip