hmColors: Set d3heatmap color options

View source: R/hmColors.R

hmColorsR Documentation

Set d3heatmap color options

Description

Set and adjust the colors and color options for the d3heatmap

Usage

hmColors(
  d3heatmap,
  theme = c("", "dark"),
  colors,
  range,
  color.bins,
  symmetrical,
  na.color
)

Arguments

d3heatmap

Required A valid d3heatmap object

theme

A custom CSS theme to use. Currently the only valid values are "" and "dark". "dark" is primarily intended for standalone visualizations, not R Markdown or Shiny.

colors

Either a colorbrewer2.org palette name (e.g. "YlOrRd" or "Blues"), or a vector of colors to interpolate in hexadecimal "#RRGGBB" format, or a color interpolation function like colorRamp.

range

A vector of two numbers, namely the minimum and maximum value to use when determining the mapping from values to colors. This is useful when the range of values changes between heatmaps, but colors should be the same (optional, defaults to the minimum and maximum of x).

color.bins

numeric The number of colors to generate from the palette, or the breakpoints between the bins

symmetrical

logical Arrange color bins symmetrically around zero?

na.color

Color of NA values in heatmap. Defaults to neutral gray.

Value

Modified d3heatmap object

Source

The interface was inspired by dygraphs

See Also

heatmap, heatmap.2

Examples

## Not run: 

d3heatmap(mtcars, dendrogram = 'none', scale = 'column', xaxis_angle = 30) %>% 
  hmColors(colors = 'RdYlGn', color.bins = 12, symmetrical = TRUE)


## End(Not run)
  

rstudio/d3heatmap documentation built on Nov. 18, 2024, 9:20 a.m.