I would like to get the coordinates of the drawn rectangle in a separate variable, also I would like the coordinates to change if I resize the rectangle.
library(plotly)
x <- 1:50
y <- rnorm(50)
fig <- plot_ly(x = ~x, y = ~y, type = 'scatter', mode = 'lines')
fig <- config(fig,modeBarButtonsToAdd = list('drawrect'))
fig
There is a very similar question, but none of the solutions worked for me, those solutions must be outdated by now