treeplot not working
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- r
- Domain
- data-visualization
Research direction
No source file or test is named. Start by reproducing treeplot with the reported R v4.1 context, then inspect the treeplot rendering path and the third geom_segment2 layer shown in the traceback. Done means treeplot renders without the zero-length lwd error, with a regression test covering the failure.
Written by the indexing model from the issue text.
Description
Hello,
treeplot used to work fine for me (R v4.1) but now it is giving me this error. Could you help?
ERROR while rich displaying an object: Error in geom_segment2():
! Problem while converting geom to grob.
ℹ Error occurred in the 3rd layer.
Caused by error in check.length():
! 'gpar' element 'lwd' must not be length 0
Traceback:
- tryCatch(withCallingHandlers({
. if (!mime %in% names(repr::mime2repr))
. stop("No repr_* for mimetype ", mime, " in repr::mime2repr")
. rpr <- repr::mime2repr[mime]
. if (is.null(rpr))
. return(NULL)
. prepare_content(is.raw(rpr), rpr)
. }, error = error_handler), error = outer_handler) - tryCatchList(expr, classes, parentenv, handlers)
- tryCatchOne(expr, names, parentenv, handlers[[1L]])
- doTryCatch(return(expr), name, parentenv, handler)
- withCallingHandlers({
. if (!mime %in% names(repr::mime2repr))
. stop("No repr_* for mimetype ", mime, " in repr::mime2repr")
. rpr <- repr::mime2repr[mime]
. if (is.null(rpr))
. return(NULL)
. prepare_content(is.raw(rpr), rpr)
. }, error = error_handler) - repr::mime2repr[mime]
- repr_text.default(obj)
- paste(capture.output(print(obj)), collapse = "\n")
- capture.output(print(obj))
- withVisible(...elt(i))
- print(obj)
- print.ggplot(obj)
- ggplot_gtable(data)
- ggplot_gtable.ggplot_built(data)
- by_layer(function(l, d) l$draw_geom(d, layout), plot$layers,
. data, "converting geom to grob") - try_fetch(for (i in seq_along(data)) {
. out[[i]] <- f(l = layers[[i]], d = data[[i]])
. }, error = function(cnd) {
. cli::cli_abort(c("Problem while {step}.", i = "Error occurred in the {ordinal(i)} layer."),
. call = layers[[i]]$constructor, parent = cnd)
. }) - tryCatch(withCallingHandlers(expr, condition = function(cnd) {
. {
. .handler_frame. <- TRUE
. .setup_frame. <- frame
. if (inherits(cnd, "message")) {
. except <- c("warning", "error")
. }
. else if (inherits(cnd, "warning")) {
. except <- "error"
. }
. else {
. except <- ""
. }
. }
. while (!is_null(cnd)) {
. if (inherits(cnd, "error")) {
. out <- handlers[1L]
. if (!inherits(out, "rlang_zap"))
. throw(out)
. }
. inherit <- .subset2(.subset2(cnd, "rlang"), "inherit")
. if (is_false(inherit)) {
. return()
. }
. cnd <- .subset2(cnd, "parent")
. }
. }), stackOverflowError = handlers[[1L]]) - tryCatchList(expr, classes, parentenv, handlers)
- tryCatchOne(expr, names, parentenv, handlers[[1L]])
- doTryCatch(return(expr), name, parentenv, handler)
- withCallingHandlers(expr, condition = function(cnd) {
. {
. .handler_frame. <- TRUE
. .setup_frame. <- frame
. if (inherits(cnd, "message")) {
. except <- c("warning", "error")
. }
. else if (inherits(cnd, "warning")) {
. except <- "error"
. }
. else {
. except <- ""
. }
. }
. while (!is_null(cnd)) {
. if (inherits(cnd, "error")) {
. out <- handlers[1L]
. if (!inherits(out, "rlang_zap"))
. throw(out)
. }
. inherit <- .subset2(.subset2(cnd, "rlang"), "inherit")
. if (is_false(inherit)) {
. return()
. }
. cnd <- .subset2(cnd, "parent")
. }
. }) - f(l = layers[[i]], d = data[[i]])
- l$draw_geom(d, layout)
- draw_geom(..., self = self)
- self$geom$draw_layer(data, self$computed_geom_params, layout,
. layout$coord) - draw_layer(..., self = self)
- lapply(split(data, data$PANEL), function(data) {
. if (empty(data))
. return(zeroGrob())
. panel_params <- layout$panel_params[[data$PANEL[1]]]
. inject(self$draw_panel(data, panel_params, coord, !!!params))
. }) - FUN(X[[i]], ...)
- inject(self$draw_panel(data, panel_params, coord, !!!params))
- self$draw_panel(data, panel_params, coord, arrow = NULL, lineend = "butt",
. na.rm = FALSE, nudge_x = 0.432898555929542) - draw_panel(...)
- grid::segmentsGrob(data$x, data$y, data$xend, data$yend, default.units = "native",
. gp = gpar(col = alpha(data$colour, data$alpha), fill = alpha(arrow.fill,
. data$alpha), lwd = data$size * ggplot2::.pt, lty = data$linetype,
. lineend = lineend, linejoin = linejoin), arrow = arrow) - grob(x0 = x0, y0 = y0, x1 = x1, y1 = y1, arrow = arrow, name = name,
. gp = gp, vp = vp, cl = "segments") - gpar(col = alpha(data$colour, data$alpha), fill = alpha(arrow.fill,
. data$alpha), lwd = data$size * ggplot2::.pt, lty = data$linetype,
. lineend = lineend, linejoin = linejoin) - validGP(list(...))
- numnotnull("lwd")
- check.length(gparname)
- stop(gettextf("'gpar' element '%s' must not be length 0", gparname),
. domain = NA) - .handleSimpleError(function (cnd)
. {
. {
. .handler_frame. <- TRUE
. .setup_frame. <- frame
. if (inherits(cnd, "message")) {
. except <- c("warning", "error")
. }
. else if (inherits(cnd, "warning")) {
. except <- "error"
. }
. else {
. except <- ""
. }
. }
. while (!is_null(cnd)) {
. if (inherits(cnd, "error")) {
. out <- handlers[1L]
. if (!inherits(out, "rlang_zap"))
. throw(out)
. }
. inherit <- .subset2(.subset2(cnd, "rlang"), "inherit")
. if (is_false(inherit)) {
. return()
. }
. cnd <- .subset2(cnd, "parent")
. }
. }, "'gpar' element 'lwd' must not be length 0", base::quote(check.length(gparname))) - h(simpleError(msg, call))
- handlers[1L]
- cli::cli_abort(c("Problem while {step}.", i = "Error occurred in the {ordinal(i)} layer."),
. call = layers[[i]]$constructor, parent = cnd) - rlang::abort(message, ..., call = call, use_cli_format = TRUE,
. .frame = .frame) - signal_abort(cnd, .file)
- Dominant language
- R
- Stars
- 260
- Forks
- 75
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from YuLab-SMU/enrichplot
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
YuLab-SMU/enrichplot#330 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 32/100
YuLab-SMU/enrichplot#327 · 2 comments ·
-
emapplot
Difficulty 4/5 3-5 days Newbie friendliness 28/100
YuLab-SMU/enrichplot#322 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
YuLab-SMU/enrichplot#319 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
YuLab-SMU/enrichplot#317 · 10 comments · 1 reaction ·
All issues in YuLab-SMU/enrichplot
Similar issues
-
documentation pkg infrastructure
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
epiverse-trace/epiparameter#511 ·
-
function:write_dwc
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
beginners blocker
Difficulty 2/5 1-3 hours Newbie friendliness 78/100