jmw86069 / venndir

Venn diagrams with directionality (concordance), optional display of items inside the figure, text Venn diagrams
https://jmw86069.github.io/venndir
Other
6 stars 0 forks source link

No Labels/Text on Venn Diagram #6

Open andrewni4313 opened 8 months ago

andrewni4313 commented 8 months ago

For some reason the labels/text are all missing for the venn diagram. Not sure what is happening. I never managed to get them to show up. The only thing I can think of is: Warning: font family not found in Windows font database

setlist <- make_venn_test(2500, 3,
  sizes=c(400, 500, 200),
  do_signed=TRUE)

venndir(setlist, overlap_type="agreement", proportional=TRUE)

image

setlist <- make_venn_test(2500, 3,
  sizes=c(400, 500, 200),
  do_signed=TRUE)

venndir(setlist)

image

R version 4.3.2 (2023-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22621)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                           LC_TIME=English_United States.utf8    

time zone: America/New_York
tzcode source: internal

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

other attached packages:
 [1] farver_2.1.1                colorspace_2.1-0            readr_2.1.5                 tximport_1.30.0            
 [5] org.Mm.eg.db_3.18.0         ensembldb_2.26.0            AnnotationFilter_1.26.0     GenomicFeatures_1.54.1     
 [9] AnnotationDbi_1.64.1        AnnotationHub_3.10.0        BiocFileCache_2.10.1        dbplyr_2.4.0               
[13] venndir_0.0.29.900          GOplot_1.0.2                gridExtra_2.3               scales_1.3.0               
[17] ggsci_3.0.0                 kableExtra_1.3.4.9000       dendextend_1.17.1           ggdendro_0.1.23            
[21] eulerr_7.0.0                ComplexHeatmap_2.18.0       EnhancedVolcano_1.20.0      ggrepel_0.9.4              
[25] pheatmap_1.0.12             enrichplot_1.22.0           bigPint_1.19.1              vsn_3.70.0                 
[29] clusterProfiler_4.10.0      DESeq2_1.42.0               SummarizedExperiment_1.32.0 Biobase_2.62.0             
[33] MatrixGenerics_1.14.0       matrixStats_1.2.0           GenomicRanges_1.54.1        GenomeInfoDb_1.38.5        
[37] IRanges_2.36.0              S4Vectors_0.40.2            BiocGenerics_0.48.1         RColorBrewer_1.1-3         
[41] ggtree_3.10.0               ggfortify_0.4.16            ggplot2_3.4.4               tibble_3.2.1               
[45] dplyr_1.1.4                

loaded via a namespace (and not attached):
  [1] ProtGenerics_1.34.0           fs_1.6.3                      bitops_1.0-7                  sf_1.0-15                    
  [5] HDO.db_0.99.1                 httr_1.4.7                    webshot_0.5.5                 doParallel_1.0.17            
  [9] colorjam_0.0.27.900           tools_4.3.2                   backports_1.4.1               utf8_1.2.4                   
 [13] R6_2.5.1                      lazyeval_0.2.2                GetoptLong_1.0.5              withr_3.0.0                  
 [17] sp_1.6-1                      prettyunits_1.2.0             GGally_2.2.0                  preprocessCore_1.64.0        
 [21] cli_3.6.2                     scatterpie_0.2.1              proxy_0.4-27                  commonmark_1.9.0             
 [25] Rsamtools_2.18.0              systemfonts_1.0.5             yulab.utils_0.1.3             gson_0.1.0                   
 [29] foreign_0.8-86                DOSE_3.28.2                   svglite_2.1.3                 limma_3.58.1                 
 [33] rstudioapi_0.15.0             RSQLite_2.3.4                 generics_0.1.3                gridGraphics_0.5-1           
 [37] shape_1.4.6                   BiocIO_1.12.0                 GO.db_3.18.0                  Matrix_1.6-5                 
 [41] fansi_1.0.6                   abind_1.4-5                   lifecycle_1.0.4               yaml_2.3.8                   
 [45] qvalue_2.34.0                 SparseArray_1.2.3             blob_1.2.4                    promises_1.2.1               
 [49] crayon_1.5.2                  shinydashboard_0.7.2          lattice_0.22-5                cowplot_1.1.2                
 [53] KEGGREST_1.42.0               pillar_1.9.0                  knitr_1.45                    fgsea_1.28.0                 
 [57] rjson_0.2.21                  codetools_0.2-19              fastmatch_1.1-4               glue_1.6.2                   
 [61] ggfun_0.1.3                   data.table_1.14.10            vctrs_0.6.5                   png_0.1-8                    
 [65] treeio_1.26.0                 gtable_0.3.4                  cachem_1.0.8                  xfun_0.41                    
 [69] S4Arrays_1.2.0                mime_0.12                     tidygraph_1.3.0               iterators_1.0.14             
 [73] units_0.8-5                   statmod_1.5.0                 interactiveDisplayBase_1.40.0 ellipsis_0.3.2               
 [77] nlme_3.1-164                  bit64_4.0.5                   progress_1.2.3                filelock_1.0.3               
 [81] affyio_1.72.0                 KernSmooth_2.23-22            rpart_4.1.23                  DBI_1.2.1                    
 [85] rgeos_0.6-4                   Hmisc_5.1-1                   nnet_7.3-19                   tidyselect_1.2.0             
 [89] bit_4.0.5                     compiler_4.3.2                curl_5.2.0                    rvest_1.0.3                  
 [93] htmlTable_2.4.2               xml2_1.3.6                    DelayedArray_0.28.0           plotly_4.10.4                
 [97] shadowtext_0.1.2              rtracklayer_1.62.0            checkmate_2.3.1               classInt_0.4-10              
[101] hexbin_1.28.3                 affy_1.80.0                   rappdirs_0.3.3                stringr_1.5.1                
[105] digest_0.6.33                 rmarkdown_2.25                XVector_0.42.0                htmltools_0.5.7              
[109] pkgconfig_2.0.3               base64enc_0.1-3               fastmap_1.1.1                 rlang_1.1.2                  
[113] GlobalOptions_0.1.2           htmlwidgets_1.6.4             shiny_1.8.0                   jsonlite_1.8.8               
[117] BiocParallel_1.36.0           GOSemSim_2.28.0               RCurl_1.98-1.13               magrittr_2.0.3               
[121] Formula_1.2-5                 GenomeInfoDbData_1.2.11       ggplotify_0.1.2               jamba_0.0.98.900             
[125] patchwork_1.2.0               munsell_0.5.0                 Rcpp_1.0.11                   ape_5.7-1                    
[129] shinycssloaders_1.0.0         viridis_0.6.4                 stringi_1.8.3                 ggraph_2.1.0                 
[133] zlibbioc_1.48.0               MASS_7.3-60.0.1               plyr_1.8.9                    ggstats_0.5.1                
[137] parallel_4.3.2                Biostrings_2.70.1             graphlayouts_1.0.2            splines_4.3.2                
[141] gridtext_0.1.5                hms_1.1.3                     circlize_0.4.15               polylabelr_0.2.0             
[145] locfit_1.5-9.8                igraph_1.6.0                  markdown_1.12                 reshape2_1.4.4               
[149] biomaRt_2.58.0                BiocVersion_3.18.1            XML_3.99-0.16                 evaluate_0.23                
[153] BiocManager_1.30.22           tzdb_0.4.0                    foreach_1.5.2                 tweenr_2.0.2                 
[157] httpuv_1.6.13                 tidyr_1.3.0                   purrr_1.0.2                   polyclip_1.10-6              
[161] reshape_0.8.9                 clue_0.3-65                   gridBase_0.4-7                ggforce_0.4.1                
[165] xtable_1.8-4                  restfulr_0.0.15               e1071_1.7-14                  tidytree_0.4.6               
[169] later_1.3.2                   class_7.3-22                  viridisLite_0.4.2             aplot_0.2.2                  
[173] GenomicAlignments_1.38.0      memoise_2.0.1                 cluster_2.1.6    
jmw86069 commented 7 months ago

Hi, I'm currently migrating the rendering to use polyclip polygons instead of sp/sf, so I anticipate this issue will be resolved shortly. (I'm hoping in the coming days, but we'll see.)

In the meantime, a potential workaround is to use plot_style="gg" which renders labels using ggplot2 output instead of base R graphics.

For troubleshooting, my thinking is to review the locale (Sys.getlocale()) to ensure it is UTF-8 compatible. If you see "C" then it might be worth trying "en_US.UTF-8" (or relevant string). Something like Sys.setlocale(LANG="en_US.UTF-8")? Then see if that resolves the output text.

Thanks for submitting the issue!

jmw86069 commented 3 months ago

I have updated the venndir() function, among other changes it now uses grid graphics by default. In theory this should make it more directly configurable for font selection. However I don't have a great way to test the weird edge effects of fonts on different systems. So if you have a chance to run a quick test, and are willing, let me know if your test cases are now resolved?

Thank you for reporting the issue!

jmw86069 commented 3 months ago

I think this bug is fixed, however I cannot reproduce your output (missing text) on my end so I can't readily test it.

The venndir graphical output now uses grid which I suspect has improved handling of fonts, so you should see text - or hopefully a more informative warning or error message. If you have a chance to test again in similar environment, I would appreciate it.