@@ -189,7 +189,7 @@ plotly_build.plotly <- function(p, registerFrames = TRUE) {
189189 dataArrayAttrs , special_attrs(trace ), npscales(), " frame" ,
190190 # for some reason, text isn't listed as a data array in some traces
191191 # I'm looking at you scattergeo...
192- " .plotlyGroupIndex" , " text" , " key" , " fillcolor" , " name"
192+ " .plotlyGroupIndex" , " text" , " key" , " fillcolor" , " name" , " legendgroup "
193193 )
194194 tr <- trace [names(trace ) %in% allAttrs ]
195195 # TODO: does it make sense to "train" matrices/2D-tables (e.g. z)?
@@ -210,11 +210,7 @@ plotly_build.plotly <- function(p, registerFrames = TRUE) {
210210 if (any(isSplit )) {
211211 paste2 <- function (x , y ) if (identical(x , y )) x else paste(x , y , sep = br())
212212 splitVars <- builtData [isSplit ]
213- traceIndex <- Reduce(paste2 , splitVars )
214- if (! is.null(trace $ name )) {
215- traceIndex <- paste2(traceIndex , trace $ name )
216- }
217- builtData [[" .plotlyTraceIndex" ]] <- traceIndex
213+ builtData [[" .plotlyTraceIndex" ]] <- Reduce(paste2 , splitVars )
218214 # in registerFrames() we need to strip the frame from .plotlyTraceIndex
219215 # so keep track of which variable it is...
220216 trace $ frameOrder <- which(names(splitVars ) %in% " frame" )
0 commit comments