We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var bins = [ { width: 10, height: 20 }, { width: 1000, height: 100 }, { width: 50, height: 19 }, { width: 50, height: 19 }, { width: 50, height: 19 }, { width: 50, height: 19 }, { width: 50, height: 19 }, { width: 50, height: 19 }, { width: 50, height: 19 }, { width: 50, height: 19 }, { width: 50, height: 19 }, { width: 50, height: 19 }, ]; var result = pack(bins, { maxWidth: 144}); console.log(result); result.items.forEach((item: any) => { console.log(item); });
Yeilds:
{ width: 1000, height: 215, items: [ { width: 1000, height: 100, item: [Object], x: 0, y: 0 }, { width: 50, height: 19, item: [Object], x: 0, y: 100 }, { width: 50, height: 19, item: [Object], x: 50, y: 100 }, { width: 50, height: 19, item: [Object], x: 0, y: 119 }, { width: 50, height: 19, item: [Object], x: 50, y: 119 }, { width: 50, height: 19, item: [Object], x: 0, y: 138 }, { width: 50, height: 19, item: [Object], x: 50, y: 138 }, { width: 50, height: 19, item: [Object], x: 0, y: 157 }, { width: 50, height: 19, item: [Object], x: 50, y: 157 }, { width: 50, height: 19, item: [Object], x: 0, y: 176 }, { width: 50, height: 19, item: [Object], x: 50, y: 176 }, { width: 10, height: 20, item: [Object], x: 0, y: 195 } ] }
It doesn't return any form of error or explicitly call out which ones go beyond packing comfortably within the constraint
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: