CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-lightdash--common

Shared TypeScript library for the Lightdash platform containing common types, utilities, and business logic for analytics workflows

Overall
score

72%

Evaluation72%

1.09x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-19/

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

Install with Tessl CLI

npx tessl i tessl/npm-lightdash--common

tile.json