{"versions":{"2.1.2":{"name":"d3-flextree","version":"2.1.2","main":"build/d3-flextree.js","module":"index","jsnext:main":"index","author":{"name":"Chris Maloney","url":"http://chrismaloney.org"},"description":"Flexible tree layout algorithm that allows for variable node sizes.","keywords":["d3","d3-module","layout","tree","hierarchy","d3-hierarchy","plugin","d3-plugin","infovis","visualization","2d"],"homepage":"https://github.com/klortho/d3-flextree","license":"WTFPL","repository":{"type":"git","url":"git+https://github.com/klortho/d3-flextree.git"},"scripts":{"clean":"rm -rf build demo test","build:demo":"rollup -c --environment BUILD:demo","build:dev":"rollup -c --environment BUILD:dev","build:prod":"rollup -c --environment BUILD:prod","build:test":"rollup -c --environment BUILD:test","build":"rollup -c","lint":"eslint index.js src","test:main":"node test/bundle.js","test:browser":"node test/browser-tests.js","test":"npm-run-all test:*","prepare":"npm-run-all clean build lint test"},"dependencies":{"d3-hierarchy":"^1.1.5"},"devDependencies":{"babel-plugin-external-helpers":"^6.22.0","babel-preset-es2015-rollup":"^3.0.0","d3":"^4.13.0","d3-selection-multi":"^1.0.1","eslint":"^4.19.1","jsdom":"^11.6.2","npm-run-all":"^4.1.2","rollup":"^0.55.3","rollup-plugin-babel":"^2.7.1","rollup-plugin-commonjs":"^8.0.2","rollup-plugin-copy":"^0.2.3","rollup-plugin-json":"^2.3.0","rollup-plugin-node-resolve":"^3.0.2","rollup-plugin-uglify":"^3.0.0","uglify-es":"^3.3.9"},"gitHead":"af196220927218bbe7ac6cad8e059f56430befb6","bugs":{"url":"https://github.com/klortho/d3-flextree/issues"},"_id":"d3-flextree@2.1.2","_nodeVersion":"14.17.5","_npmVersion":"8.1.3","dist":{"shasum":"1f0419f4e6c972e096dd884627a87b6b38e7ba73","size":174202,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/d3-flextree/-/d3-flextree-2.1.2.tgz","integrity":"sha512-gJiHrx5uTTHq44bjyIb3xpbmmdZcWLYPKeO9EPVOq8EylMFOiH2+9sWqKAiQ4DcFuOZTAxPOQyv0Rnmji/g15A=="},"_npmUser":{"name":"anonymous","email":"voldrani@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"voldrani@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d3-flextree_2.1.2_1636412046317_0.2771988773177618"},"_hasShrinkwrap":false,"publish_time":1636412046510,"_cnpm_publish_time":1636412046510,"_cnpmcore_publish_time":"2021-12-17T09:18:04.430Z","contributors":[]},"2.1.1":{"name":"d3-flextree","version":"2.1.1","main":"build/d3-flextree.js","module":"index","jsnext:main":"index","author":{"name":"Chris Maloney","url":"http://chrismaloney.org"},"description":"Flexible tree layout algorithm that allows for variable node sizes.","keywords":["d3","d3-module","layout","tree","hierarchy","d3-hierarchy","plugin","d3-plugin","infovis","visualization","2d"],"homepage":"https://github.com/klortho/d3-flextree","license":"WTFPL","repository":{"type":"git","url":"git+https://github.com/klortho/d3-flextree.git"},"scripts":{"clean":"rm -rf build demo test","build:demo":"rollup -c --environment BUILD:demo","build:dev":"rollup -c --environment BUILD:dev","build:prod":"rollup -c --environment BUILD:prod","build:test":"rollup -c --environment BUILD:test","build":"rollup -c","lint":"eslint index.js src","test:main":"node test/bundle.js","test:browser":"node test/browser-tests.js","test":"npm-run-all test:*","prepare":"npm-run-all clean build lint test"},"dependencies":{"d3-hierarchy":"^1.1.5"},"devDependencies":{"babel-plugin-external-helpers":"^6.22.0","babel-preset-es2015-rollup":"^3.0.0","d3":"^4.13.0","d3-selection-multi":"^1.0.1","eslint":"^4.19.1","jsdom":"^11.6.2","npm-run-all":"^4.1.2","rollup":"^0.55.3","rollup-plugin-babel":"^2.7.1","rollup-plugin-commonjs":"^8.0.2","rollup-plugin-copy":"^0.2.3","rollup-plugin-json":"^2.3.0","rollup-plugin-node-resolve":"^3.0.2","rollup-plugin-uglify":"^3.0.0","uglify-es":"^3.3.9"},"gitHead":"b1fe7cd17536c919a73ed933d3fec50e9ae23f3e","bugs":{"url":"https://github.com/klortho/d3-flextree/issues"},"_id":"d3-flextree@2.1.1","_npmVersion":"5.8.0","_nodeVersion":"8.11.1","_npmUser":{"name":"anonymous","email":"voldrani@gmail.com"},"dist":{"shasum":"0e6b8b89b0602b073db2f488b5b8030ce318dde9","size":173835,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/d3-flextree/-/d3-flextree-2.1.1.tgz","integrity":"sha512-P0SK6bRm0PT5ZZON8Lh/aOcFfr4rO53kaYCXCgwBCvsHJcYjtOb8fNrgmpOmCMCgfrT9EczXzD8wqEO8mlkBrA=="},"maintainers":[{"name":"anonymous","email":"voldrani@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d3-flextree_2.1.1_1523899288840_0.35880770664215933"},"_hasShrinkwrap":false,"publish_time":1523899288963,"_cnpm_publish_time":1523899288963,"_cnpmcore_publish_time":"2021-12-17T09:18:04.797Z","contributors":[]},"2.1.0":{"name":"d3-flextree","version":"2.1.0","main":"build/d3-flextree.js","module":"index","jsnext:main":"index","author":{"name":"Chris Maloney","url":"http://chrismaloney.org"},"description":"Flexible tree layout algorithm that allows for variable node sizes.","keywords":["d3","d3-module","layout","tree","hierarchy","d3-hierarchy","plugin","d3-plugin","infovis","visualization","2d"],"homepage":"https://github.com/klortho/d3-flextree","license":"WTFPL","repository":{"type":"git","url":"git+https://github.com/klortho/d3-flextree.git"},"scripts":{"clean":"rm -rf build demo test","build:demo":"rollup -c --environment BUILD:demo","build:dev":"rollup -c --environment BUILD:dev","build:prod":"rollup -c --environment BUILD:prod","build:test":"rollup -c --environment BUILD:test","build":"rollup -c","lint":"eslint index.js src","test:main":"node test/bundle.js","test:browser":"node test/browser-tests.js","test":"npm-run-all test:*","prepare":"npm-run-all clean build lint test"},"dependencies":{"d3-hierarchy":"^1.1.5"},"devDependencies":{"babel-plugin-external-helpers":"^6.22.0","babel-preset-es2015-rollup":"^3.0.0","d3":"^4.13.0","d3-selection-multi":"^1.0.1","eslint":"^4.19.1","jsdom":"^11.6.2","npm-run-all":"^4.1.2","rollup":"^0.55.3","rollup-plugin-babel":"^2.7.1","rollup-plugin-commonjs":"^8.0.2","rollup-plugin-copy":"^0.2.3","rollup-plugin-json":"^2.3.0","rollup-plugin-node-resolve":"^3.0.2","rollup-plugin-uglify":"^3.0.0","uglify-es":"^3.3.9"},"gitHead":"3055b4a96fa0ad727dbf8df56afcb2f363219951","bugs":{"url":"https://github.com/klortho/d3-flextree/issues"},"_id":"d3-flextree@2.1.0","_npmVersion":"5.8.0","_nodeVersion":"8.11.1","_npmUser":{"name":"anonymous","email":"voldrani@gmail.com"},"dist":{"shasum":"ebbd5d57bc5de77a5877c58918b36d7bdc87e0cd","size":170645,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/d3-flextree/-/d3-flextree-2.1.0.tgz","integrity":"sha512-dDAXAHgN66dqQ1R7KV1HgnZh0RXTqWK2jG29zE2gqvret8vUiJZ2ilw95uxHBdE+D0Ui6++tkJKh/TSymKIiBA=="},"maintainers":[{"name":"anonymous","email":"voldrani@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d3-flextree_2.1.0_1523890947820_0.9747568627179073"},"_hasShrinkwrap":false,"publish_time":1523890948171,"_cnpm_publish_time":1523890948171,"_cnpmcore_publish_time":"2021-12-17T09:18:05.459Z","contributors":[]},"2.0.0":{"name":"d3-flextree","version":"2.0.0","main":"build/d3-flextree.js","module":"index","jsnext:main":"index","author":{"name":"Chris Maloney","url":"http://chrismaloney.org"},"description":"An tree layout plugin that allows for variable node sizes.","keywords":["d3","d3-module","layout","tree","hierarchy","d3-hierarchy","plugin","d3-plugin","infovis","visualization","2d"],"homepage":"https://github.com/klortho/d3-flextree","license":"WTFPL","repository":{"type":"git","url":"git+https://github.com/klortho/d3-flextree.git"},"scripts":{"clean":"rm -rf _package.js build demo test","build:package":"json2module package.json > _package.js","build:demo":"rollup -c --environment BUILD:demo","build:dev":"rollup -c --environment BUILD:dev","build:prod":"rollup -c --environment BUILD:prod","build:test":"rollup -c --environment BUILD:test","rollup":"rollup -c","build":"npm-run-all build:package rollup","lint":"eslint index.js src","test:main":"node test/bundle.js","test:browser":"node test/browser-tests.js","test":"npm-run-all test:*","prepare":"npm-run-all clean build lint test"},"dependencies":{"d3-hierarchy":"^1.1.5"},"devDependencies":{"babel-plugin-external-helpers":"^6.22.0","babel-preset-es2015-rollup":"^3.0.0","d3":"^4.13.0","d3-selection-multi":"^1.0.1","eslint":"^4.19.1","jsdom":"^11.6.2","json2module":"0.0.3","npm-run-all":"^4.1.2","package-preamble":"^0.1.0","rollup":"^0.55.3","rollup-plugin-babel":"^2.7.1","rollup-plugin-commonjs":"^8.0.2","rollup-plugin-copy":"^0.2.3","rollup-plugin-node-resolve":"^3.0.2","rollup-plugin-uglify":"^3.0.0","uglify-es":"^3.3.9"},"gitHead":"4eaf483a8ea7e4a70c4c2cb7254e87cd1fdd0173","bugs":{"url":"https://github.com/klortho/d3-flextree/issues"},"_id":"d3-flextree@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"anonymous","email":"voldrani@gmail.com"},"dist":{"shasum":"e4207f73517386a45f66e215a40a67bef21d611f","size":144664,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/d3-flextree/-/d3-flextree-2.0.0.tgz","integrity":"sha512-wijyNmU75LKAI95X7nCCV/e16FNhVE35zcTRJqpaBR6TvN0qycD72m/SU+58oiLMleadB0ohJ0Lh6+wE68VDCw=="},"maintainers":[{"name":"anonymous","email":"voldrani@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d3-flextree_2.0.0_1522916480786_0.08236428053394373"},"_hasShrinkwrap":false,"publish_time":1522916480966,"_cnpm_publish_time":1522916480966,"_cnpmcore_publish_time":"2021-12-17T09:18:06.378Z","contributors":[]},"1.4.0":{"name":"d3-flextree","version":"1.4.0","main":"dist/d3-flextree.js","author":{"name":"Chris Maloney"},"description":"An tree layout plugin that allows for variable node sizes.","license":"WTFPL","repository":{"type":"git","url":"git+https://github.com/klortho/d3-flextree.git"},"keywords":["visualization","2d","tree","d3","d3-module","d3-hierarchy","d3-plugin","plugin"],"homepage":"https://github.com/klortho/d3-flextree","scripts":{"clean":"rm -rf dist demo/bundle.*","build":"rollup -c","test":"ava","prepare":"npm-run-all --sequential clean build test"},"dependencies":{"d3-hierarchy":"^1.1.5"},"devDependencies":{"ava":"^0.25.0","babel-plugin-external-helpers":"^6.22.0","babel-preset-es2015-rollup":"^3.0.0","d3":"^4.13.0","d3-selection-multi":"^1.0.1","jsdom":"^11.6.2","npm-run-all":"^4.1.2","rollup":"^0.55.3","rollup-plugin-babel":"^2.7.1","rollup-plugin-commonjs":"^8.0.2","rollup-plugin-node-resolve":"^3.0.2","rollup-plugin-uglify":"^3.0.0"},"ava":{"files":["test/*-test.js"]},"gitHead":"ae6ce2bb0461b97b3326adf814a74caa57c18ef9","bugs":{"url":"https://github.com/klortho/d3-flextree/issues"},"_id":"d3-flextree@1.4.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"anonymous","email":"voldrani@gmail.com"},"dist":{"shasum":"2231356f424667bff02a47a3a1d11ef6f6f4e6bc","size":134744,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/d3-flextree/-/d3-flextree-1.4.0.tgz","integrity":"sha512-FQSrxFB/QN2ioq6ik3Vx1OmpkY+bxHD80k1Be7mRdbn2smgItZzE0pxB2/MXwC6X8Y7nJfBf/Wi85cu8dscCHQ=="},"maintainers":[{"name":"anonymous","email":"voldrani@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d3-flextree_1.4.0_1522172471879_0.41992483426159644"},"_hasShrinkwrap":false,"publish_time":1522172471981,"_cnpm_publish_time":1522172471981,"_cnpmcore_publish_time":"2021-12-17T09:18:06.992Z","contributors":[]},"1.0.3":{"name":"d3-flextree","version":"1.0.3","main":"dist/d3-flextree.js","author":{"name":"Chris Maloney","url":"http://chrismaloney.org"},"description":"An enhanced tree layout algorithm that allows variable node sizes.","license":"WTFPL","repository":{"type":"git","url":"git://github.com/klortho/d3-flextree.git"},"keywords":["visualization","2d","tree","d3","plugin"],"dependencies":{"d3":"^3.5.6"},"devDependencies":{"del":"^2.0.2","gulp":"^3.9.0","gulp-concat":"^2.6.0","gulp-exec":"^2.1.2","gulp-install":"^0.6.0","gulp-rename":"^1.2.2","gulp-run":"","gulp-uglify":"^1.2.0","lazy":"","mkdir-p":"0.0.7"},"gitHead":"3ad2a9d4e206d7cab0393aac207aecba568036cd","bugs":{"url":"https://github.com/klortho/d3-flextree/issues"},"homepage":"https://github.com/klortho/d3-flextree#readme","_id":"d3-flextree@1.0.3","scripts":{},"_shasum":"39c08c0a82ac1ed29c38e5933ec629871c788d83","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.0","_npmUser":{"name":"anonymous","email":"voldrani@gmail.com"},"dist":{"shasum":"39c08c0a82ac1ed29c38e5933ec629871c788d83","size":57984,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/d3-flextree/-/d3-flextree-1.0.3.tgz","integrity":"sha512-NTKh4rOn5hcPXyIc9ofPaZCOFFeVa3LMr+mta2hPRgy0zfE2pppXYCTnQ2UxpMNfu/9j2XopNEAjLDrXshmbew=="},"maintainers":[{"name":"anonymous","email":"voldrani@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/d3-flextree-1.0.3.tgz_1464681513717_0.5219076264183968"},"directories":{},"publish_time":1464681515834,"_hasShrinkwrap":false,"_cnpm_publish_time":1464681515834,"_cnpmcore_publish_time":"2021-12-17T09:18:07.326Z","contributors":[]}},"dist-tags":{"latest":"2.1.2"},"name":"d3-flextree","time":{"created":"2022-01-27T01:31:28.512Z","modified":"2022-01-27T01:31:28.512Z","2.1.2":"2021-11-08T22:54:06.510Z","2.1.1":"2018-04-16T17:21:28.963Z","2.1.0":"2018-04-16T15:02:28.171Z","2.0.0":"2018-04-05T08:21:20.966Z","1.4.0":"2018-03-27T17:41:11.981Z","1.0.3":"2016-05-31T07:58:35.834Z"},"readme":"# D3 flextree plugin\n\n[![](https://data.jsdelivr.com/v1/package/npm/d3-flextree/badge)](https://www.jsdelivr.com/package/npm/d3-flextree)\n\nThis plugin provides a more general version of the [D3 tree layout\nmodule](https://github.com/d3/d3-hierarchy#tree). Unlike `tree`, this plugin\nallows for nodes of variable sizes; like `tree`, the algorithm is fast, running\nin *O(n)* time.\n\n![](./sample-tree.svg)\n\nSee [the demo](https://klortho.github.io/d3-flextree/).\n\n`flextree()` is a factory function that returns a ***layout*** instance. A\n*layout* is a function that computes the positions of nodes in a\ntree diagram. Properties attached to the layout control various parameters\nof the algorithm.\n\n[Try d3-flextree in your browser](https://npm.runkit.com/d3-flextree).\n\n## Installing\n\nIf you use npm, `npm install d3-flextree`.\nOtherwise, download the [latest\nrelease](https://github.com/Klortho/d3-flextree/releases/latest).\nAMD, CommonJS, and browser environments are supported.\n\nAlternatively, you can use it straight from the jsdelivr CDN at\n[https://cdn.jsdelivr.net/npm/d3-flextree@2.0.0/build/d3-flextree.min.js](https://cdn.jsdelivr.net/npm/d3-flextree@2.0.0/build/d3-flextree.min.js). or [d3-flextree.js](https://cdn.jsdelivr.net/npm/d3-flextree@2.0.0/build/d3-flextree.js)\n\n## Overview\n\nComputing the layout of a tree data structure involves two steps: first,\ncreate a *hierarchy* from the data, and second, invoke the layout function.\n\nIn a Node environment:\n\n```javascript\nconst flextree = require('d3-flextree').flextree;\nconst layout = flextree();\nconst tree = layout.hierarchy({\n  size: [1, 1],\n  children: [\n    { size: [2, 4] },\n    { size: [3, 1],\n      children: [\n        { size: [4, 1] },\n      ],\n    },\n  ],\n});\nlayout(tree);\ntree.each(node => console.log(`(${node.x}, ${node.y})`));\n```\n\nIn a browser, `flextree` is attached to a `d3` global (which is created\nif necessary):\n\n```html\n<script src=\"d3-flextree.js\"></script>\n<script>\n  const flextree = d3.flextree;\n  ...\n</script>\n```\n\nWhen creating the hierarchy, the library uses the `children` accessor\nfunction to determine the children of a data node. When the layout is\ncomputed, two other accessor functions are used: `nodeSize` (to get the\nnode sizes) and `spacing` (to determine how far apart adjacent\nnodes in the diagram should be placed).\n\nThe example above uses the default accessors:\n\n```javascript\nchildren: data => data.children,\nnodeSize: node => node.data.size,\nspacing: 0,\n```\n\nIf the data is structured differently, the `children` and `nodeSize`\naccessors can be customized. For example, here is the same tree encoded in a\nnested array structure, along with the code to compute the layout using a\n`spacing` function that increases the gap between more distantly related\nnodes:\n\n```javascript\nconst data = [\n  1, 1,\n  [ 2, 4 ],\n  [ 3, 1,\n    [ 4, 1 ],\n  ],\n];\nconst layout = flextree({\n  children: data => {\n    const kd = data.slice(2);\n    return kd.length ? kd : null;\n  },\n  nodeSize: node => node.data.slice(0, 2),\n  spacing: (nodeA, nodeB) => nodeA.path(nodeB).length,\n});\nconst tree = layout.hierarchy(data);\nlayout(tree);\nconsole.log(layout.dump(tree));  //=> prints the results\n```\n\nThe accessors can also be set using D3-style chained methods:\n\n```javascript\nconst layout = flextree()\n  .children(data => {\n    const kd = d.slice(2);\n    return kd.length ? kd : null;\n  })\n  .nodeSize(node => node.data.slice(0, 2))\n  .spacing((nodeA, nodeB) => nodeA.path(nodeB).length);\n```\n\nOne thing to keep in mind is that the argument passed to the\n`children` accessor is a node in the *data* structure,\nwhereas the arguments to `nodeSize` and `spacing` are nodes of\nthe *hierarchy*.\n\nThe `layout.hierarchy` method is a convenience form\nof the [`d3.hierarchy`](https://github.com/d3/d3-hierarchy#hierarchy)\nfunction, and creates a set of objects that are instances of\na class that derives from `d3.hierarchy`. It's not required to\nuse the d3-flextree version. The following code is equivalent to\nthe example above, with three custom accessors. Note that the\n`children` accessor needs to be passed as the second argument\nto the `d3.hierarchy` function:\n\n```javascript\nconst layout = flextree({\n  nodeSize: node => node.data.slice(0, 2),\n  spacing: (nodeA, nodeB) => nodeA.path(nodeB).length,\n});\nconst tree = hierarchy(data, data => {\n  const kd = d.slice(2);\n  return kd.length ? kd : null;\n});\nlayout(tree);\n```\n\n## API Reference\n\n<a name=\"flextree\" href=\"#flextree\">#</a> <b>flextree</b>(<i>accessors</i>)\n\nCreates a new *layout* with the specified accessors. Any subset of\n`children`, `nodeSize`, and `spacing` can be specified in the\nargument object. If one is not specified, then the default is used:\n\n```javascript\nchildren: data => data.children,\nnodeSize: node => node.data.size,\nspacing: 0,\n```\n\nThe accessors can also be changed using chained methods, for example:\n\n```javascript\nconst layout = flextree()\n  .spacing((nodeA, nodeB) => nodeA.path(nodeB).length);\n```\n\n<a name=\"layout\" href=\"#layout\">#</a> <b>layout</b>.<b>hierarchy</b>(<i>data</i>)\n\nCreates a new *hierarchy* from the data, using the `children` accessors\nin effect when called. This is an enhanced version of the\n[`d3.hierarchy`](https://github.com/d3/d3-hierarchy#hierarchy)\nfunction, and produces a tree of instances of a class derived from\n`d3.hierarchy`.\n\nEach node of the hierarchy inherits all of the methods defined\nin [d3.hierarchy](https://github.com/d3/d3-hierarchy), including:\n\n* *node*.[ancestors](https://github.com/d3/d3-hierarchy#node_ancestors)()\n* *node*.[descendants](https://github.com/d3/d3-hierarchy#node_descendants)()\n* *node*.[leaves](https://github.com/d3/d3-hierarchy#node_leaves)()\n* *node*.[path](https://github.com/d3/d3-hierarchy#node_path)(*target*)\n* *node*.[links](https://github.com/d3/d3-hierarchy#node_links)()\n* *node*.[sum](https://github.com/d3/d3-hierarchy#node_sum)(*value*)\n* *node*.[count](https://github.com/d3/d3-hierarchy#node_count)()\n* *node*.[sort](https://github.com/d3/d3-hierarchy#node_sort)(*compare*)\n* *node*.[each](https://github.com/d3/d3-hierarchy#node_each)(*function*)\n* *node*.[eachAfter](https://github.com/d3/d3-hierarchy#node_eachAfter)(*function*)\n* *node*.[eachBefore](https://github.com/d3/d3-hierarchy#node_eachBefore)(*function*)\n* *node*.[copy](https://github.com/d3/d3-hierarchy#node_copy)() - this\n  method is re-implemented in flextree, such that it preserves the\n  class.\n\nIn addition, each of the objects in the returned hierarchy has\nseveral property getters. Many of these will be meaningless\nuntil `layout` is called on this tree. They include:\n\n* `x` - the computed *x*-coordinate of the node position.\n* `y` - the computed *y*-coordinate of the node position.\n* `data` - reference to the original data object\n* `nodes` - all of the nodes in this subtree (same as `descendants()`)\n* `parent` - the parent node, or `null` for the root.\n* `children` - the array of child nodes, or `null` for leaf nodes.\n* `numChildren`\n* `hasChildren`\n* `noChildren`\n* `depth` - the depth of the node, starting at 0 for the root.\n* `height` - the distance from this node to its deepest descendent,\n  or 0 for leaf nodes.\n* `length` - number of nodes in this subtree\n* `size` - size of this node (the values fetched by the `nodeSize` accessor)\n  as a two-element array.\n* `xSize`\n* `ySize`\n* `top`\n* `bottom`\n* `left`\n* `right`\n* `extents` - the minimum `top` and `left`, and the maximum `bottom` and\n  `right` values for all of the nodes in this subtree\n\n<a name=\"layout\" href=\"#layout\">#</a> <b>layout</b>(<i>tree</i>)\n\nComputes the layout of a *hierarchy*. `x` and `y` properties are\nset on each node, and many other properties useful in rendering\nare available -- see the list above.\n\nAlthough the layout is defined in terms of *x* and *y*, these represent an\narbitrary coordinate system. For example, you can treat *x* as a radius\nand *y* as an angle to produce a radial rather than Cartesian layout.\n\n<a name=\"children\" href=\"#children\">#</a> layout.<b>children</b>([<i>children</i>])\n\nIf *children* is specified, sets the specified children accessor function.\nIf *children* is not specified, returns the current children accessor\nfunction, which by default assumes that the input data is an object with\na children property, whose value is either an array or `null` if there\nare no children:\n\n```javascript\ndata => data.children\n```\n\nNote that unlike the other accessors, this takes a *data* node\nas an argument. This is used only in the creation of a hierarchy,\nprior to computing the layout, by the `layout.hierarchy` method.\n\n<a name=\"nodeSize\" href=\"#nodeSize\">#</a> layout.<b>nodeSize</b>([<i>nodeSize</i>])\n\nIf *nodeSize* is specified as a two-element array `[xSize, ySize]`, then\nthis sets that as the fixed size for every node in the tree. If *nodeSize*\nis a function, then that function is passed the hierarchy node as an argument,\nand should return a two-element array. If *nodeSize* is not specified, this\nreturns the current setting.\n\nThe default `nodeSize` assumes that a node's size is available as a\nproperty on the data item:\n\n```javascript\nnode => node.data.size\n```\n\n<a name=\"spacing\" href=\"#spacing\">#</a> layout.<b>spacing</b>([<i>spacing</i>])\n\nIf a *spacing* argument is given as a constant number, then the layout\nwill insert the given fixed spacing between every adjacent node.\nIf it is given as a function, then that function will be passed two\nnodes, and should return the minimum allowable spacing between those\nnodes. If *spacing* is not specified,\nthis returns the current spacing, which defaults to `0`.\n\nTo increase the spacing for nodes as the distance of their relationship\nincreases, you could use, for example:\n\n```javascript\nlayout.spacing((nodeA, nodeB) => nodeA.path(nodeB).length);\n```\n\n<a name=\"algorithm\"></a>\n## The Algorithm\n\nThe existing D3 tree layout is based on an algorithm developed originally\nby Reingold and Tilford in their paper from 1981, [Tidier Drawings of\nTrees][1]. The algorithm was improved over time by others, including Walker,\nin a paper in 1989, [A Node-Positioning Algorithm for General Trees][2], and\nthe latest improvement by Bucheim, Junger, and Leipert in 2002, described in their\npaper, [Improving Walker's Algorithm to Run in Linear Time][2].\n\nA limitation of that algorithm is that it applies to trees in which all of\nthe nodes are the same size. This is adequate for many applications, but\na more general solution, allowing variable node sizes, is often\npreferable.\n\nIn a paper from 2013, A.J. van der Ploeg enhanced the algorithm to allow\nfor variable-sized nodes, while keeping its linear runtime nature. He\ndescribed the algorithm in his paper, [Drawing Non-layered Tidy Trees in\nLinear Time][3]. The author also provided a working Java application\non GitHub at\n[cwi-swat/non-layered-tidy-trees](https://github.com/cwi-swat/non-layered-tidy-trees).\n\nThis module is a port from that Java code into JavaScript.\n\n[1]: http://emr.cs.iit.edu/~reingold/tidier-drawings.pdf\n[2]: http://www.cs.unc.edu/techreports/89-034.pdf\n[2]: http://dirk.jivas.de/papers/buchheim02improving.pdf\n[3]: http://oai.cwi.nl/oai/asset/21856/21856B.pdf","users":{}}