bwlewis / rthreejs

Three.js widgets for R and shiny
http://bwlewis.github.io/rthreejs
Other
302 stars 64 forks source link

Edges not visible in RStudio viewer or Zoom #68

Open ZedLeb opened 7 years ago

ZedLeb commented 7 years ago

Hi Bryan - or any other kind soul who could shine a light...

I've come across your package today via www.kateto.net/polnet2017 superb tutorial on networks. I have used visNetwork up until now and haven't really go to grips with igraph notation - but willing to try now! So I kind of jumped in at the deep end and installed threejs too.

Following Ms Ognyanova's code I got a lovely interactive graph that rotated beautifully - except I saw no edges. So I went to your pages and took the simplest bit of code

suppressPackageStartupMessages(library(threejs, quietly=TRUE)) 
data(LeMis) 
graphjs(LeMis, vertex.size = 1)

and got exactly the same result...nodes a plenty but no edges. I can see from your output how it should look.

I have no errors reporting but attach my sessioninfo in case someone can see some kind of conflict...

If anyone has any suggestions - most gratefully received - I think this is a beautiful package and I really want to advance with it.

Many thanks Zoe


sessionInfo() R version 3.4.1 (2017-06-30) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

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

other attached packages: [1] threejs_0.3.1 igraph_1.1.2

loaded via a namespace (and not attached): [1] Rcpp_0.12.12 digest_0.6.12 mime_0.5 R6_2.2.2 xtable_1.8-2 jsonlite_1.5
[7] magrittr_1.5 tools_3.4.1 htmlwidgets_0.9 crosstalk_1.0.0 shiny_1.0.4 yaml_2.1.14
[13] httpuv_1.3.5 compiler_3.4.1 pkgconfig_2.0.1 base64enc_0.1-3 htmltools_0.3.6

bwlewis commented 7 years ago

Hi Zoe,

There is a little "pop out" button in the RStudio viewer window (if you hover over it, it says 'Show in new window'). Can you try pressing that?

This will open your plot in a web browser window. The network may properly render there.

We have seen miscellaneous problems with RStudio's rendering engine especially on Windows machines. Fortunately, RStudio is often updated and I expect things to eventually render properly. Until then, you might need to use the pop out visualization on your machine.

Let me know if this works...

bwlewis commented 6 years ago

I'm running things OK in recent versions of RStudio now, is that also the case for you?

CermakM commented 5 years ago

Try setting the vertex attributes of your igraph object.

Example:

g <- graph_from_data_frame(df)

V(g)$size <- 10
V(g)$color <- 'red'

graphjs(g)