rstudio / ggvis

Interactive grammar of graphics for R
Other
713 stars 171 forks source link

Unexpected behavior with height parameter in layers_rect with numeric scale #449

Open jrdnmdhl opened 8 years ago

jrdnmdhl commented 8 years ago

Line below seems like it ought to create a rectangle with width of 10 and height of 10. Instead, it creates a rectangle with a width of greater than 10 and height of 1, at least for what is in the viewable area. ggvis(data=data.frame(x=0,y=0,h=10,w=10),~x,~y,height=~h,width=~w) %>% layer_rects()

I have also seen some cases where the rectangles will overflow the plot area.

A workaround is to supply x2/y2 instead of width/height, but this results in different animation behavior when the sign of the height changes. plot_975901063