emmanuelparadis / pegas

Population and Evolutionary Genetics Analysis System
GNU General Public License v2.0
27 stars 10 forks source link

Haplotype mutation ticks in center of links #43

Closed mhoban closed 3 years ago

mhoban commented 5 years ago

Hi,

This may be a bit of a niche request, but it's a problem I've encountered somewhat frequently. The current haplotype network plot function places the mutation ticks at the center of the link, as determined by the centers of the circles between which it's drawn. This results in ticks either being hidden under large haplotypes or extra long links (which makes little visual sense when there is only one or two mutations). Is there any way the plot function can place the ticks between the centers of the two circle radii (edges)? Does this make sense?

In the current behavior, you often end up with something like this in order for the ticks to be visible:

(small haplotype)---------------||---( large haplotype )

Whereas is would be very nice to have it look like this:

(small haplotype)--||--( large haplotype )

emmanuelparadis commented 5 years ago

Hi, I'm aware that these plots do not behave always very well when the circles do not have the standard sizes. This can even become messy if you call replot(). It's been some time that this issue on the TODO list. I'll post here when I make progress on it. Emmanuel

mhoban commented 4 years ago

Hi Emmanuel-

I forked the repo and fixed this issue. It's currently only fixed for show.mutation=1, but I'll change it for 2 and 3 as well eventually. Just wanted to let you know.

cheers,

mh

emmanuelparadis commented 4 years ago

Hi,

Cool. I'll have a look at it. Emmanuel

emmanuelparadis commented 3 years ago

This is now fixed for all cases. The code has been heavily modified with many new features and improvements. Check it out! (mjn works pretty well and has its own plot method now).

Cheers,

Emmanuel