Class pv.Layout.grid
A grid layout with regularly-sized rows and columns. The number of rows and columns are determined from the array, which should be in row-major order. For example, the 2×3 array:
1 2 3 4 5 6should be represented as:
[[1, 2, 3], [4, 5, 6]]If your data is in column-major order, you can use pv.transpose to transpose it.
This layout defines left, top, width, height and data properties. The data property will be the associated element in the array. For example, if the array is a two-dimensional array of values in the range [0,1], a simple heatmap can be generated as:
.add(pv.Bar) .extend(pv.Layout.grid(array)) .fillStyle(pv.ramp("white", "black"))By default, the grid fills the full width and height of the parent panel.
Defined in: Grid.js.
Constructor Attributes | Constructor Name and Description |
---|---|
pv.Layout.grid(arrays)
Returns a new grid layout.
|
Class Detail
pv.Layout.grid(arrays)
Returns a new grid layout.
- Parameters:
- {array[]} arrays
- an array of arrays.
- Returns:
- {pv.Layout.grid} a grid layout.