Library

Library

The Library class in Vizzly is designed to manage and organize a collection of components that can be utilized across various parts of a dashboard. It acts as a repository for storing and retrieving reusable components.

Initialization

The Library can be initialized with an optional object containing attributes. These attributes can include an array of components, which are instances of ViewServices.View. This allows for the pre-population of the library with a set of components.

Basic Example

To initialize a new Library instance in Vizzly, use the following TypeScript syntax:

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

API

/**
* Creates a new instance of a Library.
* @param attributes An optional object containing the attributes of the library.
*/
 
constructor(attributes?: { components?: ViewServices.View[] })
 
/**
* Adds a cell to the library at a specified position or appends it at the end if
  no position is specified.
* @param component The Component instance to be added to the library.
* @param attributes An optional object containing the attributes of the cell.
*/
 
addComponent(component: ViewServices.View, attributes?: {
    position?: number; localFilters?: AdditionalFilter[]
})
 
/**
*  Adds an array of cells to the library.
* @param components An array of Component instances.
*/
addComponents(components: ViewServices.View[])