Remotion Rule: Charts
Remotion skill rule: Chart and data visualization patterns for Remotion. Use when creating bar charts, pie charts, line charts, stock graphs, or any data-driven animations.. Part of the official Re...
What it is
The Remotion Charts Rule is part of the official Remotion Agent Skill set. It provides patterns and best practices for creating animated data visualizations in Remotion compositions, including bar charts, pie charts, line charts, stock graphs, and other data-driven animations. The rule activates automatically when an AI agent detects chart-related work in a Remotion project.
This rule is designed for developers building data-driven video content with Remotion who need animated charts that render frame-by-frame for smooth transitions.
How it saves time or tokens
Animating charts in video requires frame-by-frame interpolation, proper easing, and careful timing. Without this rule, developers must figure out the correct Remotion APIs (useCurrentFrame, interpolate, spring) for each chart type from scratch. The rule provides ready-made patterns that an AI agent follows, producing correct animated charts on the first attempt instead of iterating through broken implementations.
How to use
- Install the Remotion skills package:
npx skills add remotion-dev/skills
- The Charts rule activates automatically when you ask your AI agent to create chart components in a Remotion project.
- Describe the chart you want:
Create a bar chart component that animates each bar growing from 0 to its value
over 30 frames with a spring animation, staggered by 5 frames per bar.
Example
A simple animated bar chart component following the rule's patterns:
import { useCurrentFrame, interpolate, spring, useVideoConfig } from 'remotion';
interface BarChartProps {
data: { label: string; value: number }[];
}
export const BarChart: React.FC<BarChartProps> = ({ data }) => {
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
const maxValue = Math.max(...data.map((d) => d.value));
return (
<div style={{ display: 'flex', alignItems: 'flex-end', gap: 12, height: 300 }}>
{data.map((item, i) => {
const progress = spring({
frame: frame - i * 5,
fps,
config: { damping: 12 },
});
const height = interpolate(progress, [0, 1], [0, (item.value / maxValue) * 280]);
return (
<div key={item.label} style={{ textAlign: 'center' }}>
<div style={{ width: 48, height, background: '#4f46e5', borderRadius: 4 }} />
<span>{item.label}</span>
</div>
);
})}
</div>
);
};
Related on TokRepo
- Video tools — Browse video creation and animation tools
- Automation tools — Explore content automation workflows
Common pitfalls
- Not using
spring()for natural-feeling animations. Linear interpolation makes charts look mechanical. Spring animations with proper damping produce professional results. - Forgetting to handle negative frame values when staggering animations. When
frame - i * 5is negative,spring()returns 0, which is correct behavior, butinterpolate()may throw if the input range is not properly clamped. - Hardcoding chart dimensions instead of making them responsive to composition size. Use
useVideoConfig()to get width and height, then scale chart dimensions proportionally.
Frequently Asked Questions
The rule provides patterns for bar charts (vertical and horizontal), pie charts, line charts with animated drawing, area charts, and stock/candlestick charts. Each type includes animation patterns using Remotion's spring and interpolate APIs.
Yes. Remotion renders React components, so you can use D3's calculation functions (scales, layouts) to compute positions and sizes, then render with React/SVG. Avoid D3's DOM manipulation methods since Remotion controls the DOM.
Use useVideoConfig() to get the composition's width and height, then calculate chart dimensions as proportions. This ensures charts scale correctly across different output resolutions like 1080p and 4K.
Yes. Apply the same spring or interpolate calculation to both the bar height and the label position. The label follows the bar as it grows, creating a cohesive animation.
Remotion handles rendering. Run npx remotion render src/index.ts MyChart out.mp4 for video output. For GIF, render to frames first and convert with ffmpeg, or use Remotion's built-in GIF rendering support.
Citations (3)
- Remotion Documentation— Remotion is a React framework for programmatic video
- Remotion Animation Guide— Remotion spring and interpolate animation APIs
- Remotion Skills— Remotion Agent Skill for AI-assisted video creation
Related on TokRepo
Source & Thanks
Created by Remotion. Licensed under MIT. remotion-dev/skills — Rule:
charts
Part of the Remotion AI Skill collection on TokRepo.
Discussion
Related Assets
Claude-Flow — Multi-Agent Orchestration for Claude Code
Layers swarm and hive-mind multi-agent orchestration on top of Claude Code with 64 specialized agents, SQLite memory, and parallel execution.
ccusage — Real-Time Token Cost Tracker for Claude Code
CLI that reads ~/.claude logs and breaks down Claude Code token spend by day, session, and project — pluggable into your statusline.
SuperClaude — Workflow Framework for Claude Code
Adds 16+ slash commands, 9 cognitive personas, and a smart flag system to Claude Code in one pipx install.