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.