s="va">x</span>, 
                                 pol.y <span class="op">=</span> <span class="va">pol</span><span class="op">$</span><span class="va">y</span><span class="op">)</span>
<span class="op">)</span></code></pre></div>
<p>If at least one polygon is beneath the mouse cursor, we locate the corresponding row in the input data and extract information to display in the tooltip. In the situation where there are more than one polygon overlapping, we get the information for the polygon that is plotted l