plots: Show percentiles on hover in rankings

This commit is contained in:
Elias Projahn 2022-01-13 11:39:33 +01:00
parent fa49a5a887
commit 0087f83247

View file

@ -123,8 +123,15 @@ plot_rankings <- function(rankings, gene_sets) {
data = gene_set_data[gene %chin% gene_set], data = gene_set_data[gene %chin% gene_set],
x = ranking_name, x = ranking_name,
y = ~score, y = ~score,
text = ~name,
color = gene_set_name, color = gene_set_name,
text = ~name,
customdata = ~percentile,
hovertemplate = paste0(
"<b>%{text}</b><br>",
"Score: %{y:.3}<br>",
"Percentile: %{customdata:.2%}",
"<extra></extra>"
),
showlegend = is_first, showlegend = is_first,
marker = list(size = 20, opacity = 0.66) marker = list(size = 20, opacity = 0.66)
) )