Skip to content
husky_theme, a theme for Altair charts based on the University of Washington branding guidelines
Jupyter Notebook
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
images
.gitignore
LICENSE
README.md
environment.yml
husky_theme.py
husky_theme_examples.ipynb

README.md

husky_theme for Altair

This repo defines husky_theme, a theme for Altair charts based on the University of Washington branding guidelines. That said, it is NOT an official product of the University of Washington. Check it out some examples on Binder without downloading or installing anything.

Binder

If you use the theme, I'd love to hear about it.

The theme was built with inspiration from Sergio Sánchez's excellent blog post: Consistently Beautiful Visualizations with Altair Themes.

Usage

  1. Obviously, you will need altair.

    • To run the examples notebook, you will also need vega_datasets, pandas, and numpy.
  2. This theme uses three fonts:

    • Encode Sans - Regular
    • Open Sans - Regular
    • Open Sans - Bold

    If you don't have these installed, all three fonts are all available via Google Fonts. You can get them from within a Jupyter Notebook with:

%%html
<style>
@import url('https://fonts.googleapis.com/css?family=Encode+Sans:400');
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400');
@import url('https://fonts.googleapis.com/css?family=Open+Sans:700');
</style>
  1. Since the theme is defined in a .py file, you can register and enable it in Jupyter Notebook with the following magic:
%run husky_theme.py

Examples

Below are a few examples using the husky_theme to reproduce examples from the Altair Example Gallery.

The husky_theme.ipynb notebook contains a more complete series of examples. In a few cases, I have slightly altered the code from the Altair docs. These are noted along with the example. You can play around with the examples yourself by launching the notebook in Binder.

Binder

simple_scatter

simple_bar

simple_histogram

simple_stacked_area

multi_line

candlestick

Contributing

I welcome contributions/improvements to the theme. Feel free to submit a PR.

You can’t perform that action at this time.