I’m working on an app in Android that displays “cards” of persons and connects these cards via lines. The lines will be used to show the relationship between the different persons, something akin to a family tree. Every card has 4 anchor points for a line (top, bottom, left, right).
Example:
My question is, does anyone know of a suited algorithm for this task? How can I calculate the position of the cards so that the lines which connect them are all clear? Especially if there are many lines to be calculated? My previous attempts all led to the lines crossing each other, or even the cards themselves would overlap each other occasionally.
I would greatly appreciate some help or tips how I should handle this.