MD-Anderson-Bioinformatics / NGCHM-R

An R library for creating Next-Generation Clustered Heat Maps (NG-CHM)
http://bioinformatics.mdanderson.org/main/NG-CHM-V2:Overview
7 stars 3 forks source link

Using standard color names for cuts_color results in broken map #35

Open marohrdanz opened 1 year ago

marohrdanz commented 1 year ago

When using the cuts_color option to chmNewDataLayer(), if a standard color name is used, as in:

dataLayer <- chmNewDataLayer("mydatalyaer", data_matrix, colorMap, cuts_color = "grey")

Then the resulting map will not open correctly in the viewer, with console errors "Uncaught TypeError: contColorMap.getColor(...) is null" from SummaryHeatMapDisplay.js and DetailHeatMapDisplay.js

However using the hexidecimal code works fine:

dataLayer <- chmNewDataLayer("mydatalyaer", data_matrix, colorMap, cuts_color = "#a6a6a6")

Since standard color names work fine for chmNewColorMap(), users might reasonably expect them to work for cuts_color. So this seems like a bug. At the very least we should give the user an error so they can use the hexadecimal code.

I'm not sure if this issue is caused by the viewer project's javascript code, java code, or somewhere in the R package.