项目
在 GitHub 查看
jkjkil4/JAnim
jkjkil4/JAnim has 290 GitHub stars and 19 forks. GitHot measured 0 stars in 24 hours, 0 in 7 days, and +1 in 15 days. Last checked 2026-11-18 01:54 UTC. Last push 2026-11-11.
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- +1
- 1个月
- 更新延迟
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
关于
Programmatic animation engine for creating precise and smooth animations with real-time feedback
创作与媒体README_zh_CN.md
原文
English | >简体中文<
介绍
JAnim 以程序化动画为核心理念,用于创建精确且流畅的动画,并支持实时编辑、实时预览,以及更多其它丰富的功能。
受到 manim 的启发
介绍视频:https://www.bilibili.com/video/BV17s42137SJ/
示例
|
|
|
亮点
程序化动画
class BubbleSort(Timeline):
def construct(self):
# define items
heights = np.linspace(1.0, 6.0, 5)
np.random.seed(123456)
np.random.shuffle(heights)
rects = [
Rect(1, height,
fill_alpha=0.5)
for height in heights
]
group = Group(*rects)
group.points.arrange(aligned_edge=DOWN)
# do animations
self.show(group)
for i in range(len(heights) - 1, 0, -1):
for j in range(i):
rect1, rect2 = rects[j], rects[j + 1]
self.play(
rect1.anim.color.set(BLUE),
rect2.anim.color.set(BLUE),
duration=0.15
)
if heights[j] > heights[j + 1]:
x1 = rect1.points.box.x
x2 = rect2.points.box.x
self.play(
rect1.anim.points.set_x(x2),
rect2.anim.points.set_x(x1),
duration=0.3
)
heights[[j, j + 1]] = heights[[j + 1, j]]
rects[j], rects[j + 1] = rect2, rect1
self.play(
rect1.anim.color.set(WHITE),
rect2.anim.color.set(WHITE),
duration=0.15
)

修改代码,立即更新

随意控制预览进度

安装
JAnim 运行在 Python 3.12 及更高版本
你可以直接安装 PyPI 上发布的最新版本:
pip install janim
如果你想直接安装 main 分支上的最新开发版本(而无需克隆仓库),请运行:
pip install git+https://github.com/jkjkil4/JAnim.git@main
或者,为了跟上最新的开发进度并编辑源代码,你可以克隆本仓库并以可编辑模式安装:
git clone https://github.com/jkjkil4/JAnim.git
cd JAnim
pip install -e .
使用 JAnim
你可以使用如下的命令来查看示例
janim examples
文档提供了更为详细的 JAnim 安装与使用教程(注:你可以使用页面角落的弹出菜单来更改文档语言)
相关项目
JAnim 的核心依赖:
- janim-backend:为 JAnim 提供 Rust 后端
- typst4janim:内部使用,用于将 Typst 元素直接导出到 JAnim
License
MIT license