Closed ghost closed 7 years ago
Can you post also your sessionInfo()
?
Can you tell me what viewer you are using? Are you using RStudio viewer on Windows for example or did you open the result in a standard browser?
Sure:
R version 3.3.3 (2017-03-06) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 17.04
locale: [1] LC_CTYPE=it_IT.
UTF-8 LC_NUMERIC=C LC_TIME=it_IT.UTF-8 LC_COLLATE=it_IT.UTF-8
[5] LC_MONETARY=it_IT.UTF-8 LC_MESSAGES=it_IT.UTF-8 LC_PAPER=it_IT.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=it_IT.UTF-8 LC_IDENTIFICATION=Cattached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] gdtools_0.1.4 bindrcpp_0.2 ggiraph_0.4.0 ggthemes_3.4.0 knitr_1.16 dygraphs_1.1.1.4 xts_0.10-0
[8] zoo_1.8-0 dplyr_0.7.1 purrr_0.2.2.2 readr_1.1.1 tidyr_0.6.3 tibble_1.3.3 ggplot2_2.2.1
[15] tidyverse_1.1.1 sp_1.2-5loaded via a namespace (and not attached): [1] Rcpp_0.12.11 lubridate_1.6.0 lattice_0.20-35 assertthat_0.2.0 rprojroot_1.2 digest_0.6.12
[7] psych_1.7.5 R6_2.2.2 cellranger_1.1.0 plyr_1.8.4 backports_1.1.0 evaluate_0.10.1
[13] httr_1.2.1 highr_0.6 rlang_0.1.1 lazyeval_0.2.0 readxl_1.0.0 uuid_0.1-2
[19] R.utils_2.5.0 R.oo_1.21.0 rmarkdown_1.6 labeling_0.3 stringr_1.2.0 foreign_0.8-67
[25] htmlwidgets_0.8 munsell_0.4.3 broom_0.4.2 modelr_0.1.0 base64enc_0.1-3 mnormt_1.5-5
[31] rvg_0.1.4 htmltools_0.3.6 R.methodsS3_1.7.1 grid_3.3.3 nlme_3.1-131 jsonlite_1.5
[37] gtable_0.2.0 magrittr_1.5 scales_0.4.1 zip_1.0.0 stringi_1.1.5 reshape2_1.4.2
[43] xml2_1.1.1 RColorBrewer_1.1-2 tools_3.3.3 forcats_0.2.0 glue_1.1.1 officer_0.1.4
[49] hms_0.3 rsconnect_0.8 parallel_3.3.3 yaml_2.1.14 colorspace_1.3-2 rvest_0.3.2
[55] bindr_0.1 haven_1.1.0
i'm using RStudio Version 1.0.143 viewer on Ubuntu Gnome
Opening tho markdown html output on Firefox there is not cut problem but i get a smaller plot:
*The upper i a ggiraph plot the second is the same but simple ggplot.
Thanks, I don't think there is an issue with viewing in browser (you may have not set the width_svg
and height_svg
parameters), could you try something like:
ggiraph(..., width_svg = 7, height_svg = 5)
About the rstudio viewer issue, it seems output is centered on width and height... I don't know exactly what is happening, I can't reproduce on my mac so I will have to find another machine.
Great, i fix the browser view (still got the rstudio browser too)
For error reproduction on the viewer chart: i used this example https://github.com/davidgohel/ggiraph/blob/master/examples/geom_polygon_interactive.R (i think you already recognize it!)
thanks for the feedback.
I was able to reproduce this issue on my machine as well. Here's a reprex of the issue.
library(ggplot2)
library(ggiraph)
# create data
ids <- factor(c("1.1", "2.1", "1.2", "2.2", "1.3", "2.3"))
values <- data.frame(
id = ids,
value = c(3, 3.1, 3.1, 3.2, 3.15, 3.5) )
positions <- data.frame(
id = rep(ids, each = 4),
x = c(2, 1, 1.1, 2.2, 1, 0, 0.3, 1.1, 2.2, 1.1, 1.2, 2.5, 1.1, 0.3,
0.5, 1.2, 2.5, 1.2, 1.3, 2.7, 1.2, 0.5, 0.6, 1.3),
y = c(-0.5, 0, 1, 0.5, 0, 0.5, 1.5, 1, 0.5, 1, 2.1, 1.7, 1, 1.5,
2.2, 2.1, 1.7, 2.1, 3.2, 2.8, 2.1, 2.2, 3.3, 3.2) )
datapoly <- merge(values, positions, by=c("id"))
datapoly$oc = "alert(this.getAttribute(\"data-id\"))"
# create a ggplot -----
gg_poly_1 <- ggplot(datapoly, aes( x = x, y = y ) ) +
geom_polygon_interactive(aes(fill = value, group = id,
tooltip = value, data_id = value, onclick = oc))
# display ------
ggiraph(code = {print(gg_poly_1)})
I think it's ok now, can one of you test? I can not test on ubuntu, I only have access to remote machines...
install.packages(c("gdtools", "rvg"), repos = "https://cran.rstudio.com")
devtools::install_github("davidgohel/ggiraph")
This works now on my Windows machine (with Session Info included below). Thanks, David!
thanks!
Hi, i got some problems while rendering some outputs: charts appear cut in Viewer:
i got problems in notebook/markdown too:
Packages: ggplot 2.2.1; ggiraph 0.4.0 R version 3.3.3 (2017-03-06) "Another Canoe"