R-graph-gallery icon indicating copy to clipboard operation
R-graph-gallery copied to clipboard

update angles and hjust of vertices in Circular Dendrogram

Open PaulApivat opened this issue 3 years ago • 2 comments

What?

Update angles and hjust calculation for 339-circular-dendrogram-with-ggraph.Rmd

Why?

In the original version, the geom_node_text is hidden behind the node and not readable.

How?

I update the calculation for vertices$angle and vertices$hjust and added coord_flip() method to the graph.

Testing?

There are no unit tests. However, after I made the changes, I re-knitted the Rmarkdown document and the circular dendrogram now displays as intended.

Screenshot

Original circular dendrogram

old

New circular dendrogram

new

PaulApivat avatar Mar 02 '21 06:03 PaulApivat

Hi @PaulApivat, I've knitted my rmd and it works fine for me, so it's weird it does not for you. I've added a session.info() at the end of the document. Could you please have a look and tell me what's different for you?

holtzy avatar Jun 16 '21 17:06 holtzy

Hi @holtzy , I get the same problem as @PaulApivat as well, except that his pull request also did not solve the problem. The problem arises because of the location of the starting point of the dendrogram i.e. the location of subgroup 1. Your angle calculation assumes that the location is at the top. For some reason, I get it at 90 degrees. The entire circle is rotated and hence the angle of the label text gets screwed up.

88vikram avatar Jan 07 '23 21:01 88vikram