title: R plotly waterfall with offset base: hovertext activated on hover at wrong position
body: <p>Recently, when using an offset (a non-zero <code>base</code> parameter) in a waterfall plot in plotly, I noticed that the boxes with hoverinfo were activated when the mouse pointer was in a completely wrong/unexpected place. Below I've pasted in screenshots to illustrate the problem.</p>
  <ol>
  <li><p>Mouse pointer just to the left of the value in the <code>base</code> parameter:
  <a href="https://i.stack.imgur.com/ZqYEU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZqYEU.png" alt="left of base" /></a></p>
  </li>
  <li><p>Mouse pointer just to the right of the <code>base</code>:
  <a href="https://i.stack.imgur.com/cIln5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cIln5.png" alt="just right of base" /></a></p>
  </li>
  <li><p>Mouse pointer just to the left of the green box:
  <a href="https://i.stack.imgur.com/RcKZf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RcKZf.png" alt="just left of green box" /></a></p>
  </li>
  <li><p>Mouse pointer inside the green box (same behavior to the right of the box):
  <a href="https://i.stack.imgur.com/VsYdP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VsYdP.png" alt="within green box" /></a></p>
  </li>
  </ol>
  <p>Just found a similar question on the Plotly forum for the Python Dash users <a href="https://community.plotly.com/t/waterfall-wrong-position-of-mouse-to-show-hover/52900" rel="nofollow noreferrer">here</a>, but it looks like it hasn't been answered.</p>
  <p>Any ideas what might be wrong here?</p>
  <p>I'm attaching the code below for reproducing the example shown in the pictures:</p>
  <pre><code>library(dplyr)
  library(plotly)
  
  
  set.seed(123)
  test_x &lt;- rnorm(10)
  test_y &lt;- c(LETTERS[1:10], &quot;all&quot;) %&gt;% factor(., levels = .)
  test_base &lt;- -15
  
  test_data &lt;- tibble(
    x = c(test_x, 0),
    y = test_y,
    text = c(paste(&quot;test&quot;, 1:10), &quot;all&quot;),
    measure = c(rep(&quot;relative&quot;, 10), &quot;total&quot;)
  )
  
  
  plot_ly(
    test_data,
    type = &quot;waterfall&quot;,
    orientation = &quot;h&quot;,
    measure = ~measure,
    x = ~x,
    y = ~y,
    base = test_base,
    text = ~text,
    textposition = &quot;none&quot;,
    hoverinfo = &quot;text&quot;,
    decreasing = list(marker = list(color = &quot;orange&quot;))
  ) %&gt;%
    layout(
      yaxis = list(autorange = &quot;reversed&quot;, title = &quot;y&quot;),
      xaxis = list(title = &quot;x&quot;)
    )
  </code></pre>