html - Shiny app size in ioslides -


i've made basic shiny app using scatterd3 here, when try embed in ioslides presentation gets cut off , scrollbar appears. slide accommodate entire app (i've measured size), ioslides or shiny choosing section it. need plot appear size because in real project have long list in legend requires height around 720px. enter image description here here's code:

edit using joris' suggestions , removing unnecessary wellpanel, i've reset height 550, demonstrably small enough within scope of slide. i'm still getting scrollbar, , feel there must way adjust height of rendered. essentially, want use whole slide , fill app.

```{r, echo=false} library(scatterd3)  ui <- fluidpage(            scatterd3output("distplot", height = "550px")            )  server <- function(input, output) {   output$distplot <- renderscatterd3({     mtcars$names <- rownames(mtcars)     scatterd3(data = mtcars, x = wt, y = mpg, lab = names,               col_var = cyl, symbol_var = am,               xlab = "weight", ylab = "mpg", col_lab = "cylinders",               symbol_lab = "manual transmission")   }) } shinyapp(ui = ui, server = server) ``` 

i've tried adding options = list(height = 1080) shinyapp call. looked @ this post, , setting <div style="margin-left:-65px; margin-top:-70px; width:112%; height:130%;"> enables of functionality want, still refuses adjust height parameter, important me. tried adding custom css overflow visible, none of these solutions seem work.

you should set page correctly controls come next plot, , use width , height arguments of function scatterd3output.

keep in mind though slide might large enough, still need reserve space title. 720px height, plot doesn't fit on slide actually.

edit: ioslides allows work custom css file. iframe actual frame within slide content constructed. manipulating 1 gives bit more space. next that, can play around size of slides , horizontal , vertical position.

place following in file called eg temp.css in same directory rmd file:

slides > slide {   width: 1000px;   height: 800px;   padding: 10px 20px;   left: 46%;   top: 45%; }  iframe {   height: 900px; } 

and add css: temp.css .rmd file shown below:

--- runtime: shiny output:    ioslides_presentation:     css: temp.css ---  ##   ```{r, echo=false} library(scatterd3)  ui <- fluidpage(   fluidrow(     column(4,            wellpanel(              selectinput("living", "choose life",                           choices = c("life", "death"))            )     ),     column(8,            scatterd3output("distplot", height = "550px"))   ) )  server <- function(input, output) {   output$distplot <- renderscatterd3({     mtcars$names <- rownames(mtcars)     scatterd3(data = mtcars, x = wt, y = mpg, lab = names,               col_var = cyl, symbol_var = am,               xlab = "weight", ylab = "mpg", col_lab = "cylinders",               symbol_lab = "manual transmission")   }) } shinyapp(ui = ui, server = server) ``` 

gives : enter image description here

you can play around these in order better fitting.

on sidenote: in many cases there's absolutely no need create entire app. in case use simple plot updated, can put ui , server side each in own r chunk, , use outputargs manipulate output functions. doesn't work scatterd3 package, it's thing know anyway.

--- runtime: shiny output: ioslides_presentation ---  ## john  ```{r, echo=false} library(scatterd3) ```  ```{r, echo = false}              selectinput("living", "choose life",                           choices = c("life", "death")) ```    ```{r echo = false, width = "80%", height = "400px"} renderplot({     mtcars$names <- rownames(mtcars)     plot(mpg~wt, data = mtcars)   }, outputargs = list(width = "80%",height="400px"))  ``` 

Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -