We can demonstrate basic interactivity in gridSVG by drawing a plot that produces tooltips. These tooltips appear whenever the mouse hovers over a graphical element in the plot and the text within the tooltip features the name of the grid graphics object that produced the element.
This tooltip demonstration was largely borrowed from Paul
specifically with regards to the
addTooltips() function. A few modifications
were made to the implementation of
addTooltips(), mostly with regards to the
onmousemove event attribute instead of
One of the demos from the lattice package has been drawn, upon drawing we apply
addTooltips() function to add tooltips to the plot. The effect of this is
that when hovering the mouse over a graphical element in the plot, we can see
the name of the grid graphics object that produced it.