Stream Graph

Definition

A stream graph, sometimes written as streamgraph, is a stacked plot around a "central axis," resulting in a flowing, organic shape. Stream graphs demonstrate how topics evolve.

Problem Statement

Given a time series \(\{f_1,f_2,\dots,f_n\}\) and a baseline \(g_0\) compute the top layer to \(f_i\) as follows: \[g_i = g_0 + \sum_{j=1}^{i} f_j\]

The question of how to compute g0 remains open. Two simple strategies are

Remark

\(f_i = \{f_i(t_0), f_i(t_1), \dots, f_i(t_n)\}\), thus \(g_i = \{g_i(t_0), g_i(t_1), \dots, g_i(t_n)\}\)

How to compute the baseline

Reference: Stacked Graphs - Geometry and Aesthetic, L. Byron, M. Wattenberg

Example

The follwing example visualizes the frequency of baby names in the USA from 1880 to 2015.



The JavaScript Code