
Replace heatmaply's combined annotation legend with one split by variable
Source:R/heatmap.R
splitAnnotationLegend.RdBy default heatmaply shows a single generically-titled legend/colorbar
covering every value of every col_side_colors variable pooled
together. This hides that combined colorbar and adds one invisible,
legend-only trace per value of each annotation variable instead, grouped
and titled by variable name, using the same colors as the annotation bars.
Arguments
- p
A plotly htmlwidget as produced by
heatmaply::heatmaply()withcol_side_colorssupplied- col_side_colors
A data frame with sample metadata, as passed to
heatmaply::heatmaply()- palette
A named vector of colors as produced by
combinedAnnotationColors- ncol_heatmap
Number of columns in the main heatmap data, used to identify the annotation strip trace(s) among the plot's other traces