Interactive graph demonstration using a modified version of B. Rowlingson's imagemap package:

This demo creates a plot of life expectancy versus high-school graduation rate by state from the 1977 US census data (a dataset that comes with R). Position the mouse pointer over the datapoint to see what state the datapoint came from.

# First, we generate the plot and imagemap.
source(RpadBaseFile('imagemap.R'))
data(state)
im = imagemap("Plot", width = 500, height = 400) 

# make a graph
plot(state.x77[,"Life Exp"], state.x77[,"HS Grad"], 
     xlab = "Life expectancy, years", 
     ylab = "High-school graduation rate, percent",
     pch=20
)

# make the image map boundaries
for (i in seq(along = state.name))
    addRegion(im) = imPoint( 
        state.x77[i,"Life Exp"], 
        state.x77[i,"HS Grad"], .1, 1, 
        onmouseover = 
            paste("javascript:document.getElementById('results').innerHTML ='",
                  HTMLh3(state.name[i]), "';", sep="")
    ) 
dummy = capture.output(imClose(im)) # the capture.output is just to hide the output

#Now, we can make the HTML for display:

HTMLon() 
HTMLtag("span", contenteditable="false")

# Create a DIV to display the interactive updates.
# The result is absolutely positioned relative to the graphic.
# Use top & left to adjust the position.
HTMLtag("span", id="results")
HTMLh3(" ")
HTMLetag("span")

# display the image with the imagemap
createIM(im) 

HTMLetag("span")