Created
July 3, 2017 05:19
-
-
Save tomlagier/d535ee4cd792b351cf14eb35ca8a8bbf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateLayout(children: Node[], width: number) { | |
const root = new Module.Hierarchy({ | |
size: [width, width], | |
padding: 1.5 | |
}, { value: 0, children}); | |
return root.pack().leaves(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment