For example, on this webpage there are two htmlwidgets (a leaflet and a DataTable).
I would like to create a local R Markdown HTML document that embeds one of these htmlwidgets by directly linking to them, like when you embed a YouTube video via an iframe.
Any idea?
What I've tried so far is
---
title: "Test Embedded"
output:
html_document:
css: styles.css
---
<!-- http://stackoverflow.com/questions/11122249/scale-iframe-css-width-100-like-an-image -->
<div class="h_iframe">
<!-- a transparent image is preferable -->
<p><img class="ratio" src="http://placehold.it/16x12"/> <iframe src="https://r-in-grenoble.github.io/members.html#htmlwidget-21bab010f9ed250fc856" style="border: 0" frameborder="0" scrolling="no"></iframe></p>
</div>
where styles.css
contains
html,body {height:100%;}
.wrapper {width:100%;height:100%;margin:0 auto;background:#CCC}
.h_iframe {position:relative;}
.h_iframe .ratio {display:block;width:100%;height:auto;}
.h_iframe iframe {position:absolute;top:0;left:0;width:100%; height:100%;}
Yet, it seems to embed the whole webpage, not only the corresponding htmlwidget.