# Hover text differs after publishing

**URL:** <https://community.plotly.com/t/hover-text-differs-after-publishing/4262>\
**Category:** Plotly R\
**Created:** [May 18, 2017, 11:43am UTC](https://community.plotly.com/t/hover-text-differs-after-publishing/4262 "2017-05-18T11:43:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![asayat](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@asayat](https://community.plotly.com/u/asayat)\
**Post date:** [May 18, 2017, 11:43am UTC](https://community.plotly.com/t/hover-text-differs-after-publishing/4262/1 "2017-05-18T11:43:25Z")

</div>

After installing dev version of the plotly (due to the fact that in the last version from cran api\_create() generates grids for each trace, which is in my case a very huge number) I can’t set text on hover information.

I updated plot’s attributes using plotly\_build() function:

> ```
> mpg$order<-seq(1,nrow(mpg))
> mpg$Size<-1
> 
> ```

```
ggpl<-mpg%>%
  group_by(class)%>%
  arrange(class, desc(order))%>%
  mutate(cum_size = cumsum(Size) - Size / 2)%>%
  ggplot(aes(x=class, y=cum_size, fill = manufacturer))+
  geom_tile(color="white", size = 1, aes(height = Size))

pp<-ggplotly(ggpl)
pp<-plotly_build(ggpl)
mpg<-mpg[with(mpg, order(manufacturer,class,order)),]
pp$x$data[1:nrow(mpg)]<-
  Map(modifyList, pp$x$data[1:nrow(mpg)],
      lapply(paste("Class:",mpg$class,"<br> Year:",mpg$year,
                   "<br> Model:",mpg$model, sep=" "), 
             function(x) list(text=x)))
pp

```

In my machine:  
 ![](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/3/3271e736fe85535fd5801805d46866fec2cd93e6.png)

Published version:  
[https://plot.ly/~azharka/48/](https://plot.ly/~azharka/48/)

 ![](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/b/b489c9feb1da7417455f6dccee5aa08027d6cb19.png)

The published version’s code differs from that in code, which makes everybody very sad ☹
