hmAxis: Modify axis options

View source: R/hmAxis.R

hmAxisR Documentation

Modify axis options

Description

Provides options for modifying the x and y axes of a D3 Heatmap widget

Usage

hmAxis(
  d3heatmap,
  axis = c("x", "y", "row", "column"),
  size,
  labels,
  font.size,
  angle,
  location,
  title,
  title.font.size
)

Arguments

d3heatmap

a d3heatmap object created from the d3heatmap()

axis

Name of the axis to modify; either "x", "y", "row", or "column"

size

Size of axes, in pixels.

labels

character vectors with axis labels to use (top to bottom for y axis, left to right for x); default to rownames(x) or colnames(x).

font.size

integer Font size of axis labels, in pixels (i.e., will be translated to a character string with 'px' appended)

angle

Angle of x axis labels (x axis only). Defaults to 60. Maximum of 90 (vertical), minimum of 25.

location

Location of the axis, either "bottom" or "top" for the x axis, and either "right" or "left" for the y axis. Defaults to "bottom" and "right".

title

Title text

title.font.size

Font size of axis title in pixels. Defaults to 14.

Value

Modified d3heatmap object

Source

The interface was inspired by dygraphs

See Also

heatmap, heatmap.2

Examples

## Not run: 
 
d3heatmap(mtcars, scale = "column", col = "Blues") %>%
  hmAxis("x", angle = 30, title = "test", location = 'top', font.size = '24px') %>% 
  hmAxis("y", title = "test", location = 'right')


## End(Not run)


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