datastorm-open / visNetwork

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

Not rendering in tabPanel #400

Closed laylagerami closed 3 years ago

laylagerami commented 3 years ago

Trying to render a network in a tabPanel but its not working. Renders fine in a non-tabbed UI. Same behaviour is seen even with the minimal example.

Expected behaviour: Network renders in the mainPanel. Actual behaviour: Blank panel (see attached - R Shiny, Browser + Inspect).

ui.R

tabPanel("Visualisation",
         sidebarPanel(
           "Render Network Test"
         ),

         mainPanel(
           visNetwork::visNetworkOutput("network")
         )
)

server.R

output$network <- renderVisNetwork({
    # minimal example
    nodes <- data.frame(id = 1:3)
    edges <- data.frame(from = c(1,2), to = c(1,3))

    visNetwork(nodes, edges)
  })

Session info:

> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

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

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

other attached packages:
 [1] networkD3_0.4        piano_2.6.0          visNetwork_2.1.0    CARNIVAL_1.2.0      
 [5] progeny_1.12.0       ggplot2_3.3.3        tibble_3.1.0         dplyr_1.0.5         
 [9] dorothea_1.2.0       org.Hs.eg.db_3.12.0  AnnotationDbi_1.52.0 IRanges_2.24.1      
[13] S4Vectors_0.28.1     Biobase_2.50.0       BiocGenerics_0.36.0  shinyFiles_0.9.0    
[17] shinythemes_1.2.0    shinyBS_0.61         shinysky_0.1.3       rhandsontable_0.3.7 
[21] chemdoodle_0.3.0     rcdk_3.5.0           rcdklibs_2.3         rJava_0.9-13        
[25] miniUI_0.1.1.1       DT_0.17              igraph_1.2.6         shinyjs_2.0.0       
[29] shiny_1.6.0          limma_3.46.0        

loaded via a namespace (and not attached):
  [1] shinydashboard_0.7.1 tidyselect_1.1.0     RSQLite_2.2.3        htmlwidgets_1.5.3   
  [5] grid_4.0.3           BiocParallel_1.24.1  lpSolve_5.6.15       devtools_2.3.2      
  [9] sourcetools_0.1.7    scatterpie_0.1.5     munsell_0.5.0        codetools_0.2-18    
 [13] withr_2.4.1          colorspace_2.0-0     GOSemSim_2.16.1      Category_2.56.0     
 [17] rstudioapi_0.13      ROCR_1.0-11          DOSE_3.16.0          slam_0.1-48         
 [21] polyclip_1.10-0      bit64_4.0.5          farver_2.1.0         rprojroot_2.0.2     
 [25] vctrs_0.3.6          generics_0.1.0       xfun_0.22            itertools_0.1-3     
 [29] BiocFileCache_1.14.0 sets_1.0-18          R6_2.5.0             doParallel_1.0.16   
 [33] graphlayouts_0.7.1   RJSONIO_1.3-1.4      bitops_1.0-6         cachem_1.0.4        
 [37] fgsea_1.16.0         assertthat_0.2.1     promises_1.2.0.1     scales_1.1.1        
 [41] ggraph_2.0.5         enrichplot_1.10.1    fingerprint_3.5.7    gtable_0.3.0        
 [45] processx_3.4.5       tidygraph_1.2.0      rlang_0.4.10         genefilter_1.72.1   
 [49] splines_4.0.3        checkmate_2.0.0      BiocManager_1.30.10  yaml_2.2.1          
 [53] reshape2_1.4.4       crosstalk_1.1.1      backports_1.2.1      httpuv_1.5.5        
 [57] qvalue_2.22.0        RBGL_1.66.0          usethis_2.0.1        tools_4.0.3         
 [61] relations_0.6-9      ellipsis_0.3.1       gplots_3.1.1         jquerylib_0.1.3     
 [65] RColorBrewer_1.1-2   sessioninfo_1.1.1    Rcpp_1.0.6           plyr_1.8.6          
 [69] purrr_0.3.4          RCurl_1.98-1.2       prettyunits_1.1.1    ps_1.6.0            
 [73] viridis_0.5.1        cowplot_1.1.1        ggrepel_0.9.1        cluster_2.1.1       
 [77] fs_1.5.0             tinytex_0.30         magrittr_2.0.1       data.table_1.14.0   
 [81] DO.db_2.9            RANN_2.6.1           reactome.db_1.74.0   pkgload_1.2.0       
 [85] hms_1.0.0            mime_0.10            xtable_1.8-4         XML_3.99-0.5        
 [89] gridExtra_2.3        testthat_3.0.2       compiler_4.0.3       KernSmooth_2.23-18  
 [93] crayon_1.4.1         shadowtext_0.0.7     htmltools_0.5.1.1    segmented_1.3-3     
 [97] later_1.1.0.1        tidyr_1.1.3          ReactomePA_1.34.0    DBI_1.1.1           
[101] tweenr_1.0.1         dbplyr_2.1.0         MASS_7.3-53.1        rappdirs_0.3.3      
[105] Matrix_1.3-2         bcellViper_1.26.0    readr_1.4.0          cli_2.3.1           
[109] marray_1.68.0        pkgconfig_2.0.3      rvcheck_0.1.8        foreach_1.5.1       
[113] annotate_1.68.0      bslib_0.2.4          callr_3.5.1          viper_1.24.0        
[117] stringr_1.4.0        digest_0.6.27        graph_1.68.0         UniProt.ws_2.30.0   
[121] fastmatch_1.1-0      GSEABase_1.52.1      curl_4.3             kernlab_0.9-29      
[125] gtools_3.8.2         graphite_1.36.0      lifecycle_1.0.0      jsonlite_1.7.2      
[129] desc_1.3.0           viridisLite_0.3.0    fansi_0.4.2          pillar_1.5.1        
[133] lattice_0.20-41      pkgbuild_1.2.0       fastmap_1.1.0        httr_1.4.2          
[137] survival_3.2-7       GO.db_3.12.1         remotes_2.2.0        glue_1.4.2          
[141] png_0.1-7            iterators_1.0.13     bit_4.0.4            ggforce_0.3.3       
[145] class_7.3-18         stringi_1.5.3        sass_0.3.1           mixtools_1.2.0      
[149] blob_1.2.1           caTools_1.18.1       memoise_2.0.0        e1071_1.7-4   

I look forward to getting this to work because it will be a very valuable package for my app :)

laylagerami commented 3 years ago

I made a mistake with assigning variables - resolved. My bad!