I'm trying to create a mind map.
I'm thinking of placing it according to the following rules.
·Each element is rectangular
·One root element
·The child elements immediately below are arranged in a row horizontally so that they hang under the parent element
·Parent elements are placed in the center of the child elements directly below the row
How can I place it as compactly as possible while satisfying these conditions?
Are there any good algorithms?
I've looked for it myself before, and I've referenced a JavaScript library called d3-hierarchy.
README has several references.
The algorithmic documentation for deployment is
For information on algorithms for linear time placement, see
It says that you refer to .You can also see the actual implementation in the GitHub repository, so it may be helpful for basic algorithms.
© 2024 OneMinuteCode. All rights reserved.