YuLab-SMU / shinyTempSignal

Explore Temporal and Other Phylogenetic Signals
https://www.sciencedirect.com/science/article/pii/S167385272400033X
9 stars 6 forks source link

The `legend.text.align` theme element is not defined in the element hierarchy. #38

Closed brj1 closed 6 months ago

brj1 commented 6 months ago

Hi Yu,

I've been trying to use this tool, but I can't get it work on either my M2 Mac Book Pro (Sonoma 14.3.1 (23D60)) or my Windows 10 PC. In both cases I get the following error when I look at the Temporal Signal plot:

The `legend.text.align` theme element is not defined in the element hierarchy.

The first plot with the phylogenetic tree works and the regression of the RTT seems to work. I have tried all the examples in your new shinyTempSignal paper and I get the same error message on all.

I am using R 3.3.3, the latest github version of ggtree and treeio and the last CRAN vesion of all orher packages (including

EDIT: I used the Firefox web browser to open the shiny app.

Below is the sessionInfo() for my Mac:

R version 4.3.3 (2024-02-29)
Platform: aarch64-apple-darwin23.2.0 (64-bit)
Running under: macOS Sonoma 14.3.1

Matrix products: default
BLAS:   /opt/homebrew/Cellar/openblas/0.3.26/lib/libopenblasp-r0.3.26.dylib 
LAPACK: /opt/homebrew/Cellar/r/4.3.3/lib/R/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8

time zone: America/Vancouver
tzcode source: internal

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

other attached packages:
[1] shiny_1.8.0           shinyTempSignal_0.0.7

loaded via a namespace (and not attached):
  [1] polynom_1.4-1        attempt_0.3.1        remotes_2.4.2.1     
  [4] rlang_1.1.3          magrittr_2.0.3       shinydashboard_0.7.2
  [7] tseries_0.10-55      compiler_4.3.3       mgcv_1.9-1          
 [10] systemfonts_1.0.5    callr_3.7.5          vctrs_0.6.5         
 [13] quantreg_5.97        quadprog_1.5-8       pkgconfig_2.0.3     
 [16] crayon_1.5.2         fastmap_1.1.1        ellipsis_0.3.2      
 [19] fontawesome_0.5.2    labeling_0.4.3       utf8_1.2.4          
 [22] promises_1.2.1       ps_1.7.6             ragg_1.2.7          
 [25] MatrixModels_0.5-3   purrr_1.0.2          cachem_1.0.8        
 [28] aplot_0.2.2          jsonlite_1.8.8       later_1.3.2         
 [31] ggprism_1.0.4        parallel_4.3.3       R6_2.5.1            
 [34] golem_0.4.1          bslib_0.6.1          lmtest_0.9-40       
 [37] jquerylib_0.1.4      Rcpp_1.0.12          zoo_1.8-12          
 [40] httpuv_1.6.14        Matrix_1.6-5         splines_4.3.3       
 [43] nnet_7.3-19          tidyselect_1.2.0     yaml_2.3.8          
 [46] timeDate_4032.109    curl_5.2.1           processx_3.8.3      
 [49] pkgbuild_1.4.3       lattice_0.22-5       tibble_3.2.1        
 [52] quantmod_0.4.26      treeio_1.27.0.002    withr_3.0.0         
 [55] urca_1.3-3           gridGraphics_0.5-1   desc_1.4.3          
 [58] survival_3.5-8       ggpp_0.5.6           xts_0.13.2          
 [61] confintr_1.0.2       pillar_1.9.0         BiocManager_1.30.22 
 [64] ggtree_3.11.1        shinyjs_2.1.0        ggfun_0.1.4         
 [67] generics_0.1.3       TTR_0.24.4           forecast_8.22.0     
 [70] ggplot2_3.5.0        munsell_0.5.0        scales_1.3.0        
 [73] tidytree_0.4.6       xtable_1.8-4         glue_1.7.0          
 [76] lazyeval_0.2.2       tools_4.3.3          ggpmisc_0.5.5       
 [79] SparseM_1.81         fs_1.6.3             grid_4.3.3          
 [82] tidyr_1.3.1          ape_5.7-1            colorspace_2.1-0    
 [85] nlme_3.1-164         patchwork_1.2.0      fracdiff_1.5-3      
 [88] cli_3.6.2            config_0.3.2         textshaping_0.3.7   
 [91] fansi_1.0.6          dplyr_1.1.4          gtable_0.3.4        
 [94] yulab.utils_0.1.4    sass_0.4.8           digest_0.6.34       
 [97] ggplotify_0.1.2      farver_2.1.1         memoise_2.0.1       
[100] htmltools_0.5.7      lifecycle_1.0.4      shinyWidgets_0.8.2  
[103] mime_0.12            MASS_7.3-60.0.1   
brj1 commented 6 months ago

It looks like legend.text.align is deprecated in ggplot2_3.5.0. See https://github.com/tidyverse/ggplot2/blob/fc62903c76d736510dbed24a36c42ef826762262/NEWS.md?plain=1#L54

EDIT: It looks like the ggprism theme is causing he issue. See https://github.com/csdaw/ggprism/issues/26

GuangchuangYu commented 6 months ago

It seems that this issue will be fixed in ggprism soon.

With the recent commit, you can use shinyTempSignal_set_theme() to replace the usage of theme_prism.