Skip to main content

Interface: Data

A single data row in long (tidy) format.

Each row represents one bar at a specific date. This is the primary data format used by the racing bar chart.

Example

const data: Data[] = [
{ date: '2017-01-01', name: 'Egypt', value: 96.44 },
{ date: '2017-01-01', name: 'Singapore', value: 5.61 },
];

See

https://racing-bars.hatemhosny.dev/documentation/data

Properties

color?

optional color: string | HSLColor

A CSS color string or D3 HSL color to override the bar color.

Defined in

lib/data/data.models.ts:48


date

date: string

A string representation of a valid date (preferably 'YYYY-MM-DD' format).

Defined in

lib/data/data.models.ts:38


group?

optional group: string

A group name for categorising items. Has a one-to-many relationship with name (e.g. continent → countries).

Defined in

lib/data/data.models.ts:46


icon?

optional icon: string

URL of an icon to display on the bar (e.g. country flag). Has a one-to-one relationship with name.

Defined in

lib/data/data.models.ts:50


lastValue?

optional lastValue: number

Internal use — the previous value before the current tick.

Defined in

lib/data/data.models.ts:44


name

name: string

A string holding the name/bar label of each item (e.g. country name).

Defined in

lib/data/data.models.ts:40


rank?

optional rank: number

Internal use — the rank position at this date.

Defined in

lib/data/data.models.ts:52


value

value: number

The numeric value of the item at this date.

Defined in

lib/data/data.models.ts:42