AdeelK93 / collapsibleTree

Create Interactive Collapsible Tree Diagrams in R using D3.js
https://adeelk93.github.io/collapsibleTree/
158 stars 41 forks source link

Node Size issue with collapsibleTreeNetwork #45

Closed sunfengnian88 closed 5 years ago

sunfengnian88 commented 5 years ago

dataset: data set

code: library(collapsibleTree)

df <- read.csv(file="test_data.csv", header=TRUE,sep=",", na.strings = c("", NA))

len <- nrow(df)

colfunc <- colorRampPalette(c("red", "paleturquoise1"))

color_col <- colfunc(len)

df$Color <- color_col

p <- collapsibleTreeNetwork( df, fill = "Color", attribute = "value", collapsed = TRUE, height = 800, width = 2000, zoomable = TRUE, aggFun = identity, tooltip = TRUE, nodeSize = "value" )

In the plot, the size of node B is not proportional to its value 184 as screenshot below. plot

It seems like parent node size is sum aggregation of its all children size. However, what I expect is that each node size is independent based on its specified column variable.

Can you please make more clarification about this?

Thank you!

AdeelK93 commented 5 years ago

Thanks for catching this! I've corrected this in my latest github commit, could you check it out and see if that works for you?

screen shot 2018-11-10 at 2 52 28 pm
sunfengnian88 commented 5 years ago

This is exactly what I expect. Perfect!