title: Is there a way to combine size based on a variable and input_slider in ggvis?
body: <p>Using a minor modification to the code in the <a href="http://ggvis.rstudio.com/ggvis-basics.html" rel="nofollow noreferrer">ggvis basics</a> and <a href="http://ggvis.rstudio.com/interactivity.html" rel="nofollow noreferrer">ggvis interactivity</a> pages, I have the following two code snippets:</p>
  
  <pre><code>mtcars %&gt;% 
    ggvis(~mpg, ~disp) %&gt;% 
    layer_points(size=~vs) %&gt;%
    scale_numeric("size", range = c(50,500))
  
  mtcars %&gt;% 
    ggvis(~mpg, ~disp) %&gt;%
    layer_points(size := input_slider(50, 500, value = 50))
  </code></pre>
  
  <p>The first generates a plot:</p>
  
  <p><img src="https://i.stack.imgur.com/CGmgY.png" alt="enter image description here"></p>
  
  <p>And the second generates a similar plot where point size is controlled by the slider.  </p>
  
  <p>What I am looking for is how do I combine the two? That is, how can I have a relative size determined by a variable, and the range of those possible sizes determined by a slider?</p>
  
  <p>It seems as though something like the following is what is needed, but <code>range</code> can't take <code>input_slider</code> as an assignment (<code>domain</code> can, but that doesn't achieve the desired results.)</p>
  
  <pre><code>mtcars %&gt;% 
    ggvis(~mpg, ~disp) %&gt;% 
    layer_points(size:=~vs) %&gt;% 
    scale_numeric("size", clamp = TRUE,
                  range = input_slider(50, 500, map = function(x) c(x, 10*x))
    )
  </code></pre>
  
  <p><strong>Question: how can I have a relative size determined by a variable, and the range of those possible sizes determined by a slider?</strong></p>