Well, many months have been passed from this help request. I write this answer to my own request in order to share my experience. I learned ggplot2
and then ggvis
as well as Shiny
. Shiny
can work with both of them, but I found ggvis
more structured and lucid comparing to ggplot2
. Something which is expectable as the former is being developed based on the development experience of the latter. Moreover, ggvis
seems much faster than ggplot2
in quick graph/chart generation, it seems much more suitable for 'Shiny' and creating an applet. However, the negative point is the lack of many features in ggvis
since the package is under development and has not become matured yet.
And many thanks to comments here. I have checked Gephi
, it wouldn't help. I created my applet which works really fine, however I finally reached to this point that I need to use more powerful tools such as d3js
, as one has already suggested.
manpreet
Best Answer
2 years ago
There is a similar question here in CrossValidated, and I have read the answers. My question is a bit different. I don't want to merely visualize my data, and indeed what I want to visualize is not easy to visualize with either package.
I have two sets of points (x,yx,y coordinates) on my plot. I want to add edges and make it similar to a graph. If I have nn points, then based on the nature of my problem, I need to add (n/2)2(n/2)2 edges to the plot.
Then I want to add some interactive features to my plot. For instance, by clicking on one point (vertex), all other vertices which are not connected to this clicked vertex must disappear to have a more lucid and focused plot.
I tried to find a network visualization package suited to my project, but it seems all of them use the data about connection of edges or nodes and provide a network based on some specific layout algorithm. My data is different. I have the coordinates of nodes and I want to establish some edges between some of them. In my data the nodes have their own fixed locations and must not be moved around.
Finally, I narrowed down the packages to
ggvis
andggplot2
.ggvis
is new and fresh in addition to having intentional design to generate interactive plots. But I found out thatggplot2+Shiny
can also produce interactive plots. (Is that correct?) Besides, I figured thatggplot2
's capabilities are more varied and matured thanggvis
: for instanceggplot2
has a zooming feature whileggvis
does not have it. More important, asggvis
is growing and changing, I don't want to invest a lot of time on a work that becomes technically obsolete or buggy in a year or so. I thought this is the case if I code based onggvis
.Now may you please evaluate my choice (
ggplot2+shiny
) and advise me about possibility to do what I want to do with it?As I did not know any of the mentioned packages, I have started learning
ggplot2
from Wickham's book and I love it! But I am afraid of spending a few weeks and finding out that this amazing package cannot do what I want to do even with the aid ofShiny
.P.S: I want to put the final code on github so probable users can download and run it. Therefore, I do not need to make a web application, there is no need to any website or putting the interactive map online. I just need to have an interactive plot which can be run from inside of Rstudio.