{"_id":"layout","_rev":"409853","name":"layout","description":"Organize and layout items based on various algorithms","dist-tags":{"latest":"2.2.0"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"time":{"modified":"2021-08-04T05:04:21.000Z","created":"2012-11-06T08:35:41.994Z","2.2.0":"2015-02-19T05:31:32.408Z","2.1.0":"2015-01-27T04:56:30.315Z","2.0.2":"2014-12-14T12:59:27.343Z","2.0.1":"2014-12-14T12:16:02.732Z","2.0.0":"2014-04-16T06:13:53.480Z","1.3.2":"2014-04-16T06:09:26.100Z","1.3.1":"2013-06-19T05:29:03.746Z","1.3.0":"2013-04-26T09:13:28.500Z","1.2.1":"2012-11-15T09:51:12.055Z","1.2.0":"2012-11-15T09:34:43.073Z","1.1.0":"2012-11-15T08:50:12.326Z","0.2.0":"2012-11-15T08:20:37.215Z","0.1.1":"2012-11-06T08:43:51.410Z","0.1.0":"2012-11-06T08:35:41.994Z"},"users":{"timdp":true,"moimikey":true,"detj":true},"author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/layout.git"},"versions":{"2.2.0":{"name":"layout","description":"Organize and layout items based on various algorithms","version":"2.2.0","homepage":"https://github.com/twolfson/layout","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/layout.git"},"bugs":{"url":"https://github.com/twolfson/layout/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/layout/blob/master/LICENSE-MIT"}],"main":"lib/layout","engines":{"node":">= 0.8.0"},"scripts":{"lint":"jshint lib/ test/","test":"npm run lint && nodeunit test/"},"devDependencies":{"grunt":"~0.4.5","grunt-cli":"~0.1.13","grunt-spritesmith":"~2.20.0","jshint":"~2.5.10","nodeunit":"~0.9.0"},"keywords":["layout","blueprint","organize","pack","algorithm"],"dependencies":{"bin-pack":"~1.0.1"},"gitHead":"eaf4c254dee37afbde0eec2c82b343869c6049db","_id":"layout@2.2.0","_shasum":"31e44bfc18dd1019b3ffb208e402a4bbfe2e6af4","_from":".","_npmVersion":"2.3.0","_nodeVersion":"0.10.35","_npmUser":{"name":"twolfson","email":"todd@twolfson.com"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"dist":{"shasum":"31e44bfc18dd1019b3ffb208e402a4bbfe2e6af4","size":9009,"noattachment":false,"key":"/layout/-/layout-2.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/layout/download/layout-2.2.0.tgz"},"directories":{},"publish_time":1424323892408,"_cnpm_publish_time":1424323892408,"_hasShrinkwrap":false},"2.1.0":{"name":"layout","description":"Organize and layout items based on various algorithms","version":"2.1.0","homepage":"https://github.com/twolfson/layout","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/layout.git"},"bugs":{"url":"https://github.com/twolfson/layout/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/layout/blob/master/LICENSE-MIT"}],"main":"lib/layout","engines":{"node":">= 0.8.0"},"scripts":{"lint":"jshint lib/ test/","test":"npm run lint && nodeunit test/"},"devDependencies":{"grunt":"~0.4.5","grunt-cli":"~0.1.13","grunt-spritesmith":"~2.20.0","jshint":"~2.5.10","nodeunit":"~0.9.0"},"keywords":["layout","blueprint","organize","pack","algorithm"],"dependencies":{"boxpack":"0.1.0"},"gitHead":"9ce0e0a505f41f1369e96966e5eae1850f400c8b","_id":"layout@2.1.0","_shasum":"591aef3ac2c0a41b9a3a7ab9e238b130ed242aac","_from":".","_npmVersion":"2.3.0","_nodeVersion":"0.10.35","_npmUser":{"name":"twolfson","email":"todd@twolfson.com"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"dist":{"shasum":"591aef3ac2c0a41b9a3a7ab9e238b130ed242aac","size":8987,"noattachment":false,"key":"/layout/-/layout-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/layout/download/layout-2.1.0.tgz"},"directories":{},"publish_time":1422334590315,"_cnpm_publish_time":1422334590315,"_hasShrinkwrap":false},"2.0.2":{"name":"layout","description":"Organize and layout items based on various algorithms","version":"2.0.2","homepage":"https://github.com/twolfson/layout","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/layout.git"},"bugs":{"url":"https://github.com/twolfson/layout/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/layout/blob/master/LICENSE-MIT"}],"main":"lib/layout","engines":{"node":">= 0.8.0"},"scripts":{"lint":"jshint lib/ test/","test":"npm run lint && nodeunit test/"},"devDependencies":{"grunt":"~0.4.5","grunt-cli":"~0.1.13","grunt-spritesmith":"~2.20.0","jshint":"~2.5.10","nodeunit":"~0.9.0"},"keywords":["layout","blueprint","organize","pack","algorithm"],"dependencies":{"binpacking":"0.0.1"},"gitHead":"b1bb33a0a32680f02484a75f0396c70688f0d0e6","_id":"layout@2.0.2","_shasum":"9ef4ae394ff805b4ebd72bc7a49edff8e6d0cf5d","_from":".","_npmVersion":"2.1.7","_nodeVersion":"0.10.33","_npmUser":{"name":"twolfson","email":"todd@twolfson.com"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"dist":{"shasum":"9ef4ae394ff805b4ebd72bc7a49edff8e6d0cf5d","size":8798,"noattachment":false,"key":"/layout/-/layout-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/layout/download/layout-2.0.2.tgz"},"directories":{},"publish_time":1418561967343,"_cnpm_publish_time":1418561967343,"_hasShrinkwrap":false},"2.0.1":{"name":"layout","description":"Organize and layout items based on various algorithms","version":"2.0.1","homepage":"https://github.com/twolfson/layout","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/layout.git"},"bugs":{"url":"https://github.com/twolfson/layout/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/layout/blob/master/LICENSE-MIT"}],"main":"lib/layout","engines":{"node":">= 0.8.0"},"scripts":{"lint":"jshint lib/ test/","test":"npm run lint && nodeunit test/"},"devDependencies":{"jshint":"~2.5.10","nodeunit":"~0.9.0"},"keywords":["layout","blueprint","organize","pack","algorithm"],"dependencies":{"binpacking":"0.0.1"},"gitHead":"ec3c9453c3cac0bf2c2531af7f0c8d84ce21628f","_id":"layout@2.0.1","_shasum":"366bceb740bef8751b105e0cef1475b377262376","_from":".","_npmVersion":"2.1.7","_nodeVersion":"0.10.33","_npmUser":{"name":"twolfson","email":"todd@twolfson.com"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"dist":{"shasum":"366bceb740bef8751b105e0cef1475b377262376","size":6106,"noattachment":false,"key":"/layout/-/layout-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/layout/download/layout-2.0.1.tgz"},"directories":{},"publish_time":1418559362732,"_cnpm_publish_time":1418559362732,"_hasShrinkwrap":false},"2.0.0":{"name":"layout","description":"Organize and layout items based on various algorithms","version":"2.0.0","homepage":"https://github.com/twolfson/layout","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/layout.git"},"bugs":{"url":"https://github.com/twolfson/layout/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/layout/blob/master/LICENSE-MIT"}],"main":"lib/layout","engines":{"node":">= 0.6.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"~0.3.12"},"keywords":["layout","blueprint","organize","pack","algorithm"],"dependencies":{"binpacking":"0.0.1"},"_id":"layout@2.0.0","dist":{"shasum":"45130bd95fbf81bec16aa6a0ab1a8b3408b55bfb","size":6170,"noattachment":false,"key":"/layout/-/layout-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/layout/download/layout-2.0.0.tgz"},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"twolfson","email":"todd@twolfson.com"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"directories":{},"publish_time":1397628833480,"_cnpm_publish_time":1397628833480,"_hasShrinkwrap":false},"1.3.2":{"name":"layout","description":"Organize and layout items based on various algorithms","version":"1.3.2","homepage":"https://github.com/twolfson/layout","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/layout.git"},"bugs":{"url":"https://github.com/twolfson/layout/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/layout/blob/master/LICENSE-MIT"}],"main":"lib/layout","engines":{"node":">= 0.6.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"~0.3.12"},"keywords":["layout","blueprint","organize","pack","algorithm"],"dependencies":{"binpacking":"0.0.1"},"_id":"layout@1.3.2","dist":{"shasum":"27aaae5c4ebeb8257199fbd4d860fcc986ca21d0","size":5930,"noattachment":false,"key":"/layout/-/layout-1.3.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/layout/download/layout-1.3.2.tgz"},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"twolfson","email":"todd@twolfson.com"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"directories":{},"publish_time":1397628566100,"_cnpm_publish_time":1397628566100,"_hasShrinkwrap":false},"1.3.1":{"name":"layout","description":"Organize and layout items based on various algorithms","version":"1.3.1","homepage":"https://github.com/twolfson/layout","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/layout.git"},"bugs":{"url":"https://github.com/twolfson/layout/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/layout/blob/master/LICENSE-MIT"}],"main":"lib/layout","engines":{"node":">= 0.6.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"~0.3.12"},"keywords":["layout","blueprint","organize","pack","algorithm"],"dependencies":{"binpacking":"0.0.1"},"readmeFilename":"README.md","_id":"layout@1.3.1","dist":{"shasum":"73a180e5e566dafd162bcb04dd7a5ff785247afa","size":5653,"noattachment":false,"key":"/layout/-/layout-1.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/layout/download/layout-1.3.1.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"twolfson","email":"todd@twolfson.com"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"directories":{},"publish_time":1371619743746,"_cnpm_publish_time":1371619743746,"_hasShrinkwrap":false},"1.3.0":{"name":"layout","description":"Organize and layout items based on various algorithms","version":"1.3.0","homepage":"https://github.com/twolfson/layout","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/layout.git"},"bugs":{"url":"https://github.com/twolfson/layout/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/layout/blob/master/LICENSE-MIT"}],"main":"lib/layout","engines":{"node":">= 0.6.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"~0.3.12"},"keywords":["layout","blueprint","organize","pack","algorithm"],"dependencies":{"binpacking":"0.0.1"},"readmeFilename":"README.md","_id":"layout@1.3.0","dist":{"shasum":"8e85277a97619530db1d851678ea72e46258260c","size":5624,"noattachment":false,"key":"/layout/-/layout-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/layout/download/layout-1.3.0.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"twolfson","email":"todd@twolfson.com"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"directories":{},"publish_time":1366967608500,"_cnpm_publish_time":1366967608500,"_hasShrinkwrap":false},"1.2.1":{"name":"layout","description":"Organize and layout items based on various algorithms","version":"1.2.1","homepage":"https://github.com/twolfson/layout","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/layout.git"},"bugs":{"url":"https://github.com/twolfson/layout/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/layout/blob/master/LICENSE-MIT"}],"main":"lib/layout","engines":{"node":">= 0.6.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"~0.3.12"},"keywords":["layout","blueprint","organize","pack","algorithm"],"_id":"layout@1.2.1","dist":{"shasum":"17be1a9069c448e5b38638f331cedf87d896d883","size":5436,"noattachment":false,"key":"/layout/-/layout-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/layout/download/layout-1.2.1.tgz"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"directories":{},"publish_time":1352973072055,"_cnpm_publish_time":1352973072055,"_hasShrinkwrap":false},"1.2.0":{"name":"layout","description":"Organize and layout items based on various algorithms","version":"1.2.0","homepage":"https://github.com/twolfson/layout","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/layout.git"},"bugs":{"url":"https://github.com/twolfson/layout/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/layout/blob/master/LICENSE-MIT"}],"main":"lib/layout","engines":{"node":">= 0.6.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"~0.3.12"},"keywords":["layout","blueprint","organize","pack","algorithm"],"_id":"layout@1.2.0","dist":{"shasum":"4fdedacf2d761d419909fe13d3330b3e87c7f67f","size":5084,"noattachment":false,"key":"/layout/-/layout-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/layout/download/layout-1.2.0.tgz"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"directories":{},"publish_time":1352972083073,"_cnpm_publish_time":1352972083073,"_hasShrinkwrap":false},"1.1.0":{"name":"layout","description":"Organize and layout items based on various algorithms","version":"1.1.0","homepage":"https://github.com/twolfson/layout","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/layout.git"},"bugs":{"url":"https://github.com/twolfson/layout/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/layout/blob/master/LICENSE-MIT"}],"main":"lib/layout","engines":{"node":">= 0.6.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"~0.3.12"},"keywords":["layout","blueprint","organize","pack","algorithm"],"_id":"layout@1.1.0","dist":{"shasum":"bf10d2554cf988dc54a0fbc4f6c41984144704ca","size":4810,"noattachment":false,"key":"/layout/-/layout-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/layout/download/layout-1.1.0.tgz"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"directories":{},"publish_time":1352969412326,"_cnpm_publish_time":1352969412326,"_hasShrinkwrap":false},"0.2.0":{"name":"layout","description":"Organize and layout items based on various algorithms","version":"0.2.0","homepage":"https://github.com/twolfson/layout","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/layout.git"},"bugs":{"url":"https://github.com/twolfson/layout/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/layout/blob/master/LICENSE-MIT"}],"main":"lib/layout","engines":{"node":">= 0.6.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"~0.3.12"},"keywords":["layout","blueprint","organize","pack","algorithm"],"_id":"layout@0.2.0","dist":{"shasum":"82116d9d74a6e42e189fef205ff27d11ab7f4072","size":4670,"noattachment":false,"key":"/layout/-/layout-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/layout/download/layout-0.2.0.tgz"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"directories":{},"publish_time":1352967637215,"_cnpm_publish_time":1352967637215,"_hasShrinkwrap":false},"0.1.1":{"name":"layout","description":"Organize and layout items based on various algorithms","version":"0.1.1","homepage":"https://github.com/twolfson/layout","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/layout.git"},"bugs":{"url":"https://github.com/twolfson/layout/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/layout/blob/master/LICENSE-MIT"}],"main":"lib/layout","engines":{"node":">= 0.6.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"~0.3.12"},"keywords":["layout","blueprint","organize","pack","algorithm"],"_id":"layout@0.1.1","dist":{"shasum":"36b9a1d96580268bd8a27a618e339e3ae05a4e41","size":3961,"noattachment":false,"key":"/layout/-/layout-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/layout/download/layout-0.1.1.tgz"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"directories":{},"publish_time":1352191431410,"_cnpm_publish_time":1352191431410,"_hasShrinkwrap":false},"0.1.0":{"name":"layout","description":"Organize and layout items based on various algorithms","version":"0.1.0","homepage":"https://github.com/twolfson/layout","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/layout.git"},"bugs":{"url":"https://github.com/twolfson/layout/issues"},"licenses":[{"type":"MIT","url":"https://github.com/twolfson/layout/blob/master/LICENSE-MIT"}],"main":"lib/layout","engines":{"node":">= 0.6.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"~0.3.12"},"keywords":["layout","blueprint","organize","pack","algorithm"],"_id":"layout@0.1.0","dist":{"shasum":"42c4a4d93ef2249abe8cd59eed8d2652c2aabb74","size":2194,"noattachment":false,"key":"/layout/-/layout-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/layout/download/layout-0.1.0.tgz"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"directories":{},"publish_time":1352190941994,"_cnpm_publish_time":1352190941994,"_hasShrinkwrap":false}},"readme":"# layout [![Build status](https://travis-ci.org/twolfson/layout.png?branch=master)](https://travis-ci.org/twolfson/layout)\n\nOrganize and layout items based on various algorithms\n\nVisualizations of output data:\n\n|         `top-down`        |          `left-right`         |         `diagonal`        |           `alt-diagonal`          |          `binary-tree`          |\n|---------------------------|-------------------------------|---------------------------|-----------------------------------|---------------------------------|\n| ![top-down][top-down-img] | ![left-right][left-right-img] | ![diagonal][diagonal-img] | ![alt-diagonal][alt-diagonal-img] | ![binary-tree][binary-tree-img] |\n\n[top-down-img]: docs/top-down.png\n[left-right-img]: docs/left-right.png\n[diagonal-img]: docs/diagonal.png\n[alt-diagonal-img]: docs/alt-diagonal.png\n[binary-tree-img]: docs/binary-tree.png\n\n## Getting Started\nInstall the module with: `npm install layout`\n\n```js\n// Load in layout\nvar layout = require('layout');\n\n// Generate a new layer to organize items on\nvar layer = layout('top-down');\n\n// Add items that you want to organize\nlayer.addItem({'height': 20, 'width': 10, 'meta': 'medium'});\nlayer.addItem({'height': 10, 'width': 10, 'meta': 'small'});\nlayer.addItem({'height': 50, 'width': 40, 'meta': 'large'});\n\n// Export the info\nvar info = layer['export']();\n\n// We get back the width and height of the pack as well as organized items\n{\n    height: 80,\n    width: 40,\n    items: [{\n        height: 10,\n        width: 10,\n        meta: 'small',\n        x: 0,\n        y: 0\n    }, {\n        height: 20,\n        width: 10,\n        meta: 'medium',\n        x: 0,\n        y: 10\n    }, {\n        height: 50,\n        width: 40,\n        meta: 'large',\n        x: 0,\n        y: 30\n    }]\n}\n```\n\n## Documentation\nLayout is a constructor function\n\n```js\n/**\n * Layout adds items in an algorithmic fashion\n * @constructor\n * @param {String|Object} [algorithm=\"top-down\"] Name of algorithm or custom algorithm to use\n *   Available algorithms are listed in the Algorithms section\n * @param {Mixed} [options] Options to provide for the algorithm\n */\n```\n\nItems can be added via `addItem` which are required to have a `height` and `width`. Any additional info should be stored inside of `meta`.\n\n```js\n/**\n * @param {Object} item Item to store -- this currently is mutated in-memory\n * @param {Number} item.width Width of the item\n * @param {Number} item.height Height of the item\n * @param {Mixed} [item.meta] Any meta data you would like to store related to the item\n */\n```\n\n`export` is how you take your items and organize them.\n\n```js\n/**\n * @returns {Object} retObj\n * @returns {Number} retObj.height Height of the processed layout\n * @returns {Number} retObj.width Width of the processed layout\n * @returns {Mixed[]} retObj.items Organized items\n */\n```\n\n### Algorithms\nCurrently `layout` supports 5 different layout types which are listed below.\n\n#### `top-down`\nThe `top-down` algorithm places items vertically.\n\n![top-down image][top-down-img]\n\nBy default, it sorts from smallest (top) to largest (bottom). However, this can be disabled via `sort: false`.\n\n**Options:**\n\n- sort `Boolean` Flag to enable/disable sorting from smallest (top) to largest (bottom)\n    - By default, this is enabled (`true`)\n\n#### `left-right`\nThe `left-right` algorithm places items horizontally.\n\n![left-right image][left-right-img]\n\nBy default, it sorts from smallest (left) to largest (right). However, this can be disabled via `sort: false`.\n\n**Options:**\n\n- sort `Boolean` Flag to enable/disable sorting from smallest (left) to largest (right)\n    - By default, this is enabled (`true`)\n\n#### `diagonal`\nThe `diagonal` algorithm places items diagonally (top-left to bottom-right).\n\n![diagonal image][diagonal-img]\n\nBy default, it sorts from smallest (top-left) to largest (bottom-right). However, this can be disabled via `sort: false`.\n\n**Options:**\n\n- sort `Boolean` Flag to enable/disable sorting from smallest (top-left) to largest (bottom-right)\n    - By default, this is enabled (`true`)\n\n#### `alt-diagonal`\nThe `alt-diagonal` algorithm places items diagonally (top-right to bottom-left).\n\n![alt-diagonal image][alt-diagonal-img]\n\nBy default, it sorts from smallest (top-right) to largest (bottom-left). However, this can be disabled via `sort: false`.\n\n**Options:**\n\n- sort `Boolean` Flag to enable/disable sorting from smallest (top-right) to largest (bottom-left)\n    - By default, this is enabled (`true`)\n\n#### `binary-tree`\nThe `binary-tree` algorithm packs items via the [binary tree algorithm][].\n\nThis is an efficient way to pack items into the smallest container possible.\n\n[binary tree algorithm]: http://codeincomplete.com/posts/2011/5/7/bin_packing/\n\n![binary-tree image][binary-tree-img]\n\n### Custom algorithms\nYou can add your own algorithm via `layout.addAlgorithm`\n```js\n/**\n * Method to add new algorithms via\n * @param {String} name Name of algorithm\n * @param {Object} algorithm Algorithm to bind under name\n * @param {Function} algorithm.sort Algorithm to sort object by\n * @param {Function} algorithm.placeItems Algorithm to place items by\n */\n```\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint via `npm run lint` and test via `npm test`.\n\n## Donating\nSupport this project and [others by twolfson][gratipay] via [gratipay][].\n\n[![Support via Gratipay][gratipay-badge]][gratipay]\n\n[gratipay-badge]: https://cdn.rawgit.com/gratipay/gratipay-badge/2.x.x/dist/gratipay.png\n[gratipay]: https://www.gratipay.com/twolfson/\n\n## License\nCopyright (c) 2012-2014 Todd Wolfson\nLicensed under the MIT license.\n","_attachments":{},"homepage":"https://github.com/twolfson/layout","bugs":{"url":"https://github.com/twolfson/layout/issues"}}