Open tcardlab opened 9 months ago
Thank you for the validation!
This diagram represents my comprehension of your concept. Are there any discrepancies?
That seems correct. However, I would like to note that this is just a simple 1 pass solution that guarantees things won't collide. It will work well for balanced/uniform graphs, but as they get larger the graph may skew and become harder to read.
Additionally, you may wish to calculate vertical alignment to distribute nodes vertically in a more aesthetic way:
Here are some examples of using this tallest layer method:
The nature of organizing this uniformly is ultimately a 2-pass problem. So, if you want a more robust solution that maintains hierarchical alignment in non-uniform graphs with non-uniform node sizes, consider the following:
As you can see, the parent height depends on the children and the child alignment depends on the parent height & position.
This cyclic dependency points to the fact that two passes are needed to resolve this.
Organizing non-uniform trees is an opinionated task, which means someone is bound to be disappointed. The question now becomes, "what the least bad option?". I'll leave this for you to determine for your use-case.
Wow bro, sorry for the late reply, I'm being forced to learn rust language by my boss😂
You're really doing a lot of thinking ! Surely, the generation of nodes have different solution because we should consider many scenarios.
Tree structure and 2-Passes in the last example is a good choice, they will be released in the next version!
Really convenient and would love to use it more extensively, but the fact that collision detection is limited to immediate children is kind of limiting.
I'm not terribly familiar with Obsidians API, but here's my uneducated thoughts: