mages / googleVis

Interface between R and the Google Chart Tools
https://mages.github.io/googleVis/
360 stars 155 forks source link

Network plot with time in googlevis #65

Closed FinScience closed 7 years ago

FinScience commented 7 years ago

Hi,

I m trying to plot a network that would have all the functionalities provided by gvisMotionChart. Ideally the network needs to change over time. Is this possible using gvisMotionChart.

Some features that would be awesome to have. 1)As time changes older edges between two nodes gradually fade. 2)The size of a node increases proportionally with the number of times it is hit.

A reproducible code is shared.

            dates = seq(Sys.Date(), by = 'day', length = 5)
             label1 = as.character(c("A","B","A","L","D"))
             label2 = as.character(c("B","C","J","D","E"))

              edges = data.frame(Date = dates, Source = label1, Target = label2)

              unq_labs = unique(c(label1,label2))

              x = sample.int(length(unq_labs))
              y = sample.int(length(unq_labs))

             edges$Source_x = label_axis_df[match(edges$Source,label_axis_df$unq_labs),1]
             edges$Source_y = label_axis_df[match(edges$Source,label_axis_df$unq_labs),2]

             edges$Target_x = label_axis_df[match(edges$Target,label_axis_df$unq_labs),1]
              edges$Target_y = label_axis_df[match(edges$Target,label_axis_df$unq_labs),2]

             edges

                      Date Source Target Source_x Source_y Target_x Target_y
             1 2017-06-02      A      B        5        5        3        7
             2 2017-06-03      B      C        3        7        1        2
             3 2017-06-04      A      J        5        5        6        3
             4 2017-06-05      L      D        2        6        4        4
             5 2017-06-06      D      E        4        4        7        1
mages commented 7 years ago

I am sorry, but this is not possible with the current Google Chart Tools. I suggest you raise this as feature request with the Google team: https://github.com/google/google-visualization-issues