Conversation
| to_basic.data.frame <- function(data, prestats_data, layout, params, p, ...) { | ||
| prefix_class(data, "GeomPath") | ||
| } |
There was a problem hiding this comment.
Hmm, this doesn't seem right, do you have an example where this becomes relevant?
There was a problem hiding this comment.
this is actually a trick because the autoplot returns only a data.frame and GeomHilo... this results in only drawing the predictions without the line.
| transform_hiloribbon <- function(data) { | ||
| data <- data[order(data$x), ] | ||
| data$hilo <- NULL | ||
|
|
||
| data$x_plotlyDomain <- as.character(data$x_plotlyDomain) | ||
|
|
||
| maximum_lev <- max(data$level) + 1 | ||
|
|
||
| data$alpha <- (maximum_lev * (maximum_lev - data$level) - 1 )/ maximum_lev**3 | ||
| data$colour <- data$alpha | ||
|
|
||
| unused_aes <- ! names(data) %in% c("x", "y", "ymin", "ymax") | ||
|
|
||
| row_number <- nrow(data) | ||
|
|
||
| data_rev <- data[row_number:1L, ] | ||
| structure(rbind( | ||
| cbind(x = data$x, y = data$ymin, data[unused_aes]), | ||
| cbind(x = data$x[row_number], y = data$ymin[row_number], data[row_number, unused_aes]), | ||
| cbind(x = data_rev$x, y = data_rev$ymax, data_rev[unused_aes]) | ||
| ), class = class(data)) | ||
| } |
There was a problem hiding this comment.
Come to think of it, I think most of this as well as to_basic.GeomAlluvium() could be replaced by ribbon_dat()?
There was a problem hiding this comment.
It's the same code with minor changes.
|
@danton267 would you mind filing an issue to request this feature so that it should up in this list of issues? https://github.com/plotly/plotly.R/issues/created_by/danton267 |
|
@moutikabdessabour what package is the |
|
@moutikabdessabour if we're going to add support for |
|
@cpsievert Ok I will work on it. |
|
@cpsievert The |
Implemented
to_basicmethods that handle the output offabletools:autoplot.fbl_tsand Added tests.