Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Use unique heatmap name, and other feature updates #696

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ycl6
Copy link

@ycl6 ycl6 commented Sep 18, 2023

This PR (1) resolve the issue with duplicated Heatmap object name when joining 2 or more Heatmap objects created by the netVisual_heatmap function, by create a unique ht.name name and assed to the Heatmap function.

When creating a heatmap list in the later version of ComplexHeatmap, each Heatmap object should have a unique name, if not, a warning message such as Heatmap/annotation names are duplicated is produced (as noted in #170). When used in Jupyter Notebook, this issue resulted in an error message provided below.

This PR (2) adds the ability for users to assign legend title to each heatmap using legend.title. This is useful when creating plots showing heatmap side-by-side to compare number/strength of interactions from multiple datasets, with legend named specifically for each dataset.

This PR (3) re-introduce the paramater for users to change the width and height of the heatmap body.

Minor changes are to standardise the font size of the legend title and label from fontsize = 8 to use font.size which default to 8.

ERROR while rich displaying an object: Error in grid.Call.graphics(C_downvppath, name$path, name$name, strict): Viewport 'Relative values_heatmap_body_1_1' was not found

Traceback:
1. tryCatch(withCallingHandlers({
 .     if (!mime %in% names(repr::mime2repr)) 
 .         stop("No repr_* for mimetype ", mime, " in repr::mime2repr")
 .     rpr <- repr::mime2repr[[mime]](obj)
 .     if (is.null(rpr)) 
 .         return(NULL)
 .     prepare_content(is.raw(rpr), rpr)
 . }, error = error_handler), error = outer_handler)
2. tryCatchList(expr, classes, parentenv, handlers)
3. tryCatchOne(expr, names, parentenv, handlers[[1L]])
4. doTryCatch(return(expr), name, parentenv, handler)
5. withCallingHandlers({
 .     if (!mime %in% names(repr::mime2repr)) 
 .         stop("No repr_* for mimetype ", mime, " in repr::mime2repr")
 .     rpr <- repr::mime2repr[[mime]](obj)
 .     if (is.null(rpr)) 
 .         return(NULL)
 .     prepare_content(is.raw(rpr), rpr)
 . }, error = error_handler)
6. repr::mime2repr[[mime]](obj)
7. repr_text.default(obj)
8. paste(capture.output(print(obj)), collapse = "\n")
9. capture.output(print(obj))
10. withVisible(...elt(i))
# --- below omitted ---

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant