ggvis icon indicating copy to clipboard operation
ggvis copied to clipboard

Dynamic Scaled Dot Sizes?

Open cdeterman opened this issue 10 years ago • 0 comments

Is there a way to combine scaled dot sizes and size interactivity? A question on stackoverflow was asked a few months ago about this very topic but there have been no answers. Is there a way to have the displayed sizes in a dot plot be scaled and made larger/smaller with an input slider for example?

Reproduced from the question:

# scaled dots
mtcars %>% 
  ggvis(~mpg, ~disp) %>% 
  layer_points(size=~vs) %>%
  scale_numeric("size", range = c(50,500))

# dynamic slider
mtcars %>% 
  ggvis(~mpg, ~disp) %>%
  layer_points(size := input_slider(50, 500, value = 50))

How could someone combine these two?

cdeterman avatar Jul 13 '15 18:07 cdeterman