@@ -88,6 +88,7 @@ ggplotly.ggmatrix <- function(p = ggplot2::last_plot(), width = NULL,
88
88
height = NULL , tooltip = " all" , dynamicTicks = FALSE ,
89
89
layerData = 1 , originalData = TRUE , source = " A" , ... ) {
90
90
dots <- list (... )
91
+ tooltip <- rectify_tooltip(tooltip )
91
92
# provide a sensible crosstalk if none is already provided (makes ggnostic() work at least)
92
93
if (! crosstalk_key() %in% names(p $ data )) {
93
94
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,
145
146
ggplotly.ggplot <- function (p = ggplot2 :: last_plot(), width = NULL ,
146
147
height = NULL , tooltip = " all" , dynamicTicks = FALSE ,
147
148
layerData = 1 , originalData = TRUE , source = " A" , ... ) {
149
+ tooltip <- rectify_tooltip(tooltip )
148
150
l <- gg2list(p , width = width , height = height , tooltip = tooltip ,
149
151
dynamicTicks = dynamicTicks , layerData = layerData ,
150
152
originalData = originalData , source = source , ... )
@@ -1433,4 +1435,10 @@ getAesMap <- function(plot, layer) {
1433
1435
} else {
1434
1436
layer $ mapping
1435
1437
}
1436
- }
1438
+ }
1439
+
1440
+
1441
+ rectify_tooltip <- function (tooltip ){
1442
+ tooltip [tooltip == " color" ] <- " colour"
1443
+ tooltip
1444
+ }
0 commit comments