tessl install tessl/npm-lightdash--common@0.2231.5Shared TypeScript library for the Lightdash platform containing common types, utilities, and business logic for analytics workflows
Agent Success
Agent success rate when using this tile
72%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.09x
Baseline
Agent success rate without this tile
66%
Build a utility module for creating and managing dashboard structures with tiles, tabs, layout positioning, and cross-tile filtering capabilities.
Your module should provide functions for:
Create tiles with proper type, positioning, and properties. Support different tile types including chart tiles, markdown tiles, and SQL chart tiles. Each tile must have a unique UUID, grid position coordinates (x, y, width, height), and an optional tab UUID for tab organization.
Validate that selected tab UUIDs actually exist within a dashboard's tiles. When tab UUIDs are provided for filtering, ensure at least one of them exists in the dashboard's tile collection. If no valid tabs are found, throw an appropriate error.
Calculate appropriate positioning for tiles in a grid layout. Implement logic to determine x, y coordinates and dimensions (width and height) for new tiles, considering existing tile positions to avoid overlaps. Support different default sizes for different tile types.
Apply dashboard-level filters to specific tiles using tile targeting configuration. Given a set of dashboard filters and a tile UUID, extract only the filters that should apply to that specific tile. Handle tile target overrides where filters can be customized or disabled on a per-tile basis.
@generates
/**
* Creates a dashboard chart tile with the specified configuration
*/
export function createChartTile(
uuid: string,
savedChartUuid: string,
x: number,
y: number,
w: number,
h: number,
tabUuid?: string
): DashboardChartTile;
/**
* Creates a dashboard markdown tile with the specified configuration
*/
export function createMarkdownTile(
uuid: string,
title: string,
content: string,
x: number,
y: number,
w: number,
h: number,
tabUuid?: string
): DashboardMarkdownTile;
/**
* Validates that selected tab UUIDs exist in the dashboard tiles.
* Throws ParameterError if none of the selected tabs exist.
*/
export function validateSelectedTabs(
selectedTabs: string[] | null,
dashboardTiles: DashboardTile[]
): void;
/**
* Calculates the next available position for a new tile in the grid.
* Returns an object with x, y coordinates for the new tile.
*/
export function getNextTilePosition(
existingTiles: DashboardTile[],
tileWidth: number,
tileHeight: number,
gridWidth?: number
): { x: number; y: number };
/**
* Gets dashboard filters that apply to a specific tile.
* Respects tile target overrides and filters out disabled filters.
*/
export function getDashboardFiltersForTile(
tileUuid: string,
dashboardFilters: DashboardFilters
): DashboardFilters;Provides dashboard types, tile types, filter types, and utilities for Lightdash BI platform.
docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
scenario-11
scenario-12
scenario-13
scenario-14
scenario-15
scenario-16
scenario-17
scenario-18
scenario-19
scenario-20