datastorm-open / visNetwork

R package, using vis.js library for network visualization
Other
545 stars 125 forks source link

White Margin in the Canvas #407

Open higor-gomes93 opened 3 years ago

higor-gomes93 commented 3 years ago

Hello!

I'm getting this white margin in my plot:

Canvas

Any ideas about what might be happening? Already checked parameters such as width and height.

bschilder commented 1 year ago

also noticed this in my plots. adding dropdown menus and main/submain text makes the margins larger, but removing them doesn't get rid of it.

bschilder commented 1 year ago

@bthieurmel any tips for this? here's a quick reprex:

nodes <- data.frame(id = 1:3)
edges <- data.frame(from = c(1,2), to = c(1,3))
 vn <- visNetwork(nodes, edges, background = "black")
save_path <- tempfile(fileext = ".html")
visNetwork::visSave(vn, 
                            file = save_path, 
                            selfcontained = TRUE,
                            background = "white")
browseURL(save_path)
Screenshot 2023-04-17 at 02 14 47

Adding visIgraphLayout(type = "full") doesn't seem to alleviate the issue:

vn <- vn |>   visNetwork::visIgraphLayout(type = "full") 

Thanks in advance!

Session info

``` R version 4.2.1 (2022-06-23) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Ventura 13.2.1 Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] visNetwork_2.1.2 dplyr_1.1.1 loaded via a namespace (and not attached): [1] Biobase_2.58.0 httr_1.4.5 tidyr_1.3.0 [4] pkgload_1.3.2 maps_3.4.1 jsonlite_1.8.4 [7] tidygraph_1.2.3 here_1.0.1 shiny_1.7.4 [10] devoptera_0.99.0 BiocManager_1.30.20 stats4_4.2.1 [13] RBGL_1.74.0 xlsxjars_0.6.1 yaml_2.3.7 [16] remotes_2.4.2 sessioninfo_1.2.2 pillar_1.9.0 [19] glue_1.6.2 RUnit_0.4.32 digest_0.6.31 [22] promises_1.2.0.1 colorspace_2.1-0 htmltools_0.5.5 [25] httpuv_1.6.9 XML_3.99-0.14 pkgconfig_2.0.3 [28] devtools_2.4.5 purrr_1.0.1 xtable_1.8-4 [31] scales_1.2.1 processx_3.8.0 stringdist_0.9.10 [34] later_1.3.0 tibble_3.2.1 biocViews_1.66.3 [37] farver_2.1.1 generics_0.1.3 ggplot2_3.4.2 [40] usethis_2.1.6 ellipsis_0.3.2 cachem_1.0.7 [43] BiocGenerics_0.44.0 cli_3.6.1 magrittr_2.0.3 [46] crayon_1.5.2 mime_0.12 evaluate_0.20 [49] memoise_2.0.1 ps_1.7.4 fs_1.6.1 [52] fansi_1.0.4 pkgbuild_1.4.0 graph_1.76.0 [55] profvis_0.3.7 tools_4.2.1 data.table_1.14.8 [58] prettyunits_1.1.1 lifecycle_1.0.3 stringr_1.5.0 [61] xlsx_0.6.5 munsell_0.5.0 callr_3.7.3 [64] compiler_4.2.1 rlang_1.1.0 js2graphic_0.1.0 [67] grid_4.2.1 RCurl_1.98-1.12 dichromat_2.0-0.1 [70] rstudioapi_0.14 htmlwidgets_1.6.2 igraph_1.4.2 [73] miniUI_0.1.1.1 rmarkdown_2.21 bitops_1.0-7 [76] gtable_0.3.3 codetools_0.2-19 R6_2.5.1 [79] knitr_1.42 fastmap_1.1.1 utf8_1.2.3 [82] rprojroot_2.0.3 pals_1.7 rJava_1.0-6 [85] stringi_1.7.12 parallel_4.2.1 Rcpp_1.0.10 [88] vctrs_0.6.1 mapproj_1.2.11 BiocCheck_1.34.3 [91] tidyselect_1.2.0 xfun_0.38 urlchecker_1.0.1 ```