R markdown - including svg image with tooltips generated using RSVGTipsDevice

I want to add an svg image to a .Rmd document. Svg is created using the RSVGTipsDevice package, since I want the image to have some tooltips. The problem is that after the image has been included in the generated HTML document, tooltips no longer work. Although they work correctly when I open svg in the browser ( link to the image , hover over the red rectangle to see a tooltip).

http://www.gridhub.uni-bremen.de/public/pics/plot.svg

Here is the complete .Rmd code:

 ```{r} library(RSVGTipsDevice) devSVGTips("plot.svg", toolTipMode=1) plot(0, type="n") setSVGShapeToolTip("A rectangle","it is red") rect(.1,.1,.4,.6, col='red') dev.off() ``` ![alt text](plot.svg) 

The question arises: how to make tooltips work?

+7
r svg knitr
source share
1 answer

Does my comment help? To be clear, the part ![alt text](plot.svg) becomes <img src="plot.svg"> , which is not the right way to enable svg. To prove this, I provided output as well .

+2
source share

All Articles