@@ -380,7 +380,8 @@ geom2trace.GeomPoint <- function(data, params) {
380380 )
381381 # fill is irrelevant for pch %in% c(1, 15:20)
382382 pch <- uniq(data $ shape ) %|| % params $ shape %|| % GeomPoint $ default_aes $ shape
383- if (any(pch %in% c(1 , 15 : 20 ))) {
383+ if (any(pch %in% c(1 , 15 : 20 )) ||
384+ all(grepl(" open$" , shape )) && all(L $ marker $ color %in% " transparent" )) {
384385 L $ marker $ color <- L $ marker $ line $ color
385386 }
386387 L
@@ -491,27 +492,23 @@ geom2trace.GeomText <- function(data, params) {
491492# ' @export
492493geom2trace.GeomTile <- function (data , params ) {
493494 # make sure order of value make sense before throwing z in matrix
494- data <- data [order(data $ x , order( data $ y , decreasing = T ) ), ]
495+ data <- data [order(order( data $ x ), data $ y ), ]
495496 x <- sort(unique(data $ x ))
496497 y <- sort(unique(data $ y ))
497- fill <- data $ fill_plotlyDomain
498- colorscale <- cbind(
499- c(0 , 1 ),
500- data [c(which.min(fill ), which.max(fill )), " fill" ]
501- )
498+ fill <- scales :: rescale(data $ fill_plotlyDomain )
499+ txt <- data $ hovertext
500+ # create the colorscale, which should ignore NAs
501+ data <- data [! is.na(fill ), ]
502+ o <- data [order(data $ fill_plotlyDomain ), " fill" ]
503+ n <- length(o )
504+ qs <- seq(0 , 1 , length.out = min(n , 100 ))
505+ idx <- o [pmax(1 , round(n * qs ))]
506+ colorscale <- cbind(qs , idx )
502507 list (
503508 x = x ,
504509 y = y ,
505- z = matrix (
506- scales :: rescale(fill ),
507- nrow = length(y ),
508- ncol = length(x )
509- ),
510- text = matrix (
511- data $ hovertext ,
512- nrow = length(y ),
513- ncol = length(x )
514- ),
510+ z = matrix (fill , nrow = length(y ), ncol = length(x )),
511+ text = matrix (txt , nrow = length(y ), ncol = length(x )),
515512 colorscale = colorscale ,
516513 type = " heatmap" ,
517514 showscale = FALSE ,
@@ -619,10 +616,10 @@ make_error <- function(data, params, xy = "x") {
619616 e <- list (
620617 x = data $ x ,
621618 y = data $ y ,
619+ text = data $ hovertext ,
622620 type = " scatter" ,
623621 mode = " lines" ,
624622 opacity = 0 ,
625- hoverinfo = " none" ,
626623 line = list (color = color )
627624 )
628625 e [[paste0(" error_" , xy )]] <- list (
0 commit comments