CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-lightdash--common

tessl install tessl/npm-lightdash--common@0.2231.5

Shared 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%

task.mdevals/scenario-18/

Data Visualization Symbol Configurator

A utility module for configuring chart symbol visibility based on dataset characteristics. When visualizing data series with line or scatter charts, showing individual data point symbols can enhance readability for smaller datasets but create visual clutter for larger ones. This module implements an intelligent heuristic to automatically determine appropriate symbol configuration.

Capabilities

Symbol Visibility Based on Data Volume

  • For CartesianSeriesType.LINE with 50 data points, returns { showSymbol: true, symbolSize: 4 } @test
  • For CartesianSeriesType.LINE with 100 data points, returns { showSymbol: true, symbolSize: 4 } @test
  • For CartesianSeriesType.LINE with 150 data points, returns { showSymbol: false, symbolSize: 0 } @test
  • For CartesianSeriesType.BAR with 50 data points, returns { showSymbol: false, symbolSize: 0 } @test

Implementation

@generates

API

import { CartesianSeriesType } from '@lightdash/common';

/**
 * Symbol configuration result
 */
export interface SymbolConfig {
  showSymbol: boolean;
  symbolSize: number;
}

/**
 * Determines the appropriate symbol visibility and size for a chart series
 * based on the number of data points and chart type.
 *
 * Symbols enhance readability for small datasets but create visual clutter
 * for large datasets. This function implements a heuristic that shows symbols
 * for line charts when there are 100 or fewer data points, and hides them
 * for larger datasets. Bar charts never display symbols.
 *
 * @param dataPointCount - The number of data points in the series
 * @param chartType - The type of chart series (from CartesianSeriesType enum)
 * @returns Symbol configuration with visibility and size
 */
export function getSymbolConfig(
  dataPointCount: number,
  chartType: CartesianSeriesType
): SymbolConfig;

Dependencies { .dependencies }

@lightdash/common { .dependency }

Provides chart types and visualization utilities for Business Intelligence.

@satisfied-by

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@lightdash/common@0.2231.x
tile.json