Communitygithub.com

graph(动画图表)

为短视频生成极简垂直(1080x1920)折线动画:平滑黑线自绘,大数字随线尾递增至最终值。适用于 /graph、增长图、计数动画或指标趋势视频。

graph(动画图表) 是什么?

该技能是一个专用工具,用于创建极简风格的增长曲线动画视频(竖屏 1080×1920),专为短视频平台(如 Instagram Reels)设计。它接受一组数值数据,生成一条平滑的黑色线条(或白底黑线背景),线条从头到尾自动绘制,同时一个醒目的数字在曲线末端动态递增,最终定格在用户指定的最终值上。用户可以通过 JSON 配置文件(包含 labels、values、final、prefix、suffix、decimals 等参数)控制图表样式,并支持亮色与暗色模式。技能依赖 ffmpeg、Node.js 18+ 和 Python 3.9+,运行时会先进行 JSON 校验和视觉预览检查,最后输出 .mp4 视频和 .sheet.jpg 预览图。设计师可通过调整 values 排列和 hold 参数控制动画节奏,确保数据真实且呈现克制的设计风格。

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

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Graph Animation(graph 动画图表)

┌──────────────────────┐
│ 粉丝数               │  标签:简洁明了
│ 100,000              │  数字随线条末端计数递增
│                  •   │
│                 /    │  平滑线条自行绘制
│            ___/      │
│ ______----           │
│ 1月 2月 …  9月       │
└──────────────────────┘

环境准备

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(1080×1920,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": ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月"],
  "final": 100000,
  "prefix": "",
  "suffix": "",
  "decimals": 0,
  "dark": false
}
  • values(必填):2 个或更多数字数组(>= 0,至少一个 > 0)。最大值会触及顶部网格线。
  • labels(可选):每个数据点在 x 轴下方的标签字符串。超过 12 个时,每隔一个标签显示。
  • final(可选):最终显示的数字。计数器按 final / values[-1] 缩放 values。省略时以原始 values 单位进行计数。
  • prefix、suffix、decimals:格式化选项,例如 "$"、"%"、" 公斤"。数字过长时字体自动缩小。
  • 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.

相关技能