jcheng5 / bubbles

d3 Bubble Chart for R
MIT License
57 stars 23 forks source link

Ordering the bubbles #1

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi,

In bubbles.js replacing .sort(null) by .sort( function(a, b) { return -(a.value - b.value);} ) orders the bubbles from the center to the edge. I am wondering how to include this as an option (e.g. order = TRUE). Then I guess it will be necessary to pass a list to htmlwidgets::createWidget. But how to retrieve the two elements in the JS function (the data frame currently returned and the order TRUE/FALSE value)?

Thank you!

jcheng5 commented 9 years ago

Is there a reason you can't just sort the data before you pass it to bubbles?