# JAnim
**Repository Path**: jkjkil4/JAnim
## Basic Information
- **Project Name**: JAnim
- **Description**: 支持实时反馈的程序化动画引擎,用于创建精确且流畅的动画
- **Primary Language**: Python
- **License**: MIT
- **Default Branch**: main
- **Homepage**: https://janim.rtfd.io
- **GVP Project**: No
## Statistics
- **Stars**: 7
- **Forks**: 1
- **Created**: 2023-07-07
- **Last Updated**: 2026-03-13
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README

[](http://choosealicense.com/licenses/mit/)
[](https://pypi.org/project/JAnim/)
[](https://janim.readthedocs.io/zh-cn/latest/)
[English](README.md) | **>简体中文<**
## 介绍
JAnim 以程序化动画为核心理念,用于创建精确且流畅的动画,并支持实时编辑、实时预览,以及更多其它丰富的功能。
受到 [manim](https://github.com/3b1b/manim) 的启发
介绍视频:[https://www.bilibili.com/video/BV17s42137SJ/](https://www.bilibili.com/video/BV17s42137SJ/)
## 示例
[- 更多样例 -](https://janim.readthedocs.io/zh-cn/latest/)
## 亮点
### 程序化动画
```py
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 上发布的最新版本:
```sh
pip install janim
```
如果你想直接安装 `main` 分支上的最新开发版本(而无需克隆仓库),请运行:
```sh
pip install git+https://github.com/jkjkil4/JAnim.git@main
```
或者,为了跟上最新的开发进度并编辑源代码,你可以克隆本仓库并以可编辑模式安装:
```sh
git clone https://github.com/jkjkil4/JAnim.git
cd JAnim
pip install -e .
```
## 使用 JAnim
你可以使用如下的命令来查看示例
```sh
janim examples
```
[文档](https://janim.readthedocs.io/zh-cn/latest/index.html)提供了更为详细的 JAnim 安装与使用教程(注:你可以使用页面角落的弹出菜单来更改文档语言)
## License
MIT license