Skip to main content
This example demonstrates how to create animated data visualizations using popular charting libraries while maintaining full control over animation timing through Helios.

Overview

The data visualization examples show:
  • Disabling library animations for manual control
  • Frame-based data interpolation
  • Synchronized multi-series animations
  • Dynamic chart updates without flickering

Chart.js implementation

Complete example

composition.html
main.ts

Key patterns for Chart.js

Disable library animations

Always disable Chart.js internal animations to prevent conflicts:

Update without animation

Use update('none') to render immediately without transitions:

Data interpolation

Create smooth transitions by calculating data values based on time:

D3.js implementation

Complete example

composition.html
data.js
index.js

Key patterns for D3.js

Interval-based interpolation

Interpolate between data snapshots using time-based calculations:

Value interpolation

Smooth transitions between data points:

Immediate updates without transitions

Use the enter-merge-exit pattern without D3 transitions:

Performance tips

Minimize DOM updates

Only update changed attributes:

Use fixed scales

Prevent scale recalculation by using fixed domains:

Cache D3 selections

Store selections to avoid repeated queries:

Batch data updates

Update all data at once instead of incrementally:

Advanced techniques

Multi-dataset animations

Animate multiple datasets with different timing:

Custom easing functions

Implement custom interpolation for unique effects:

Race bar charts

Create racing bar chart animations with D3: