Search code examples
rggvis

ggvis slider is squashed


I am using R version 3.2.0 (2015-04-16) from RStudio Version 0.98.1103. The platform is platform i386-w64-mingw32. I am using Windows Vista Version 6. This code

require(ggvis)
require(dplyr)

# ggvis use of a slider

mtcars %>% 
    ggvis(~wt, ~mpg, size := input_slider(10, 100), 
                opacity := input_slider(0,1) ) %>% 
    layer_points()

works, but the slider is squashed on the left of the plot and therefore difficult to use. How can I overcome this please?


Solution

  • This seems to be a bug in the CRAN version of ggvis.

    Try:

    # install.packages("devtools")
    devtools::install_github("hadley/lazyeval", build_vignettes = FALSE)
    devtools::install_github("hadley/dplyr", build_vignettes = FALSE)
    devtools::install_github("rstudio/ggvis", build_vignettes = FALSE)
    
    library(ggvis)
    
    mtcars %>% 
      ggvis(~wt, ~mpg, size := input_slider(10, 100), 
            opacity := input_slider(0,1) ) %>% 
      layer_points()