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 simple chart visualization system that formats tooltip data for user-friendly display. The system should handle multiple data series, format values appropriately, and generate HTML tooltips for chart visualization libraries.
@generates
/**
* Represents formatting configuration for a specific field
*/
export interface FieldFormat {
type: 'currency' | 'percentage' | 'number' | 'default';
currency?: string;
decimalPlaces?: number;
}
/**
* Map of field names to their formatting configurations
*/
export interface ItemsMap {
[fieldName: string]: FieldFormat;
}
/**
* Represents a single data series in the tooltip
*/
export interface TooltipSeries {
seriesName: string;
value: number | null | undefined;
color?: string;
}
/**
* Parameters passed to the tooltip formatter
*/
export interface TooltipParams {
axisValue?: string;
series: TooltipSeries[];
}
/**
* Formats tooltip content for chart visualization with field-specific formatting
*
* @param params - The tooltip parameters containing series data
* @param itemsMap - Optional map of field formatting configurations
* @returns HTML string for tooltip display
*/
export function formatTooltip(
params: TooltipParams,
itemsMap?: ItemsMap
): string;
/**
* Formats a single value according to the specified format configuration
*
* @param value - The numeric value to format
* @param format - The format configuration to apply
* @returns Formatted string representation of the value
*/
export function formatValue(
value: number | null | undefined,
format?: FieldFormat
): string;Provides tooltip formatting utilities and field formatting support for chart visualizations.
@satisfied-by
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