Last active
August 29, 2015 14:00
-
-
Save sckott/11008455 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("shiny") | |
library("plotly") | |
library("ggplot2") | |
shinyServer(function(input, output) { | |
output$text <- renderText({ | |
ggiris <- qplot(Petal.Width, Sepal.Length, data=iris, color=Species) | |
py <- plotly("RgraphingAPI", "ektgzomjbx") | |
res <- py$ggplotly(ggiris) | |
iframe <- paste("<iframe height=\"600\" id=\"igraph\" scrolling=\"no\" seamless=\"seamless\" src=\"", | |
res$response$url, "\" width=\"500\" frameBorder=\"0\"></iframe>", sep = "") | |
iframe | |
}) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("shiny") | |
shinyUI(pageWithSidebar( | |
headerPanel(title=HTML("TaxMap"), windowTitle="TaxMap"), | |
sidebarPanel( | |
wellPanel("plotly in shiny") | |
), | |
mainPanel( | |
htmlOutput("text") | |
) | |
)) |
Hi @spivotron. If you add ".embed" at the end of the plotly link, you will get an URL to embed into your Shiny app. In this case is "https://plot.ly/~sckott/22.embed". After that, you can use tags$iframe() in your ui.R to embed the plot.ly graph, for example:
mainPanel(
tags$iframe(src="https://plot.ly/~sckott/22.embed",
height=400,
width=600)
)
For more details: http://shiny.rstudio.com/articles/tag-glossary.html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you upload this to shiny servers can you get the iframe to show? I am trying to iframe a plot.ly graph into my shiny web application and I am having trouble displaying the iframed graph.