briatte / ggnet

Network visualization with ggplot2
https://briatte.github.io/ggnet/
194 stars 33 forks source link

No arrows when using ggnet2 #46

Closed yuz12012 closed 3 years ago

yuz12012 commented 3 years ago

Thanks for building this great package.

When I was trying to draw arrows in the network. No arrows are drawn. Any ideas why this happens?

Code:

library(plotly)
library(GGally)
library(network)
library(sna)
library(ggplot2)

p <- ggnet2(network(rgraph(10, tprob = 0.25), directed = TRUE),
       arrow.size = 12, arrow.gap = 0.025)

l <- plotly::ggplotly(p)

htmlwidgets::saveWidget(l, 'output.html')

newplot (13)

sessionInfo output is also attached as follows:

R version 4.0.2 (2020-06-22) Platform: x86_64-conda_cos6-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core)

Matrix products: default BLAS/LAPACK: xx/xxxx/xxxx/xxxx/

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] parallel stats4 stats graphics grDevices utils datasets [8] methods base

other attached packages: [1] sna_2.6 statnet.common_4.5.0 network_1.17.1
[4] GGally_2.1.2 plotly_4.9.3 ggplot2_3.3.5
[7] org.Mm.eg.db_3.12.0 AnnotationDbi_1.52.0 IRanges_2.24.1
[10] S4Vectors_0.28.1 Biobase_2.50.0 BiocGenerics_0.36.0
[13] clusterProfiler_3.18.1

loaded via a namespace (and not attached): [1] enrichplot_1.10.0 bit64_4.0.5 RColorBrewer_1.1-2 [4] httr_1.4.2 tools_4.0.2 R6_2.5.0
[7] DBI_1.1.0 lazyeval_0.2.2 colorspace_2.0-0
[10] withr_2.4.1 tidyselect_1.1.0 gridExtra_2.3
[13] bit_4.0.4 compiler_4.0.2 scatterpie_0.1.5
[16] shadowtext_0.0.7 scales_1.1.1 stringr_1.4.0
[19] digest_0.6.27 DOSE_3.16.0 pkgconfig_2.0.3
[22] htmltools_0.5.1.1 fastmap_1.1.0 htmlwidgets_1.5.3
[25] rlang_0.4.10 RSQLite_2.2.5 farver_2.0.3
[28] generics_0.1.0 jsonlite_1.7.2 crosstalk_1.1.1
[31] BiocParallel_1.22.0 GOSemSim_2.16.1 dplyr_1.0.4
[34] magrittr_2.0.1 GO.db_3.12.1 Matrix_1.2-18
[37] Rcpp_1.0.6 munsell_0.5.0 viridis_0.5.1
[40] lifecycle_0.2.0 yaml_2.2.1 stringi_1.5.3
[43] ggraph_2.0.3 MASS_7.3-53 plyr_1.8.6
[46] qvalue_2.20.0 grid_4.0.2 blob_1.2.1
[49] ggrepel_0.9.1 DO.db_2.9 crayon_1.4.1
[52] lattice_0.20-41 graphlayouts_0.7.1 cowplot_1.1.1
[55] splines_4.0.2 pillar_1.4.7 fgsea_1.16.0
[58] igraph_1.2.6 reshape2_1.4.4 fastmatch_1.1-0
[61] glue_1.4.2 downloader_0.4 data.table_1.13.6
[64] BiocManager_1.30.10 vctrs_0.3.6 tweenr_1.0.1
[67] gtable_0.3.0 purrr_0.3.4 polyclip_1.10-0
[70] tidyr_1.1.2 reshape_0.8.8 assertthat_0.2.1
[73] cachem_1.0.3 ggforce_0.3.2 tidygraph_1.2.0
[76] coda_0.19-4 viridisLite_0.3.0 tibble_3.0.6
[79] rvcheck_0.1.8 memoise_2.0.0 ellipsis_0.3.1

Many thanks in advance.

yuz12012 commented 3 years ago

It seems to be a plotly issue. ggnet output is correct.

Please ignore this issue.