tush1r / google-motion-charts-with-r

Automatically exported from code.google.com/p/google-motion-charts-with-r
0 stars 0 forks source link

TreeMap doesn't handle non-unique identifiers #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
tm1 <- data.frame(id=c('Global', 'Region 1', 'Region 2', 'Place 1', 'Place 2', 
'Place 1', 'Place 2'),
    parent=c(NA, 'Global', 'Global', 'Region 1', 'Region 1', 'Region 2', 'Region 2'),
    size=c(1:7), color=c(7:1))

tm2 <- gvisTreeMap(tm1, 'id', 'parent', 'size', 'color')

plot(tm2)

What is the expected output? What do you see instead?
expect to see place 1 and place 2 in their appropriate regions. Instead, all 
four appear in the first region.

What version of the product are you using? On what operating system?
googleVis_0.2.8 RJSONIO_0.8-2 
R version 2.13.1 (2011-07-08)
Platform: i386-pc-mingw32/i386 (32-bit)

Please provide any additional information below.

Perhaps this bug is on google's side, if so, a word of warning in the help file 
would be nice.

Original issue reported on code.google.com by tomhi...@gmail.com on 5 Aug 2011 at 4:00

GoogleCodeExporter commented 9 years ago
This behaviour is as expected. Tree maps display a tree like structure where 
every child has to have a unique parent, see the details section in the 
helpfile to gvisTreeMap.

In your example Place 1 has two different parents with Regions 1 & 2. The same 
is true for Place 2. Arguably there could be a warning message.  

Original comment by markus.g...@googlemail.com on 9 Aug 2011 at 7:36

GoogleCodeExporter commented 9 years ago
In my example, which perhaps was too ambiguous, place 1 under region 1 is 
different from place 1 under Region 2. Perhaps a better example would be US 
states broken up by urban and rural. The urban and rural parts of each state 
are distinct from each other, but named the same. In my opinion, the tree map 
should be able to display "Urban" and "Rural" under "New York" without having 
to rename the entities "New York Urban" and "New York Rural", which is 
currently the case. Thus, the combination of child and parent are indeed unique 
even though the child list on its own is not.

Again, if this is a limitation of google, then a warning is probably best.

Original comment by tomhi...@gmail.com on 9 Aug 2011 at 8:30

GoogleCodeExporter commented 9 years ago
Indeed, I believe this is a limitation of the Google API. I will include a 
warning section in the help file.
Thanks for your comments!

Original comment by markus.g...@googlemail.com on 9 Aug 2011 at 12:03

GoogleCodeExporter commented 9 years ago
The warning section of the help file has been updated to highlight this 
potential issue.

Original comment by markus.g...@googlemail.com on 28 Aug 2011 at 6:15