Skip to content

Commit

Permalink
fix error design not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunuuuu committed Jan 2, 2025
1 parent 4f9d196 commit 09de9c3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/cross-.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ Cross <- ggproto("Cross", AlignProto,
free_facet = TRUE,
free_limits = TRUE,
interact_layout = function(self, layout) {
if (length(layout@break_points) && is.null(.subset2(design, "nobs"))) {
# 1. check layout is `*_cross()`
# 2. add `cross_points`
# 3. add `odesign`
layout <- ggproto_parent(CrossGg, self)$interact_layout(layout)
if (length(layout@break_points) &&
is.null(.subset2(layout@design, "nobs"))) {
cli_abort(sprintf(
"layout {.field nobs} for %s must be initialized before adding %s",
self$layout_name, object_name(self)
))
}
layout <- ggproto_parent(CrossGg, self)$interact_layout(layout)

# will define labels0
self$labels0 <- self$labels
Expand Down

0 comments on commit 09de9c3

Please sign in to comment.