collapsibleTree icon indicating copy to clipboard operation
collapsibleTree copied to clipboard

[Feature Request] Could we use a different variable for attribute?

Open hestiri opened this issue 7 years ago • 2 comments

This is such a great package! Is this possible to define another method in attribute instead of "leafCount" in collapsibleTreeSummary? I need a mean function that for each node sums up the numeric values defined in attribute and divides them by the number of leaves.

hestiri avatar Sep 03 '17 16:09 hestiri

So right now you can change the attribute to another column name, and get the sum of that other column like this:

collapsibleTreeSummary(
  warpbreaks,
  c("wool", "tension", "breaks"),
  attribute = "breaks",
  fillFun = colorspace::terrain_hcl,
  maxPercent = 50
)

However, I haven't yet worked on adding additional aggregation functions other than just cumulative sum for the summary function, since I was having some trouble getting the node filling to work right. The regular collapsibleTree function does support using any aggregation function, but it will not automatically add a color gradient to your nodes.

AdeelK93 avatar Sep 05 '17 00:09 AdeelK93

Is there a work around to using collapsibleTree and getting the color gradient. I'm using mean for my aggFun so I can't use collapsibleTreeSummary.

kegarner avatar May 21 '19 17:05 kegarner