This is an issue that I always wanted to investigate but haven't gotten around to solving yet: The tooltips for contour lines in a plot like this can be very useful in the Notebook interface:
ContourPlot[3 x y^2 - x^3, {x, -1, 1}, {y, -1, 1},
ContourShading -> False, Contours -> Table[r^3, {r, -1.4, 1.4, .1}]]
However, when I export the Notebook containing the plot as an HTML file, I get the following image:
It appears to have tooltips, as the screen shot shows (the mouse arrow isn't captured, but the yellow tooltip is). However, those tooltips are generated by an image map that defines some very inaccurate target areas for the contour values to be displayed when the mouse hovers over them. The result is worse than having no tooltips at all, because the displayed values are plain wrong and hence confusing most of the time. To see the exported HTML in real life, look at this URL exported from Mathematica 7 (version 8 does the same thing, I've just had this problem for a long time...).
My first question would be: what is the best way to disable the use of image maps in the HTML generated by the Save As HTML
operation? My current thought is that I'll have to post-process the generated HTML file to remove the usemap
part of all image tags. But maybe someone knows a better way.
I would also like to keep the tooltips for the graphics in the Notebook.
The second question is how one could export a plot like the above so that it can be used in a HTML file while preserving correct tooltips. Here, my thought would be to export to SVG
and add the tooltips to the generated lines in a post-processing step (the SVG
file seems to contain enough information to allow this). However, I'm again hoping that someone has a better idea.