-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sumNodes=FALSE makes sunburst not work #79
Comments
To be clear, you modified the existing example to use The An example that uses the There's a short explanation of why it was added here: and the issue for adding it (with a much more detailed explanation of its purpose is here: There could be something said for adding a bit of checking to throw an error before displaying an empty plot, as happens with your modified example. |
Thank you, @cjyetman. I modified the test code according to the example you provided. Now it worked correctly. Vectorize(function(pkg) invisible(require(pkg, character.only=TRUE, quiet=TRUE)))(
c("dplyr", "sunburstR", "treemap", "d3r")
)
sequences <- read.csv(
system.file("examples/visit-sequences.csv", package="sunburstR")
, header = FALSE
, stringsAsFactors = FALSE
)[1:100, ]
seqdat <- dplyr::bind_rows(lapply(
strsplit(as.character(sequences[[1]]), "-"), function(rw)
data.frame(t(rw), stringsAsFactors = FALSE)))
seqdat$size <- sequences$V2
tm <- treemap(seqdat, index=paste("X", 1:6, sep=""), vSize="size", draw=FALSE)
tmnest <- d3_nest(tm$tm[, c(paste("X", 3:6, sep=""), "vSize", "color")],
value_cols = c("vSize", "color"))
sunburst(
data = tmnest,
valueField = "vSize",
count = TRUE,
sumNodes = FALSE
) I agree that it will be super if there is some data structure validation and error message before rendering the plot. Now I see that |
When I run the following example code, the plot fails to render.
I am using
sunburstR
2.0.0 installed from CRAN. Could you look into this?The text was updated successfully, but these errors were encountered: