touretzkyds / KnowledgeGraphDemo

Visualization tools for KnowledgeGraphDemo
Apache License 2.0
0 stars 2 forks source link

smarter taxon image positioning #42

Open touretzkyds opened 2 years ago

touretzkyds commented 2 years ago

In some cases the taxon image box is too close to the blue taxon node, and may even partly cover it. This depends on the shape of the box and its position relative to the taxon node. We need to make the positioning algorithm a little smarter, i.e., make the taxonImage arrow longer when necessary in order to keep the image box from overlapping other nodes.

deyaliao commented 2 years ago

I've fixed this and pushed to the Devel branch, in the file demo2d.html. The vast majority of arrows that point to the taxon image box don't cover any other nodes (some images are just ridiculously big, and I didn't want to make all of the arrows extraordinarily long, unless you think that's a good idea).

Screen Shot 2022-06-26 at 12 09 54 AM
touretzkyds commented 2 years ago

The image you posted looks good. But we still have some image placement problems. See below.

bad-placement

deyaliao commented 2 years ago

I made the arrows even longer, but this seems like an issue with calculating the angles of where taxonImage should reside. I could look into that.

touretzkyds commented 2 years ago

Yes, just making the arrow longer is not a good solution. We need to consider the placements of the other nodes and then calculate the correct image arrow length to ensure that the image box does not overlap any of the other nodes. I'd like you to do this, but it's a lower priority item right now.