An open API service indexing awesome lists of open source software.

https://github.com/appfigures/pack.js

Numerical packing algorithm for Javascript
https://github.com/appfigures/pack.js

Last synced: 4 months ago
JSON representation

Numerical packing algorithm for Javascript

Awesome Lists containing this project

README

          

# pack.js

Pack.js is a shape packing library for Javascript that uses a numerical packing algorithm. Pack.js isn't optimal (it doesn't produce the most space-eficient results), but due to its numeric nature it's great for creating more organic looking graphics. It's useful for creating interesting-looking visualizations such as word clouds.

![](http://appfigures.github.io/pack.js/images/packjs.png)
[Demo](http://appfigures.github.io/pack.js/example)

# How does it work

We use a simple verlet-based physics simulation under the hood. Gravity wells can be used to cluster objects around a specific point and collision detection to prevent shapes from intersecting.