{"_id":"non-layered-tidy-tree-layout","_rev":"4-ef0ba4401882eda85f89ba6b3a35a2a3","name":"non-layered-tidy-tree-layout","dist-tags":{"latest":"2.0.2"},"versions":{"1.0.0":{"name":"non-layered-tidy-tree-layout","version":"1.0.0","description":"Draw non-layered tidy trees in linear time","main":"dist/non-layered-tidy-tree-layout.js","module":"src/index.js","repository":{"type":"git","url":"https://github.com/stetrevor/non-layered-tidy-tree-layout.git"},"author":{"name":"Michael Wong"},"license":"MIT","devDependencies":{"@babel/core":"^7.6.3","@babel/preset-env":"^7.6.3","@webpack-cli/init":"^0.2.2","babel-eslint":"^10.0.3","babel-jest":"^24.9.0","babel-loader":"^8.0.6","babel-plugin-syntax-dynamic-import":"^6.18.0","eslint":"^6.5.1","eslint-config-recommended":"^4.0.0","eslint-loader":"^3.0.2","html-webpack-plugin":"^3.2.0","jest":"^24.9.0","webpack":"^4.41.0","webpack-cli":"^3.3.9","webpack-dev-server":"^3.8.2"},"scripts":{"build":"webpack","test":"jest test"},"licenseText":"MIT License\n\nCopyright (c) 2019 Michael Wong\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"non-layered-tidy-tree-layout@1.0.0","dist":{"shasum":"5fd6be247cd8955a94de53bbfc7bc053ec2e3fd6","tarball":"https://registry.npmjs.org/non-layered-tidy-tree-layout/-/non-layered-tidy-tree-layout-1.0.0.tgz","integrity":"sha512-KMPmxXltNE44IkwuCBYVPSToqnVkOS4vGKctqMSRHditYGwllpirJg6syv8TbmfV0iWpQUX5nc2FUxWHHoGxmg==","fileCount":22,"unpackedSize":55226,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdoc49CRA9TVsSAnZWagAA3D0P/0YDHCkJzhm4N2dwiDRJ\nRFQ+BjCr2hz5HYNF6Ii5iqX5eTAp3E41qlLPWyUe1e22ZgUY8xaNNB5IF+F+\nU92Y91L9I247R/nZbfwTdFbBK1dHKO5fKhY/uyaPaHvftxRRT1o6wCFVmM3v\n02VoB4zWj62z/vgOOYvVb4ckGMUHuBwykP2V8QvpQDWRAtakIfdkBj6lQGfn\nKkJqwopPMF6/Sg4TsJ5TthNu3309iHH9kynzXHD0zz/d/o4o80/fZ/LhldCw\nautgZLF299o4HF2QbVjnM8YBKiQMFDU+ctACZ6tbKzZnsT/S47BtJts8XOMu\n4n23gREs8mmpOZGgA+2pXd1Po5O9fc51Am9YFUiKPsNmISVb/E9nGS14m0Td\nXlN4W9z+VwDoUSk0zyOp+1KImgpGjeBgP/3jEZo5szb+3SueuieJfWhPg2YR\ntqO1sYF7zTJbNVgtyKNni1Q3ifAUd6bnnlUymk2fOPlBK0MVPTQAlO5mmdgw\niQZDF83yKxavbvpx50ZMCc8vuHbcChTwhqi00qfwzwlfwaVFx4CHUq1rR7X8\nl7qWU8lDwdsOwT0bULfXuC4OyGedDcRv2EXR2Jy6VTaez9SjuDo3sWF0abtN\nIX3MaeqmERqZiNL4t0tQrwMBCPwKs0no3v7LXrLCjLw8ylGXWI8R1p8GXany\nlzOq\r\n=i2wj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHllOmD4tmkKC3qMl2oq2PrnFNwTsDECRrqak/xcY1AsAiEA2S7atgMgJcQyRb/3rZaPNuvk1N/APUJIPEH3FGW/fIQ="}]},"maintainers":[{"name":"stetrevor","email":"stephen.trevor.wong@outlook.com"}],"_npmUser":{"name":"stetrevor","email":"stephen.trevor.wong@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/non-layered-tidy-tree-layout_1.0.0_1570885180648_0.12437765820919489"},"_hasShrinkwrap":false},"2.0.0":{"name":"non-layered-tidy-tree-layout","version":"2.0.0","description":"Draw non-layered tidy trees in linear time","main":"dist/non-layered-tidy-tree-layout.js","module":"src/index.js","repository":{"type":"git","url":"https://github.com/stetrevor/non-layered-tidy-tree-layout.git"},"author":{"name":"Michael Wong"},"license":"MIT","devDependencies":{"@babel/core":"^7.6.3","@babel/preset-env":"^7.6.3","@webpack-cli/init":"^0.2.2","babel-eslint":"^10.0.3","babel-jest":"^24.9.0","babel-loader":"^8.0.6","babel-plugin-syntax-dynamic-import":"^6.18.0","eslint":"^6.5.1","eslint-config-recommended":"^4.0.0","eslint-loader":"^3.0.2","html-webpack-plugin":"^3.2.0","jest":"^24.9.0","webpack":"^4.41.0","webpack-cli":"^3.3.9","webpack-dev-server":"^3.8.2"},"scripts":{"build":"webpack","test":"jest test"},"licenseText":"MIT License\n\nCopyright (c) 2019 Michael Wong\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"non-layered-tidy-tree-layout@2.0.0","dist":{"shasum":"4dd5c28a6ebeb0e9fb98bbb3ad16a29676e990f7","tarball":"https://registry.npmjs.org/non-layered-tidy-tree-layout/-/non-layered-tidy-tree-layout-2.0.0.tgz","integrity":"sha512-yyB3vIznD891QuLPTWu7TnckhZ4WNAdXq7U71rjUwLOg+R8tuFXII1kQp07G8m9Vxo4Bbylb7aPW9WtELkSmZQ==","fileCount":23,"unpackedSize":58407,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdon/pCRA9TVsSAnZWagAAF6sP/1FlUcrdGnTtyaPaqrRq\nqxkKv6Q2yULx7WtDma6ItXfR/2QGt0Fc1X48Xca/hYoZO48skp/19tCszGJb\n2oEo5K4u0AAatv/kRLLOxMwHg+AmuuMSfff+bFDdivX0ejJHLlmfx18IiOaL\n3drz5+QJyb0FEnMJrT1+vgJY4O/MmFCgtjC1oQVBRAKHAYGw602n0n3zvqTk\nv4zjibNGvRHASyemVKIklz+rq0Ny1o29jMT3FwcHCdGchzhGESC9G1iebSdV\nCR/wON0bdANlLH2Rmqf8oj9CJbvuj1saKkt0hOkxilky9Z/ZTIxeHw3OUJqW\nbKr2B0YdrFm7U/fMgbiljbWiNGiY3ShUMERYTLeCzek56UKHBwP6rInE2Jal\nuaDGOteM3wyL133/WSfZ1bAnDbAkyksSWhEsmtIAtgld67hMcMSv75EWIwCU\nVkCVsKnlELHXJ/GdjuoXJLJGz5jfeP4bNXhBNz6J8r5hT3SatSDdC6aDvqQK\nc2drL4ODs1xYstlxI9EkesvK+OulpJWWq7r49Y7GVT+kF8SRWK//4GNffG2V\nqP8p4KsLLT1AjmbRiyvi+nO1zNbFDpOOjqODqn3XRK23N7PWe5l3TvplgAGI\nZQpafYKN3d5dMsTPa+zsrQDagUlevVHjrw9L9C65UHwLLhM3tRoUlbN8Rxa6\nPO7d\r\n=i1k/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNZYLD1naHnKlRivCTCU3qTbIRARTFeWiX0BmxOIrrugIgBvLARRPZjDuxkY7gdM/yWHuJslP0XL78/i4sOgyukDg="}]},"maintainers":[{"name":"stetrevor","email":"stephen.trevor.wong@outlook.com"}],"_npmUser":{"name":"stetrevor","email":"stephen.trevor.wong@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/non-layered-tidy-tree-layout_2.0.0_1570930664600_0.8370538629248965"},"_hasShrinkwrap":false},"2.0.1":{"name":"non-layered-tidy-tree-layout","version":"2.0.1","description":"Draw non-layered tidy trees in linear time","main":"dist/non-layered-tidy-tree-layout.js","module":"src/index.js","repository":{"type":"git","url":"https://github.com/stetrevor/non-layered-tidy-tree-layout.git"},"author":{"name":"Michael Wong"},"license":"MIT","devDependencies":{"@babel/core":"^7.6.3","@babel/preset-env":"^7.6.3","@webpack-cli/init":"^0.2.2","babel-eslint":"^10.0.3","babel-jest":"^24.9.0","babel-loader":"^8.0.6","babel-plugin-syntax-dynamic-import":"^6.18.0","eslint":"^6.5.1","eslint-config-recommended":"^4.0.0","eslint-loader":"^3.0.2","html-webpack-plugin":"^3.2.0","jest":"^24.9.0","webpack":"^4.41.0","webpack-cli":"^3.3.9","webpack-dev-server":"^3.8.2"},"scripts":{"build":"webpack","test":"jest test"},"licenseText":"MIT License\n\nCopyright (c) 2019 Michael Wong\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"non-layered-tidy-tree-layout@2.0.1","dist":{"shasum":"df5606fbc55859494e581417c2d536df364e8770","tarball":"https://registry.npmjs.org/non-layered-tidy-tree-layout/-/non-layered-tidy-tree-layout-2.0.1.tgz","integrity":"sha512-N+dNg4Ubpq6zlzjNAVCLrypCN327MZom1kFVUPfRq7bltOCPJoM2bKXGjw/Ejr6IDT2N+lvlkRPW81d8MVgWiA==","fileCount":23,"unpackedSize":60254,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdo9sBCRA9TVsSAnZWagAAZAgP/2XgtnHqnmlORv4zEPHv\noVjUWlfVYMlr+ib1YZr3zP/WqDNb+o6D30ekPBx2sGV0FpT7yB0qkN2acPmU\nrFKz4sUMj1FUe2R0QwPeTib5pXtHx/8v3X7uquMCtoPpR+c6uuIdrOJikhKX\n3ayGkZaW99ZmELS1ND5stbHQgY7hP9dgW9lr9n506D8n+oH5lWluw5+qFQF+\n/AExbgPTA3AXB7xBS5EuyVNW+fe/Tm4WOQNyV13zfrUxEWbMMbdp8buTcw7B\nVHLDMBAqHpL5WrieJ710w83c93LQkPfLJBHizAbABwe9uIsMqUHVGc2DHhP7\neQ90gH9o9mWISxi2ivYLZdo9PlRzJCWIh8wBZyOaJuRfCA+VHOizNLtVs5Yd\nBj19fkquY5arFVnsg1zB+fC4WgTbrhZvb3q8wdaV+aWJGOc9ZDeWTPxtJHFY\nbJgzO5XxMadQXxxtVbdkQRdsLoh7Ty4UbWXZBCZnBLgSl7eXl1DNCFhsfaci\nVwps6muhlDbEYJBFVvhB6R9o7XM7qEkVz6nnCkXsRJpYhQukiI/rrOne6+Z5\nLFTDPFtYIwuVMd3hjsMUaTlfXQG3KI/fcYvOOCaauJ5ZwNVHDg93lbrz5rya\nuWZskxymZiSBQD5SclX2J+oFwOQkH8sDEmq2f8I5Qf21irwjOm3vsG4f9MBW\nDaFo\r\n=hoUr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWigTCReT8xiGWf31Y4Nej4VVyMBNCXb9quDGTFKEegQIhAI3HBTleO/0dvhjhNXXQmdjonQj45mXl3HpT1rIAs5sy"}]},"maintainers":[{"name":"stetrevor","email":"stephen.trevor.wong@outlook.com"}],"_npmUser":{"name":"stetrevor","email":"stephen.trevor.wong@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/non-layered-tidy-tree-layout_2.0.1_1571019520825_0.2782987815082285"},"_hasShrinkwrap":false},"2.0.2":{"name":"non-layered-tidy-tree-layout","version":"2.0.2","description":"Draw non-layered tidy trees in linear time","main":"dist/non-layered-tidy-tree-layout.js","module":"src/index.js","repository":{"type":"git","url":"https://github.com/stetrevor/non-layered-tidy-tree-layout.git"},"author":{"name":"Michael Wong"},"license":"MIT","devDependencies":{"@babel/core":"^7.6.3","@babel/preset-env":"^7.6.3","@webpack-cli/init":"^0.2.2","babel-eslint":"^10.0.3","babel-jest":"^24.9.0","babel-loader":"^8.0.6","babel-plugin-syntax-dynamic-import":"^6.18.0","eslint":"^6.5.1","eslint-config-recommended":"^4.0.0","eslint-loader":"^3.0.2","html-webpack-plugin":"^3.2.0","jest":"^24.9.0","webpack":"^4.41.0","webpack-cli":"^3.3.9","webpack-dev-server":"^3.8.2"},"scripts":{"build":"webpack","test":"jest test"},"licenseText":"MIT License\n\nCopyright (c) 2019 Michael Wong\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"non-layered-tidy-tree-layout@2.0.2","dist":{"shasum":"57d35d13c356643fc296a55fb11ac15e74da7804","tarball":"https://registry.npmjs.org/non-layered-tidy-tree-layout/-/non-layered-tidy-tree-layout-2.0.2.tgz","integrity":"sha512-gkXMxRzUH+PB0ax9dUN0yYF0S25BqeAYqhgMaLUFmpXLEk7Fcu8f4emJuOAY0V8kjDICxROIKsTAKsV/v355xw==","fileCount":23,"unpackedSize":61284,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdp9W5CRA9TVsSAnZWagAAo+gQAI0tXe6DmOPT/W8B4QbN\nyKY/D74mRaR7TxZDTJc2DEJW2nyMXppbe6+GL74p18+Yz7XuOa+85plRaNmB\nAjgAISpxpBeYfxImdc/Wtya+IIv8z1qSdvuMQrMNmqhDmsT4lwutl5ht0c35\n7jjSUiOMIzOgWc9hF9KMcRgvyWzn5NNMl9HkhMRwgHXaD9hlkSLGDFNcpnJq\nUCjkodhFwxnBCZp5ig4XJBYe0hAgtxBNBUFwepZlh7nz2wvxfkGPN4wkdn5P\nPTp/NENM8fMj6zTanCuiCHcsTKdn8GGiXNBlIjOoxWcKtqCNi8zWzIMZvEYT\nrnpwYtTSEnLdUl90e2AkHDb3Yh8+RTqvRtjix5g+OBwthJyQ2u6cRx7/Y7cb\nymxJzi1yLYKCv66rJrZnKZbWFaIzTZM8JI8UJjyPMbcEtEEp8JnPZt2cSerd\nwd/nRUs7+6pSiz0pX2oa95bKgUMHR5xPOSef145UbmWDhbbG88zoJ1J4D7SU\nqQD0s1Xga9wf2o2Te/oHoNvFZUjybRtQrb5uWAC79XNRPDjsPGQCMTb6uwwC\nJj5x8xYBcCHkN9c7+2s1KR83rA/jNbb496HZ33sDKR2M4ZrNdmTEVS7sIeuK\nW5hNVtqxEflmfHF0ZFzH7LhtUX7BCYm3twkTttodJVi6ABHp0M9hhaVRc0ux\nAduy\r\n=6kuf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFyM8b4nu7r2oxnSDaoWNZrZCXRcQudlJkcSes6Qj6fNAiEAysW9sn2BkLC66K1EOczejx77gvTWm7/w+aQw5U/NfmY="}]},"maintainers":[{"name":"stetrevor","email":"stephen.trevor.wong@outlook.com"}],"_npmUser":{"name":"stetrevor","email":"stephen.trevor.wong@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/non-layered-tidy-tree-layout_2.0.2_1571280313169_0.7112381944890949"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-12T12:59:40.648Z","1.0.0":"2019-10-12T12:59:40.824Z","modified":"2022-05-11T08:55:15.665Z","2.0.0":"2019-10-13T01:37:44.727Z","2.0.1":"2019-10-14T02:18:41.004Z","2.0.2":"2019-10-17T02:45:13.323Z"},"maintainers":[{"name":"stetrevor","email":"stephen.trevor.wong@outlook.com"}],"description":"Draw non-layered tidy trees in linear time","repository":{"type":"git","url":"https://github.com/stetrevor/non-layered-tidy-tree-layout.git"},"author":{"name":"Michael Wong"},"license":"MIT","readme":"# non-layered-tidy-tree-layout\n\nDraw non-layered tidy trees in linear time.\n\n> This a JavaScript port from the project [cwi-swat/non-layered-tidy-trees](https://github.com/cwi-swat/non-layered-tidy-trees), which is written in Java. The algorithm used in that project is from the paper by _A.J. van der Ploeg_, [Drawing Non-layered Tidy Trees in Linear Time](http://oai.cwi.nl/oai/asset/21856/21856B.pdf). There is another JavaScript port from that project [d3-flextree](https://github.com/Klortho/d3-flextree), which depends on _d3-hierarchy_. This project is dependency free.\n\n## Getting started\n\n### Installation\n\n```\nnpm install non-layered-tidy-tree-layout\n```\n\nOr\n\n```\nyarn add non-layered-tidy-tree-layout\n```\n\nThere's also a built verison: `dist/non-layered-tidy-tree-layout.js` for use with browser `<script>` tag, or as a Javascript module.\n\n### Usage\n\n```js\nimport { BoundingBox, Layout } from 'non-layered-tidy-tree-layout'\n\n// BoundingBox(gap, bottomPadding)\nconst bb = new BoundingBox(10, 20)\nconst layout = new Layout(bb)\nconst treeData = {\n  id: 0,\n  width: 40,\n  height: 40,\n  children: [\n    {\n      id: 1,\n      width: 40,\n      height: 40,\n      children: [{ id: 6, width: 400, height: 40 }]\n    },\n    { id: 2, width: 40, height: 40 },\n    { id: 3, width: 40, height: 40 },\n    { id: 4, width: 40, height: 40 },\n    { id: 5, width: 40, height: 80 }\n  ]\n}\nconst { result, boundingBox } = layout.layout(treeData)\n\n// result:\n// {\n//   id: 0,\n//   x: 300,\n//   y: 0,\n//   width: 40,\n//   height: 40,\n//   children: [\n//     {\n//       id: 1,\n//       x: 185,\n//       y: 60,\n//       width: 40,\n//       height: 40,\n//       children: [\n//         { id: 6, x: 5, y: 120, width: 400, height: 40 }\n//       ]\n//     },\n//     { id: 2, x: 242.5, y: 60, width: 40, height: 40 },\n//     { id: 3, x: 300, y: 60, width: 40, height: 40 },\n//     { id: 4, x: 357.5, y: 60, width: 40, height: 40 },\n//     { id: 5, x: 415, y: 60, width: 40, height: 80 }\n//   ]\n// }\n//\n// boundingBox:\n// {\n//   left: 5,\n//   right: 455,\n//   top: 0,\n//   bottom: 160\n// }\n```\n\nThe method `Layout.layout` modifies `treeData` inplace. It returns an object like `{ result: treeData, boundingBox: {left: num, right: num, top: num, bottom: num} }`. `result` is the same object `treeData` with calculated coordinates, `boundingBox` are the coordinates for the whole tree:\n\n![](./screenshots/1.png)\n\nThe red dashed lines are the bounding boxes for each node. `Layout.layout()` produces coordinates to draw nodes, which are the grey boxes with black border.\n\nThe library also provides a class `Tree` and a method `layout`.\n\n```js\n/**\n * Constructor for Tree.\n * @param {number} width - width of bounding box\n * @param {number} height - height of bounding box\n * @param {number} y - veritcal coordinate of bounding box\n * @param {array} children - a list of Tree instances\n */\nnew Tree(width, height, y, children)\n\n/**\n * Calculate x, y coordindates and assign them to tree.\n * @param {Object} tree - a Tree object\n */\nlayout(tree)\n```\n\nIn case your data structure are not the same as provided by the example above, you can refer to `src/helpers.js` to implement a `Layout` class that converts your data to a `Tree`, then call `layout` to calculate the coordinates for drawing.\n\n## License\n\n[MIT](./LICENSE)\n\n## Changelog\n\n### [2.0.1]\n- Fixed bounding box calculation in `Layout.getSize` and `Layout.assignLayout` and `Layout.layout`\n### [2.0.0]\n- Added `Layout.layout`\n- Removed `Layout.layoutTreeData`\n### [1.0.0]\n- Added `Layout`, `BoundingBox`, `layout`, `Tree`","readmeFilename":"README.md"}