Overview
Theme river charts (also known as stream graphs) visualize the changes of multiple themes or topics over time using flowing, organic shapes. Each theme is represented as a colored stream that varies in width to show changes in value, creating a river-like visualization that reveals patterns, trends, and relationships in temporal data.When to Use
Use theme river charts when you need to:- Track multiple topics or themes over time
- Visualize temporal trends in social media mentions, news coverage, or discussions
- Show the evolution of market segments or product categories
- Display changing popularity of music genres, movie themes, or cultural trends
- Analyze time-series data with multiple categories
- Create visually engaging temporal visualizations for storytelling
Basic Configuration
The theme river chart is configured through theThemeRiverSeriesOption interface, using a single axis coordinate system.
Complete Example
Key Options
Array of data items in the format
[date, value, name] where:date: Time value (Date object, timestamp, or date string)value: Numeric value representing the theme’s magnitude at this timename: String identifier for the theme/category
Theme river charts use a single axis coordinate system for the time dimension.
Gap at the top and bottom of the chart as
[top, bottom]. Can be specified as percentages or absolute pixel values.Label configuration for theme names.
Distance between the label and the stream edge in pixels.
Visual style of the theme streams.
Visual emphasis when hovering over a theme stream.
Index of the single axis to use when multiple single axes are configured.
Data Format
Theme river data must follow a specific three-element array format:- Each data item is a three-element array:
[date, value, name] - The
name(third element) cannot be undefined - Data is automatically grouped by theme name
- Missing time points are filled with zero values
- Themes are stacked in the order they appear
Advanced Features
Social Media Topic Trends
Music Genre Evolution
Custom Color Palette
Interactive Theme River
Time Range with Zoom
Best Practices
- Consistent Time Intervals: Use regular time intervals for smoother, more readable visualizations.
- Limit Theme Count: Keep the number of themes between 3-8 for optimal readability.
-
Complete Data: Ensure each time point has values for all themes to avoid gaps:
-
Label Positioning: Use
position: 'left'or'right'for horizontal single axes. - Color Selection: Choose distinct, harmonious colors for better theme differentiation.
Common Patterns
News Topic Tracking
Product Category Sales
Cultural Trends
Troubleshooting
Problem: Gaps or missing sections in the stream Solution: Ensure every time point has data for all themes. Missing data should be explicitly set to 0. Problem: Labels overlapping or not visible Solution: Adjustlabel.margin, reduce fontSize, or use label.position: 'inside'.
Problem: Streams appear too thin or too thick
Solution: Adjust boundaryGap to control vertical spacing.
Source Reference
The theme river chart implementation can be found in:- Series model:
src/chart/themeRiver/ThemeRiverSeries.ts:81-327 - Type definitions:
src/chart/themeRiver/ThemeRiverSeries.ts:47-79 - Default options:
src/chart/themeRiver/ThemeRiverSeries.ts:297-326 - Data format:
src/chart/themeRiver/ThemeRiverSeries.ts:51,78,112-155