lazappi / clustree

Visualise Clusterings at Different Resolutions
https://lazappi.github.io/clustree/
GNU General Public License v3.0
215 stars 15 forks source link

Is there a way to label edges? #92

Open plijnzaad opened 1 year ago

plijnzaad commented 1 year ago

Hi Luke and/or others,

is there an easy way to label the edges, specifically with the numbers or percentages distributing over the finer-clustered nodes under it? If not, I'd like to request that as a feature :-)

lazappi commented 1 year ago

At the moment there is no option in {clustree} to label edges (I vaguely remember seeing that in a publication so there might be code out there somewhere). I don't really have the capacity to add features to {clustree} at the moment but if you are happy to work on this a PR would be very welcome.

I'm not sure this will work but you may be able to do it but adding things to the returned ggplot object using {ggraph}. Something like:

graph <- clustree(data, ...)
graph + ggraph::geom_edge_text(...)