Is it possible to make a bubble chart similar to this one using R
, preferably ggplot2
?
Given that there are three categories in this example, the properties are
- all circles attract one another (to clump circles together)
- collision detection (to stop circles overlapping)
- circles are attracted to one of three centers, depending on their category
Source: d3indepth.com/force-layout
data (though I am really sure what the data should look like for a plot of this kind)
set.seed(1)
dat <- data.frame(category = rep(c("A", "B", "C"), each = 10),
bubble = rep(1:10, 3),
radius = round(runif(30, min = 0.5, max = 3), 2),
stringsAsFactors = FALSE)
dat
I'm tagging this with d3.js - which I am not familiar with - although the question is about But feel free to edit the tags and/or post.R
. I hope to attract community members that are familiar with either.
Thanks.