Created
February 9, 2015 21:08
-
-
Save kbroman/d188b28f337c840d8193 to your computer and use it in GitHub Desktop.
This file contains 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
## trying to understand sizingPolicy in htmlwidgets | |
# | |
# It seems like viewer.defaultHeight/Width are ignored | |
# within RStudio | |
# testjs package | |
if(!require(testjs)) { | |
library(devtools) | |
install_github("kbroman/testjs") | |
library(testjs) | |
} | |
# some data | |
set.seed(35538110) | |
n <- 100 | |
x <- rnorm(n) | |
grp <- sample(1:3, n, replace=TRUE) | |
y <- x*grp + rnorm(n) | |
dat <- list(x=x, y=y, group=grp) | |
# sizing policy | |
sp <- htmlwidgets::sizingPolicy(viewer.defaultWidth=200, | |
viewer.defaultHeight=200, | |
viewer.padding=5, | |
viewer.paneHeight=300) | |
htmlwidgets::createWidget("iplot", | |
list(data=dat, chartOpts=NULL), | |
sizingPolicy=sp, package="testjs") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
said the same in the ramnathv/htmlwidgets#78, but in case someone finds this and wants an answer, adding
viewer.fill= FALSE
to thesizingPolicy
should fix this.