plotly.R icon indicating copy to clipboard operation
plotly.R copied to clipboard

Animated bubble plot - bubble not resizing when selection made via highlight

Open DavidMatthews83 opened this issue 3 years ago • 0 comments

When creating an animated bubble plot the bubbles in the selection set (made through highlight - plotly_click) do not resize. Example below is based on example from here https://plotly-r.com/client-side-linking.html

library(plotly)
library(ggplot2)
library(gapminder) 

#modify some pop values to make bubbles stand out more
gapminder$pop = ifelse(gapminder$year > 1982 & gapminder$country =='China', gapminder$pop * 10, gapminder$pop)


g <- highlight_key(gapminder, ~continent)

gg <- ggplot(g, aes(gdpPercap, lifeExp, 
      color = continent, frame = year)) +
      geom_point(aes(size = pop, ids = country)) +
      scale_x_log10()

p_gg <- highlight(ggplotly(gg), "plotly_click")

p_gg

Selecting by clicking on the bubble Not resizing image

Expected results

Using Plotly box selection As expected image

With no selection image

DavidMatthews83 avatar Jul 08 '22 04:07 DavidMatthews83