Communitygithub.com

圖表動畫(graph)

生成用於 Reels 的極簡豎版(1080x1920)折線圖動畫,黑色平滑線條在白色(或白色在黑色)背景上繪製,同時一個大數字從起點計數到最終值。

圖表動畫(graph) 是什麼?

該技能(命名為「graph」)專為短影音平台(如 Instagram Reels)設計,可自動生成 1080x1920 解析度、30fps 的極簡風格折線圖動畫。它透過 HTML/CSS/Canvas + GSAP 動畫庫來實現平滑的線條繪製和數字計數效果,最終輸出為 MP4 影片和關鍵幀 JPG 預覽圖。使用者只需提供真實數據點(最早到最新),技能會依照 JSON 規格檔自動生成動畫,並強制進行視覺品質檢查(確保大數字不裁切、曲線和標籤保持在紅色的 Instagram 安全區域內、最終幀顯示正確數值)。支援自訂數值格式(前綴、後綴、小數位數)、明暗主題切換,以及可選的最終幀停留時間。此技能特別適用於「0 到 10 萬」計數器、成長圖表或最小指標折線圖的快速創作。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/hieubm1707/gemini-animation-skills/tree/HEAD/skills/graph

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

圖表動畫(graph) 是做什麼的?

┌──────────────────────┐
│ 追蹤者人數            │  標籤
│ 100,000              │  隨線條頂端計數
│                  •   │
│                 /    │  平滑線條自動繪製
│            ___/      │
│ ______----           │
│ 一月 二月 ... 九月    │
└──────────────────────┘

設定檢查

SKILL_DIR 是包含此 SKILL.md 檔案的目錄(請檢查 <skills> 中的路徑)。

SKILL_DIR="$(python3 -c 'import os,sys; print(os.path.realpath(sys.argv[1]))' "<包含此 SKILL.md 的目錄>")”
KIT="$(python3 -c 'import os,sys; print(os.path.realpath(os.path.join(sys.argv[1], "..", "..", "kit")))' "$SKILL_DIR")"
[ -s "$KIT/vendor/gsap.min.js" ] || bash "$KIT/setup.sh"

需要 ffmpeg、node(18+)和 python3(3.9+)。

步驟

  1. 收集真實數據。 從使用者(或螢幕截圖)取得數據點,以最早到最新排序。絕對不要憑空捏造事實;如果使用者只提供起點和終點,請要求中間點,或明確說明曲線僅為示意。
  2. 撰寫規格。 使用下方結構在目標工作資料夾中建立 <名稱>.graph.json。
  3. 先驗證。 執行:
    python3 "$SKILL_DIR/build.py" <名稱>.graph.json --check
    
    在渲染之前修正所有驗證錯誤。
  4. 渲染。 執行:
    python3 "$SKILL_DIR/build.py" <名稱>.graph.json
    
    耗時約 10 秒,輸出 <名稱>.graph.mp4(1080x1920,30 fps)和 <名稱>.graph.sheet.jpg。如需快速預覽單幀,請先使用 --snap 3.5。
  5. 視覺品質檢查(必要)。 使用 read_file 檢查 <名稱>.graph.sheet.jpg:
    • 大計數器適合單行顯示,且無裁切。
    • 曲線和 x 軸標籤保持在紅色 Instagram 安全區域框內。
    • 最終幀顯示正確的最終數值。 若任何項目有裁切或換行不順,請調整規格後重新渲染。
  6. 交付。 回傳 .mp4 和 .sheet.jpg 的可點擊連結。

規格結構

{
  "label": "追蹤者人數",
  "values": [1.2, 2.1, 3.4, 5, 9, 24, 51, 78, 100],
  "labels": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月"],
  "final": 100000,
  "prefix": "",
  "suffix": "",
  "decimals": 0,
  "dark": false
}
  • values(必要):由 2 個以上數字組成的陣列(≥ 0,至少一個 > 0)。最大值會觸及頂部網格線。
  • labels(可選):每個數據點對應一個字串,顯示於 x 軸下方。若多於 12 個,則每隔一個標籤顯示。
  • final(可選):最終顯示的數字。計數器會將 values 乘以 final / values[-1] 進行縮放。省略則以 values 的原始單位計數。
  • prefix、suffix、decimals:格式化設定,例如 "$"、"%"、" kg"。字體會針對較長數字自動縮小。
  • dark:true 為白線黑底;false 為黑線白底。
  • hold(可選):最終幀停留的額外秒數。
  • out(可選):自訂輸出 .mp4 路徑。

品味規則

  • 一個數字、一條線。使用樸素的名詞作為 label(如「追蹤者人數」、「月營收」),切勿使用口號。
  • 不要有提示徽章、不要有「83倍成長!」標籤,也不要任何行銷雜亂元素。
  • 後段加速的曲線視覺效果最佳,但始終忠於真實數據的形狀。

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

breakdown

Makes a 3D exploded-view vertical animation (1080x1920) for a reel using three.js. A phone floats on a dark studio backdrop, separates layer by layer (glass, OLED screen, frame, logic board, battery, back), and draws thin leader lines to numbered labels. Use when the user asks for /breakdown, an exploded view, a "what's inside" teardown, or a labelled 3D hardware breakdown.

low-poly

Makes a PS1/N64-era retro low-poly 3D vertical animation (1080x1920) for a reel using three.js. Chunky low-res nearest-neighbour pixels, vertex snapping, dithering, warm flat lighting, and small yellow captions with a thin black outline. Built-in scene: a dog waits on a station platform while a train arrives and leaves, and seasons turn to snow. Use when the user asks for /low-poly, PS1-style, N64 retro 3D, or "low poly shorts" animations.

map-route

Makes a 3D map route vertical animation (1080x1920) for a reel using three.js. Features a clean white 3D city with parks and a river, a coloured route drawing itself while the camera follows, a bouncing red destination pin, a live countdown ETA card, and a destination card. Use when the user asks for /map-route, an animated route, a "from A to B" map, a journey, or a commute animation.

minimalistic-graphics

Makes a minimal black-and-white line-art vertical animation (1080x1920) for a reel. Thin outlined steps rise one by one, a white dot hops up them, an orbit with sparks draws around the dot at the top, and one quiet lowercase line swaps to a second line. Use when the user asks for /minimalistic-graphics, simple black-and-white motion graphics, calm self-improvement visuals, or line art with one moving dot.

相關技能