Plotly: Embeding Html extract into a different html doesn't work

Created on 26 Jul 2016  路  4Comments  路  Source: ropensci/plotly

I have created a boxplot graph using plotly and did html extract using this
htmlwidgets::saveWidget(as.widget(ggp), "working/directory/index.html").
this created a index.html and a directory called index_files.

Now I'm trying to embed this in home.html using <div><embed src="index.html"></div> it's showing a blank page.
It works only if redirect to a new page using <a href="index.html">index</a>.

Most helpful comment

Is there a reason you are not using <iframe src = "index.html"></iframe>? I don't think this is an issue with plotly.

All 4 comments

Is there a reason you are not using <iframe src = "index.html"></iframe>? I don't think this is an issue with plotly.

I am developing a single page application. so i don't want to navigate to a different page.
I have tried all different ways to embed in a div all result in same blank.
I tried this
<div id="htmlwidget_container"> <h1>Heelloo</h1> <div id="htmlwidget-6956" style="width: 100%; height: 400px;" class="plotly html-widget"></div> </div>
I can see the H1 but not the div.

Have you tried doing this with any other htmlwidgets? If you can't get it to work for other htmlwidgets, I would post an issue here -- https://github.com/ramnathv/htmlwidgets

<iframe src = "index.html"></iframe> is working thank you @timelyportfolio

Was this page helpful?
0 / 5 - 0 ratings