Skip to main content

Categorical

Categorical attributes are string attributes that have a limited number of possible values such as colors (red, green, blue, ...). In addtion they can have an inherit order (ordinal attributes) such as a shirt size (small, medium, and large).

Statistics

LineUp-lite computes the following statistics for a categorical attribute:

export interface ICategoricalStats extends IHistStats<string> {
/**
* histogram
*/
readonly hist: readonly Readonly<IBin<string>>[];
/**
* maximal items in a bin
*/
readonly maxBin: number;
/**
* converts a given value to a color
*/
color: (v: string) => string;
/**
* converts the given value to a label
*/
format: (v: string) => string;
}

see ICategoricalStats API Docs

Generator Function

The stats generator function has the following signature. It returns a function that can be used to compute statistics for a given array.

export function categoricalStatsGenerator(options: CategoricalStatsOptions = {}): (arr: readonly string[]): ICategoricalStats;

see categoricalStatsGenerator API Docs

Example

Live Editor
Result
Loading...

Visualization

Cell

CategoricalColor React component

Live Editor
Result
Loading...

Aggregation

Histogram React component

Live Editor
Result
Loading...

Interactive Summary

FilterBinHistogram React component

Live Editor
Result
Loading...