Data Visualization

dylantarre/animation-principles/skills/01-by-domain/data-visualization

作者 dylantarre83597134ba8f無授權條款99 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫9 個月前更新

Use when animating charts, graphs, dashboards, data transitions, or any information visualization work.

AI 產生的概覽

將迪士尼十二項動畫原則套用到圖表、圖形、儀表板與資料轉場。

功能
這項技能把迪士尼十二項動畫原則對應到圖表行為,為資料視覺化動畫提供指引,例如長條圖過衝、錯開進場與緩動的數值變化。內容包含速查表、逐項原則的應用說明、依圖表類型區分的時間表,以及 D3.js 與 Chart.js 的程式碼範例。它也談到無障礙,建議遵循 prefers-reduced-motion 並提供即時狀態的替代顯示。
適用情境
適合在為圖表、圖形、儀表板、資料轉場或其他資訊視覺化製作動畫時使用。適合設計師與開發者判斷資料元素該如何進場、更新以及回應互動。
執行需求
不需要指令碼或套件,僅為說明性內容。程式碼範例涉及 D3.js 與 Chart.js,無障礙指引則涉及 prefers-reduced-motion 媒體查詢。

Data Visualization Animation

Apply Disney's 12 animation principles to charts, graphs, dashboards, and information displays.

Quick Reference

PrincipleData Viz Implementation
Squash & StretchBar overshoot, elastic settling
AnticipationBrief pause before data loads
StagingSequential reveal, focus hierarchy
Straight Ahead / Pose to PoseStreaming vs snapshot data
Follow Through / OverlappingStaggered element entry
Slow In / Slow OutSmooth value interpolation
ArcPie chart sweeps, flow diagrams
Secondary ActionLabels following data points
TimingEntry 300-500ms, updates 200-300ms
ExaggerationEmphasize significant changes
Solid DrawingConsistent scales, clear relationships
AppealSatisfying reveals, professional polish

Principle Applications

Squash & Stretch: Bars can overshoot target height then settle. Pie slices expand slightly on hover. Bubbles compress on collision. Keep total values accurate—animation is transitional.

Anticipation: Brief loading state before data appears. Slight shrink before expansion. Counter briefly pauses before rapid counting. Prepares user for incoming information.

Staging: Reveal data in meaningful sequence—most important first. Highlight active data series. Dim unrelated elements during focus. Guide the data story with motion.

Straight Ahead vs Pose to Pose: Real-time streaming data animates continuously (straight ahead). Dashboard snapshots transition between states (pose to pose). Match approach to data nature.

Follow Through & Overlapping: Data points enter with staggered timing. Labels settle after their data elements. Grid lines appear before data. Legends animate with slight delay.

Slow In / Slow Out: Value changes ease smoothly—no jarring jumps. Use d3.easeCubicInOut or equivalent. Counter animations accelerate then decelerate. Progress bars ease to completion.

Arc: Pie charts sweep clockwise from 12 o'clock. Sankey diagram flows follow curved paths. Network graphs use force-directed arcs. Radial charts expand from center.

Secondary Action: Tooltips follow data point movement. Value labels count up as bars grow. Axis tick marks respond to scale changes. Shadows indicate data depth.

Timing: Initial entry: 300-500ms staggered. Data updates: 200-300ms. Hover states: 100-150ms. Filter transitions: 400-600ms. Slower timing aids comprehension.

Exaggeration: Significant changes deserve attention—pulse or glow outliers. Threshold crossings trigger emphasis. Anomalies animate more dramatically. Don't exaggerate the data itself.

Solid Drawing: Maintain consistent scales during animation. Transitions shouldn't distort data relationships. Preserve axis alignment. Visual hierarchy must remain clear throughout motion.

Appeal: Data entry should feel satisfying. Professional, purposeful motion builds trust. Avoid gratuitous animation—every motion should aid understanding.

Code Patterns

D3.js

javascript
// Staggered bar entry with easingbars.transition()    .duration(500)    .delay((d, i) => i * 50)    .ease(d3.easeCubicOut)    .attr("height", d => yScale(d.value))    .attr("y", d => height - yScale(d.value));
// Smooth data updatesbars.transition()    .duration(300)    .ease(d3.easeCubicInOut)    .attr("height", d => yScale(d.value));

Chart.js

javascript
// Animation configurationoptions: {    animation: {        duration: 500,        easing: 'easeOutQuart',        delay: (context) => context.dataIndex * 50    }}

Data Type Timing

VisualizationEntryUpdateHover
Bar chart400ms stagger300ms100ms
Line chart600ms draw400ms150ms
Pie chart500ms sweep300ms100ms
Scatter plot300ms stagger200ms100ms
Dashboard500-800ms cascade300ms150ms

Accessibility Note

Always respect prefers-reduced-motion. Data visualization animation should aid comprehension, not hinder it. Provide instant-state fallback for users who disable motion.

來源與署名

來源:dylantarre/animation-principles位於skills/01-by-domain/data-visualization提交8359713

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架