HeatmapData

data class HeatmapData(val columns: ImmutableList<String>, val rows: ImmutableList<String>, val values: ImmutableList<ImmutableList<Double?>>)(source)

A matrix of values on two category axes, such as activity per weekday and hour.

values holds one list per row label, in rows order, and each list holds one value per column label, in columns order: values[row][column]. A null value is a missing cell. It draws empty, cannot be selected, and is never treated as zero.

Constructors

Link copied to clipboard
constructor(columns: ImmutableList<String>, rows: ImmutableList<String>, values: ImmutableList<ImmutableList<Double?>>)
constructor(columns: List<String>, rows: List<String>, values: List<List<Double?>>)

Copies the supplied labels and values into immutable lists.

Properties

Link copied to clipboard
val columns: ImmutableList<String>

Column labels, shown along the X axis from left to right.

Link copied to clipboard
val rows: ImmutableList<String>

Row labels, shown along the Y axis from top to bottom.

Link copied to clipboard
val values: ImmutableList<ImmutableList<Double?>>

Row-major cell values; null marks a missing cell.

Functions

Link copied to clipboard
fun cellIndex(row: Int, column: Int): Int

Returns the selection index of the cell at row and column: row * columns.size + column. Pass it to a ChartSelection to select that cell.