Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add crosstalk mapping to computed_mapping (not mapping) when present #1964

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

Merged
merged 2 commits into from
Jun 17, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Follow up to #1952: add crosstalk mapping to computed_mapping (not ma…
…pping) when present
  • Loading branch information
cpsievert committed Jun 17, 2021
commit 4b4085f136234f183f03b1c07cccdd19f6144c64
7 changes: 6 additions & 1 deletion 7 R/ggplotly.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,12 @@ gg2list <- function(p, width = NULL, height = NULL,
layers <- Map(function(x, y) {
if (crosstalk_key() %in% names(y) && !"key" %in% names(x[["mapping"]]) &&
inherits(x[["stat"]], "StatIdentity")) {
x[["mapping"]] <- c(x[["mapping"]], key = as.name(crosstalk_key()))
# ggplot2 v3.3.4 started using the computed_mapping (instead of mapping)
# field to inform the compute_aesthetics() method, so in order to add
# the crosstalk key, we need to add to that field (when present)
# https://github.com/tidyverse/ggplot2/pull/4475
nm <- if ("computed_mapping" %in% names(x)) "computed_mapping" else "mapping"
x[[nm]] <- c(x[[nm]], key = as.name(crosstalk_key()))
}
x
}, layers, layer_data)
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.