quadrekt
Pack rectangles to rectangle in asynchronous manner
Install
npm i quadrekt
Usage
const quadrekt = ;
API
quadrekt(rects, [options])
rects
Type: Object[]
Array of objects representing rectangles to be packed. Each object should include width
, height
and (optionally) data
properties. data
property will be included in resulting array of packed rects.
options
Type Object
Possible options:
maxWidth
— width of target rectangle (to which other rects will be packed) (default: 2048)rectsPerTick
— amount of rectangles to pack during one tick (default: 50)
TODO
- Add unit tests