{"id":17236286,"url":"https://github.com/leungwensen/mindmap-layouts","last_synced_at":"2025-04-13T06:42:41.102Z","repository":{"id":52077638,"uuid":"82029291","full_name":"leungwensen/mindmap-layouts","owner":"leungwensen","description":"automatic layout algorithms for mindmaps","archived":false,"fork":false,"pushed_at":"2017-03-01T10:05:57.000Z","size":502,"stargazers_count":194,"open_issues_count":3,"forks_count":36,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-24T11:42:57.945Z","etag":null,"topics":["layout-algorithm","mind-mapping","mindmap","tree-structure"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leungwensen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-15T06:48:26.000Z","updated_at":"2025-03-24T11:02:07.000Z","dependencies_parsed_at":"2022-09-04T19:10:29.697Z","dependency_job_id":null,"html_url":"https://github.com/leungwensen/mindmap-layouts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leungwensen%2Fmindmap-layouts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leungwensen%2Fmindmap-layouts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leungwensen%2Fmindmap-layouts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leungwensen%2Fmindmap-layouts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leungwensen","download_url":"https://codeload.github.com/leungwensen/mindmap-layouts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248675441,"owners_count":21143763,"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":["layout-algorithm","mind-mapping","mindmap","tree-structure"],"created_at":"2024-10-15T05:35:50.293Z","updated_at":"2025-04-13T06:42:41.082Z","avatar_url":"https://github.com/leungwensen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"mindmap-layouts\n===============\n\nautomatic layout algorithms for mindmaps\n\n## input\n\n```json\n{\n    \"root\": {\n        \"name\": \"root\",\n        \"children\": [\n            {\n                \"name\": \"child-1\",\n                \"children\": [\n                    {\n                        \"name\": \"child-1-1\"\n                    },\n                    {\n                        \"name\": \"child-1-2\",\n                        \"children\": [\n                            {\n                                \"name\": \"child-1-2-1\"\n                            }\n                        ]\n                    }\n                ]\n            },\n            {\n                \"name\": \"child-2\"\n            },\n            {\n                \"name\": \"child-3\"\n            },\n            {\n                \"name\": \"child-4\",\n                \"children\": [\n                    {\n                        \"name\": \"child-4-1\"\n                    },\n                    {\n                        \"name\": \"child-4-2\"\n                    }\n                ]\n            }\n        ]\n    },\n    \"links\": [\n        {\n            \"source\": \"child-1-1\",\n            \"name\": \"special link\",\n            \"target\": \"child-2\"\n        }\n    ]\n}\n```\n\n\u003e Root and each of its descendants are nodes in a mindmap, like Topic in XMind.\n\n\u003e Links are extra edges that connects two nodes in a mindmap, like Relationship in XMind.\n\nCheckout more about .xmind file: [xmind-sdk-javascript](https://github.com/leungwensen/xmind-sdk-javascript)\n\n## Install\n\n```shell\n$ npm install mindmap-layouts --save\n```\n\n## API\n\n```javascript\nconst MindmapLayouts = require('mindmap-layouts')\nconst layout = new MindmapLayouts.Standard(root, options) // root is tree node like above\nconst rootNode = layout.doLayout() // you have x, y, centX, centY, actualHeight, actualWidth, etc.\n```\n\ncheckout [here](https://github.com/leungwensen/mindmap-layouts/tree/master/demo/src) for a real world demo\n\n## [demo](http://leungwensen.github.io/mindmap-layouts/demo/)\n\n## layouts\n\n### standard\n\n![standard](./assets/standard.png)\n\n### right logical\n\n![right-logical](./assets/right-logical.png)\n\n### left logical\n\n![left-logical](./assets/left-logical.png)\n\n### downward organizational\n\n![downward-organizational](./assets/downward-organizational.png)\n\n### upward organizational\n\n![upward-organizational](./assets/upward-organizational.png)\n\n### [TODO] right fishbone\n\n### [TODO] left fishbone\n\n### [TODO] indented\n\n### [TODO] arc tree\n\n### [TODO] elbow tree\n\n### [TODO] horizontal Timeline\n\n### [TODO] vertical Timeline\n\n## links\n\n- [思维导图自动布局算法](http://leungwensen.github.io/blog/2017/mindmap-drawing-algorithms.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleungwensen%2Fmindmap-layouts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleungwensen%2Fmindmap-layouts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleungwensen%2Fmindmap-layouts/lists"}