Skip to content

Commit

Permalink
more sensible hashing (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Apr 27, 2024
1 parent 06bc900 commit fbd7550
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion R/compose-.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Compose <- ggproto(
params$title <- title
}
params$guide_params <- guide_params
params$hash <- hash(guide_params)
params$hash <- hash(lapply(guide_params, get_hash))
params
},

Expand Down Expand Up @@ -217,3 +217,5 @@ set_limits <- function(params, limits) {
params$limits <- limits
params
}

get_hash <- function(x) x$hash
2 changes: 1 addition & 1 deletion R/primitive-line.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ PrimitiveLine <- ggproto(
legend = list(line = "legend.axis.line")
),

hashables = exprs(decor),
hashables = exprs(decor[[aesthetic]], get0("position")),

extract_key = standard_extract_key,

Expand Down
2 changes: 1 addition & 1 deletion R/primitive-ticks.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ PrimitiveTicks <- ggproto(

params = new_params(key = NULL, bidi = FALSE),

hashables = exprs(key),
hashables = exprs(key$.value),

elements = list(
position = list(
Expand Down

0 comments on commit fbd7550

Please sign in to comment.