Skip to content

Commit

Permalink
add iframesrc as mode in show so that entire page can be inlined as a…
Browse files Browse the repository at this point in the history
…n iframe (thanks @kohske)
  • Loading branch information
ramnathv committed Dec 13, 2013
1 parent 804119e commit 1e6e271
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion R/rChartsClass.R
Expand Up @@ -154,7 +154,15 @@ rCharts = setRefClass('rCharts', list(params = 'list', lib = 'character',
.self$save(file_, cdn = cdn)
cat(sprintf("<iframe src=%s seamless></iframe>", file_))
return(invisible())
}
},
iframesrc = {
cat(
"<iframe srcdoc='",
htmlspecialchars(n1$render(...)),

This comment has been minimized.

Copy link
@kohske

kohske Dec 13, 2013

Contributor

simple bug, n1 should be .self?

This comment has been minimized.

Copy link
@kohske

kohske Dec 13, 2013

Contributor

Also, need to consider how width/height of iframe should be calculated. Does seamless work?

This comment has been minimized.

Copy link
@ramnathv

ramnathv Dec 13, 2013

Author Owner

Thanks. I changed n1 to .self. I would prefer to style the iframe within the rmd file using style tags. So you could do

<style>iframe{width: 800px; height: 400px;}</style>
"'></iframe>"
)
return(invisible())
}
)
},
show2 = function(static = T, ...){
Expand Down

0 comments on commit 1e6e271

Please sign in to comment.