Skip to content

Commit eb40086

Browse files
Closes plotly#2031. ggplot internaly convert color to colour
1 parent e27621c commit eb40086

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

R/ggplotly.R

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ ggplotly.ggmatrix <- function(p = ggplot2::last_plot(), width = NULL,
8888
height = NULL, tooltip = "all", dynamicTicks = FALSE,
8989
layerData = 1, originalData = TRUE, source = "A", ...) {
9090
dots <- list(...)
91+
tooltip <- rectify_tooltip(tooltip)
9192
# provide a sensible crosstalk if none is already provided (makes ggnostic() work at least)
9293
if (!crosstalk_key() %in% names(p$data)) {
9394
p$data[[crosstalk_key()]] <- p$data[[".rownames"]] %||% seq_len(nrow(p$data))
@@ -145,6 +146,7 @@ ggplotly.ggmatrix <- function(p = ggplot2::last_plot(), width = NULL,
145146
ggplotly.ggplot <- function(p = ggplot2::last_plot(), width = NULL,
146147
height = NULL, tooltip = "all", dynamicTicks = FALSE,
147148
layerData = 1, originalData = TRUE, source = "A", ...) {
149+
tooltip <- rectify_tooltip(tooltip)
148150
l <- gg2list(p, width = width, height = height, tooltip = tooltip,
149151
dynamicTicks = dynamicTicks, layerData = layerData,
150152
originalData = originalData, source = source, ...)
@@ -1433,4 +1435,10 @@ getAesMap <- function(plot, layer) {
14331435
} else {
14341436
layer$mapping
14351437
}
1436-
}
1438+
}
1439+
1440+
1441+
rectify_tooltip <- function(tooltip){
1442+
tooltip[tooltip == "color"] <- "colour"
1443+
tooltip
1444+
}

0 commit comments

Comments
 (0)