This repository contains resources for the Vega-Altair tutorial for SciPy 2024.
See the tutorial description for more information.
The only Python dependency of this tutorial is the altair
package with the all
extras enabled.
To install with pip from PyPI:
pip install altair[all]
Or, to install from conda-forge:
conda install -c conda-forge altair-all vega_datasets anywidget
During the live tutorial at SciPy 2024, participants are encouraged to use the Nebari JupyterHub distribution (https://scipy.quansight.dev) with the vega-altair-tutorial
conda environment, which has these dependencies pre-installed.
This tutorial is divided into four parts, each focusing on different aspects of data visualization using Vega-Altair. Below is an outline of the tutorial along with links to each notebook.
- Objective: Learn the basic syntax of Altair, understand how to encode data into visual properties, and customize chart appearances.
- Key Topics:
- Basic Altair syntax
- Encoding data dimensions
- Customizing chart appearance
- Notebook: Part 1 - Data Types, Graphical Marks, and Visual Encoding Channels
- With all inline code: Completed - Part 1 - Data Types, Graphical Marks, and Visual Encoding Channels
- Exercises: Part 1 - Exercises
-
Objective: Learn about integrating data transformations into a chart definition.
-
Key Topics:
- Binning and aggregation
- Advanced data transformations
-
Notebook: Part 2 - Data Transformation
-
Exercises: Part 2 - Exercises
- Objective: Learn how to add interactivity to charts.
- Key Topics:
- Basic interactive features (tooltips and pan/zoom)
- Selection parameters
- Conditional encodings and filtering
- Notebook: Part 3 - Interactivity
- Exercises: Part 3 - Exercises
- Objective: Learn how to share and publish your Vega-Altair visualizations.
- Key Topics:
- Exporting charts as HTML
- Saving charts as static images (PNG, SVG, PDF)
- References for embedding charts in static documents (Quarto, Jupyter Book, LaTeX)
- References for creating dashboards
- Notebook: Part 4 - Sharing and Publishing Visualizations
- Exercises: Part 4 - Exercises