Skip to content

handle POSIXct frames #1246

Open
Open
@bhogan-mitre

Description

@bhogan-mitre

plot_ly exhibits strange behavior when trying to loop over a POSIXct variable in an animation. POSIXct variables are handled fine as the axes of a non-animating plot_ly, so I was hoping they would be supported as frames.

It seems the frame is turned into a numeric, which makes sense. However, a POSIXct y axis seems to be mutated beyond use when using a POSIXct frame.

library(plotly)

data <- data.frame(x = 1:100, 
                   t1 = rep(seq.POSIXt(as.POSIXct("2018-04-01"), as.POSIXct("2018-04-10"), length.out = 10), 10),
                   t2 = seq.POSIXt(as.POSIXct("2018-05-01"), as.POSIXct("2018-05-10"), length.out = 100))

data %>%
  plot_ly(x = ~x, y = ~t2, frame = ~t1) %>% 
  add_markers()

2018-04-26_02-36-57

Thank you for providing this great capability, and I am excited about the potential for Plotly animations as well!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions