plotly / plotly/plotly.R

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

Open
#2,157 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The reproducible example uses highlight_key(), ggplot(), ggplotly(), and highlight(..., "plotly_click"); begin by running it and comparing click selection with box selection. Done means selected bubbles resize consistently in the animated plot while the unselected view and existing box-selection behavior remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.