liveBook · Manning

Ordinal data

As explained in D3.js in Action, Third Edition

An ordinal value is a categorical value whose labels have a meaningful order or rank.

Ordinal data is qualitative, nonnumerical data whose categories have a meaningful order or rank. Unlike nominal data, ordinal labels are not interchangeable: XS, S, M, L, and XL follow an ascending size sequence. section 3.1.2 section 14.2

Use the ordering of ordinal categories when planning a visualization:

  • List dataset attributes and classify ordinal variables separately from quantitative and nominal variables. section 14.2
  • Choose an encoding that preserves or communicates rank; sequential or diverging color palettes can represent ordered categories. section 3.1.2
  • Select a D3 scale suited to qualitative data rather than treating the labels as continuous numerical measurements. section 3.1.2

Coffee sizes

Coffee sizes such as short, tall, grande, and venti form an ordinal variable because their order matters. That ordering can guide the visual channel chosen for a chart. section 14.2

Figure 3.4 A classification of data types
figure

Use the data-type classification figure to distinguish ordinal categories from nominal, discrete, and continuous data. section 3.1.2

How D3.js in Action, Third Edition covers it

How deep it goes
Defines ordered qualitative categories and connects them to palettes and scales, while deferring detailed scale treatment.
Examples
Uses T-shirt sizes and coffee-order sizes to demonstrate meaningful category order.
What it assumes
Distinguishes ordinal data from nominal, discrete, and continuous data through basic data-type classification.
What you can do after
Apply ordinal classifications when organizing attributes and choosing visual encodings or D3 scales.
How it connects
Connects ordinal data with qualitative data, nominal data, quantitative data, color scales, and D3 scales.

Also explained in

Compare how 8 books explain ordinal data →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of D3.js in Action, Third Edition. The section links point to the parts of the book it draws on.