Plot easing working for only one datapoint (when the slope of previous datapoint is the same)


I tried to build animated line chart with frame argument. Find part of my dataset below:


a <- data.frame(country = rep(“DE”, 9),
year = c(seq(2015, 2016), seq(2015, 2017), seq(2015, 2018)),
deficit_pc_gdp = c(0.8, 0.9, 0.8, 0.9, 1.0, 0.8, 0.9, 1.0, 1.7),
frame = c(rep(2016, 2), rep(2017, 3), rep(2018, 4)))

I used the following code to generate a plot:

plot_ly(a, x = ~year, y = ~deficit_pc_gdp, frame = ~frame,
type = ‘scatter’, mode = ‘lines’) %>%
animation_opts(500, 300, redraw = F, easing = "bounce)

The problem is, that the animation of the transition between points (so that the line extends smoothly) is working only between 2016 and 2017. I verified that it works, whenever the slope for the previous point is the same (2015 to 2016 it goes up by 0.1, and between 2016 and 2017 it goes up by 0.1 again and the animation is working, however next year it goes up by 0.7 which is different and it does not ease line again).

I am wondering whether it is a bug. It would be great if you could help.