I'm experimenting with using the particles package to build a variation on sinaplot and beeswarm plots, with d3-style packing.

Why? Aesthetically, I'd like the points to be more closely packed than sinaplot, and down the road it might be interesting to animate between different categorizations of the same points.

I've made a basic example (fun!) but I'm having trouble getting the packing to settle the way I'd like, with the points packed and as close as feasible to their targets. Any suggestions?

I started with the "# Random overlapping circles" example in the particles readme at https://github.com/thomasp85/particles

```
library(particles);
library(tidyverse);
library(tidygraph)
data <- tibble(x1 = rep(1:3, 30), y1 = runif(90) * x1, radius = runif(90, min=0.05, 0.5))
set.seed(0)
# Plotting function
graph_plot <- . %>% {
gr <- as_tibble(.)
p <-
ggplot(gr, aes(x,y, size = radius, color = abs(y+x-y1-x1))) +
scale_size_area() +
scale_color_viridis_c() +
coord_cartesian(xlim = c(0.5, 3.5), ylim = c(-0.5,3.5)) +
guides(color = FALSE, size = FALSE) +
geom_point(alpha=1/2) + theme_minimal()
plot(p)
}
tbl_graph(data) %>%
simulate(velocity_decay = 0.7, setup = predefined_genesis(x1,y1)) %>%
wield(collision_force, radius = radius*0.8, n_iter = 2,
name = 'collide', strength = 0.4) %>%
evolve(4, on_generation = graph_plot) %>%
unwield('collide') %>%
clear_history() %>%
# weaker, narrower collision force to help coalesce
wield(collision_force, radius = radius*0.5, n_iter = 2,
strength = 0.1) %>%
wield(x_force, x = x1, strength = 0.8) %>%
wield(y_force, y = y1, strength = 0.2) %>%
evolve(100, on_generation = graph_plot)
```