Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including rects-bin-pack with all npm packages installed. Try it out:

const rectsBinPack = require("rects-bin-pack") const MaxRectsBinPack = rectsBinPack.MaxRectsBinPack; const pack = new MaxRectsBinPack(512, 256, false); const rectangles = [{ width: 20, height: 100, id: '1' }, { width: 200, height: 70, id: '2' }, { width: 30, height: 70, id: '3' }]; const result = pack.insert2(rectangles, rectsBinPack.BestShortSideFit); console.log(result);

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

rects-bin-pack v0.1.3

MaxRects Algorithm javascript implementation

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free