Skip to contents

The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.

Usage

setup_HeatmapConfig(
  row_names = NULL,
  col_names = NULL,
  triangle = NULL,
  cluster_rows = FALSE,
  cluster_cols = FALSE,
  dist_method = "euclidean",
  hclust_method = "complete",
  square_cells = NULL,
  show_row_dendro = TRUE,
  show_col_dendro = TRUE,
  dendro_row_width = 60,
  dendro_col_height = 60,
  dendro_color = NULL,
  dendro_uniform = FALSE,
  dendro_row_side = "right",
  dendro_col_side = "top",
  colormap = NULL,
  zlim = NULL,
  show_notes = FALSE,
  row_cut = NULL,
  col_cut = NULL,
  show_values = FALSE,
  value_digits = 2L,
  show_colorbar = TRUE,
  colorbar_orient = "vertical",
  title = NULL,
  margin_top = NULL,
  margin_right = NULL,
  margin_bottom = NULL,
  margin_left = NULL,
  dat_path = NULL,
  origin = NULL,
  writer = NULL,
  legend_position = if (colorbar_orient == "horizontal") "bottom" else "right",
  legend_placement = "outside"
)

Arguments

row_names, col_names

Optional Character: Labels overriding the matrix dimnames.

triangle

Optional Character {"lower", "upper"}: Show only one triangle, for a symmetric matrix.

cluster_rows, cluster_cols

Logical: Reorder by hierarchical clustering.

dist_method

Character: Distance measure for clustering.

hclust_method

Character: Linkage method for clustering.

square_cells

Optional Logical: Force square cells, sizing the container to match.

show_row_dendro, show_col_dendro

Logical: Draw each dendrogram.

dendro_row_width, dendro_col_height

Numeric [0, Inf): Dendrogram panel size in pixels.

dendro_color

Optional Character: Dendrogram line color.

dendro_uniform

Logical: Draw dendrograms with uniform branch heights.

dendro_row_side

Character {"left", "right"}: Row dendrogram side.

dendro_col_side

Character {"top", "bottom"}: Column dendrogram side.

colormap

Optional Character: Colors defining the continuous scale. NULL derives a theme-aware diverging or sequential scale.

zlim

Optional Numeric: Color-scale limits, length 2.

show_notes

Logical: Print supplied cell notes instead of numeric values.

row_cut, col_cut

Optional Integer: Number of clusters for branch coloring, requiring a computed or supplied tree.

show_values

Logical: Print each cell's value.

value_digits

Integer [0, Inf): Digits for printed values.

show_colorbar

Logical: Draw the color bar.

colorbar_orient

Character {"vertical", "horizontal"}: Color bar orientation.

title

Optional Character: Chart title. Declared here because it is the one property every chart type has; palette is not (four take a colormap instead), and axis labels and margins are cartesian-only.

margin_top, margin_right, margin_bottom, margin_left

Optional Integer [0, Inf): Override the auto-computed margins, per side.

dat_path

Optional Character: Path to the data, read at draw time. The serializable alternative to passing data to draw().

origin

Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance.

writer

Optional Named character: Which interface wrote the config.

legend_position

Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row.

legend_placement

Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend.

Value

HeatmapConfig object.

Author

EDG

Examples

draw(setup_HeatmapConfig(), data = matrix(1:20, nrow = 4))