SDK Reference
Row

Row

The Row class in Vizzly is designed for structuring and organizing content in a row-wise manner within a dashboard. It serves as a container for Cell instances, allowing for a flexible and ordered layout of dashboard elements.

Initialization

A Row can be initialized with an optional array of Cell instances and an optional height. The Cell instances define the content and layout within the row, while the height parameter allows for customizing the vertical size of the row.

Basic Example

To create a new Row instance in Vizzly, you can use the following TypeScript code:

import { Vizzly } from "@vizzly/services;
 
new Vizzly.Row();

API

/**
* Creates a new instance of a Row.
* @param components An optional array of Cell instances to initialize the row.
* @param height An optional height for the row, defaults to 350.
*/
constructor(components?: Cell[], height?: number)
 
/**
* Adds a cell to the row at a specified position or appends it at the end if
  no position is specified.
*
* @param component The Cell instance to be added to the row.
* @param position (Optional) The zero-based index at which to add the cell.
*                 If omitted, the cell is added at the end of the row.
*/
addCell(component: Cell, position?: number)
 
/**
* Sets the height of the row.
* @param height The height to set for the row.
*/
setHeight(height: number)
 
/**
* Sets the cells and optionally the height of the row.
* @param components An array of Cell instances.
*/
setRow(components: Cell[])
 
/**
* Sets the cells and optionally the height of the row.
* @param components An array of Cell instances.
* @param height An optional height to set for the row.
*/
set(components: Cell[], height?: number)