plotly.R
plotly.R copied to clipboard
Animated bubble plot - bubble not resizing when selection made via highlight
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

Expected results
Using Plotly box selection As expected

With no selection
