chapter three

3 Reviewing the basic concepts of Altair

 

This chapter covers

  • Vega and Vega-Lite
  • The basic components of an Altair chart
  • Case study

In this chapter, we will review the basic concepts behind Vega and Vega-lite, the visualization grammars upon which Altair is built. Then, we’ll focus on the Altair main components: encodings, marks, conditions, compound charts, and interactivity. In the last part of the chapter, we’ll implement a practical example.

3.1 Vega and Vega-Lite

Vega and Vega-Lite are two visualization grammars used by Altair. A visualization grammar is a set of rules and principles defining how to represent data visually, much like how a spoken language has its grammar. A visualization grammar includes a vocabulary of visual elements, such as points, lines, and bars, and rules for combining and arranging these elements to create meaningful visualizations. Using a visualization grammar allows you to create clear and effective data visualizations that convey insights and tell stories.

3.1.1 Vega

3.1.2 Vega-lite

3.1.3 How to render a Vega/Vega-lite visualization

3.2 The Basic Components of an Altair Chart

3.2.1 Encodings

3.2.2 Marks

3.2.3 Conditions

3.2.4 Compound Charts

3.2.5 Interactivity

3.2.6 Configurations

3.3 Case Study

3.3.1 From Data to Information

3.3.2 From Information to Knowledge

3.3.3 From Knowledge to Wisdom

3.4 Summary

3.5 References