{"id":20047798,"url":"https://github.com/interactivethings/d3-indent","last_synced_at":"2025-05-05T10:31:24.756Z","repository":{"id":8250266,"uuid":"9697006","full_name":"interactivethings/d3-indent","owner":"interactivethings","description":"D3 indented tree layout.","archived":false,"fork":false,"pushed_at":"2014-05-27T17:29:08.000Z","size":169,"stargazers_count":27,"open_issues_count":0,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-18T06:42:51.671Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/interactivethings.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-26T14:22:40.000Z","updated_at":"2022-01-07T02:54:03.000Z","dependencies_parsed_at":"2022-08-02T15:00:29.802Z","dependency_job_id":null,"html_url":"https://github.com/interactivethings/d3-indent","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactivethings%2Fd3-indent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactivethings%2Fd3-indent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactivethings%2Fd3-indent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactivethings%2Fd3-indent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interactivethings","download_url":"https://codeload.github.com/interactivethings/d3-indent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252480458,"owners_count":21754776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T11:38:27.442Z","updated_at":"2025-05-05T10:31:24.476Z","avatar_url":"https://github.com/interactivethings.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# d3.layout.indent\n\nAn indented tree layout for [D3](http://d3js.org), commonly used for hierarchical lists, e.g. file directories.\n\n## Usage\n\nOn top of D3's usual hierarchical layout methods `sort()`, `children()`, and `value()` (see [D3 API documentation](https://github.com/mbostock/d3/wiki/Hierarchy-Layout)), d3.layout.indent implements `nodeSize()` and `separation()` to specify the x and y increment between nodes.\n\nPer default, both x and y increment by 1:\n\n```javascript\nvar indent = d3.layout.indent();\nvar tree = {id: \"root\", children: [{id: \"child1\"}, {id: \"child2\"}]};\nvar nodes = indent.nodes(tree); // -\u003e [{id:\"root\", x: 0, y: 0}, {id: \"child1\", x: 1, y: 1}, {id: \"child2\", x: 1, y: 2}]\n```\n\nWith `.nodeSize()` the x and y increment can be defined. `.separation()` additionally defines by how much the x increment will be multiplied between the current and the previous node:\n\n```javascript\nvar indent = d3.layout.indent()\n  .nodeSize([10, 10])\n  .separation(function(a, b) { return a.children ? 2 : 1; });\nvar tree = {id: \"root\", children: [{id: \"child1\"}, {id: \"child2\", children: [{id: \"child21\"}]}]};\nvar nodes = indent.nodes(tree); // -\u003e [{id:\"root\", x: 0, y: 0}, {id: \"child1\", x: 10, y: 10}, {id: \"child2\", x: 10, y: 30}, {id: \"child21\", x: 20, y: 40}]\n```\n\n## Examples\n\n* Demo: http://bl.ocks.org/herrstucki/5467720\n* [Social Progress Index](http://www.socialprogressimperative.org/data/spi#performance/regions/spi/dim1,dim2,dim3)\n\n## Author\n\nJeremy Stucki, [Interactive Things](http://interactivethings.com)\n\n## License\n\nBSD, see LICENSE.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finteractivethings%2Fd3-indent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finteractivethings%2Fd3-indent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finteractivethings%2Fd3-indent/lists"}