Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign uphandle pre-summed trees #62
Comments
|
@jstrin, thanks so much for pointing this out as I have been meaning to clarify, since this can be both confusing and misleading. Your solution is very nice, so I appreciate both taking the time to find a solution and sharing it here. The problem arises when a tree is pre-summed (generally not the case in my experience, but definitely the case with
This would be a potentially breaking change, so I'll let this sit for a while and seek input in case someone has an opinion. Please let me know if you see anything amiss. For testing, we can use the following code.
... and should expect This would be much easier if we can assume all data passed to |
|
More for testing...
|
|
from @jstrin @timelyportfolio sorry for the delayed response. I ran through a handful of tests including using data with truncated paths (e.g., NA values for one of the indices) and it looks good on my end. I'll re-run my test scripts after you push the updated d2b code. |
|
Test code now
|
|
going to close, since I believe the new |

promoting #60 (comment) started by @jstrin
@timelyportfolio I was playing with the d2b sunburst example you posted and noticed that the way the data is aggregated and formatted using the
treemap::treemapfunction, it is causing some of the data to be aggregated resulting in inaccurate counts. For example, if you take a look at the "C" nodes in the example, the raw data (from the JSON) is:C.1.a + C.1.b + C.1.c = C.1 = C
However, the javascript appears to aggregate the data moving down the hierarchy for the sunburst. When you look at the plotted value for C it is displaying as 9; C.1 is displaying as 6. In other words -
C.1.a + C.1.b + C.1.c + C.1 = C.1'
C.1.a + C.1.b + C.1.c + C.1 + C = C'
Where C.1' and C' are the displayed values in the final visualization.
I found that aggregating my data then passing it to the
treemap::treepallettefunction was a quick fix to this:If you are looking for assistance putting together htmlwidgets for the d2b sunburst (and/or the d2b bubble chart) I'm happy to do what I can.