Skip to content

Commit 2b6b2cd

Browse files
kolibril13behackl
andauthored
Added example jupyter notebook into the examples folders (#1029)
* example notebook * removed cell output * added jupyter/ folder to gitignore * added link to binder in documentation * Update docs/source/installation.rst * updated binder links in readme * Update example_scenes/manim_jupyter_example.ipynb Co-authored-by: Benjamin Hackl <[email protected]> * Update example_scenes/manim_jupyter_example.ipynb Co-authored-by: Benjamin Hackl <[email protected]> * Update docs/source/installation.rst Co-authored-by: Benjamin Hackl <[email protected]> * added config.media_width = "10vw" * updated notebook to latest version Co-authored-by: Benjamin Hackl <[email protected]>
1 parent 988ac9b commit 2b6b2cd

File tree

4 files changed

+78
-3
lines changed

4 files changed

+78
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ docs/source/_build/
6464
target/
6565

6666
# Jupyter Notebook
67+
jupyter/
6768
.ipynb_checkpoints
6869

6970
# IPython

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<br />
55
<a href="https://pypi.org/project/manim/"><img src="https://img.shields.io/pypi/v/manim.svg?style=flat&logo=pypi" alt="PyPI Latest Release"></a>
66
<a href="https://hub.docker.com/r/manimcommunity/manim"><img src="https://img.shields.io/docker/v/manimcommunity/manim?color=%23099cec&label=docker%20image&logo=docker" alt="Docker image"> </a>
7-
<a href="https://mybinder.org/v2/gist/behackl/725d956ec80969226b7bf9b4aef40b78/HEAD?filepath=basic%20example%20scenes.ipynb"><img src="https://mybinder.org/badge_logo.svg"></a>
7+
<a href="https://mybinder.org/v2/gh/ManimCommunity/jupyter_examples/HEAD?filepath=basic_example_scenes.ipynb"><img src="https://mybinder.org/badge_logo.svg"></a>
88
<a href="http://choosealicense.com/licenses/mit/"><img src="https://img.shields.io/badge/license-MIT-red.svg?style=flat" alt="MIT License"></a>
99
<a href="https://www.reddit.com/r/manim/"><img src="https://img.shields.io/reddit/subreddit-subscribers/manim.svg?color=orange&label=reddit&logo=reddit" alt="Reddit" href=></a>
1010
<a href="https://twitter.com/manim_community/"><img src="https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40manim_community" alt="Twitter">
@@ -19,7 +19,6 @@
1919
</p>
2020
<hr />
2121

22-
2322
Manim is an animation engine for explanatory math videos. It's used to create precise animations programmatically, as demonstrated in the videos of [3Blue1Brown](https://www.3blue1brown.com/).
2423

2524
> NOTE: This repository is maintained by the Manim Community, and is not associated with Grant Sanderson or 3Blue1Brown in any way (although we are definitely indebted to him for providing his work to the world). If you would like to study how Grant makes his videos, head over to his repository ([3b1b/manim](https://github.com/3b1b/manim)). This fork is updated more frequently than his, and it's recommended to use this fork if you'd like to use Manim for your own projects.
@@ -80,8 +79,9 @@ You should see your native video player program pop up and play a simple scene i
8079
[GitHub repository](master/example_scenes). You can also visit the [official gallery](https://docs.manim.community/en/stable/examples.html) for more advanced examples.
8180

8281
Manim also ships with a `%%manim` IPython magic which allows to use it conveniently in JupyterLab (as well as classic Jupyter) notebooks. See the
82+
8383
[corresponding documentation](https://docs.manim.community/en/stable/reference/manim.utils.ipython_magic.ManimMagic.html) for some guidance and
84-
[try it out online](https://mybinder.org/v2/gist/behackl/725d956ec80969226b7bf9b4aef40b78/HEAD?filepath=basic%20example%20scenes.ipynb).
84+
[try it out online](https://mybinder.org/v2/gh/ManimCommunity/jupyter_examples/HEAD?filepath=basic_example_scenes.ipynb).
8585

8686
## Command line arguments
8787

docs/source/installation.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,20 @@ you are done installing the dependencies, come back to this page to install
77
manim itself.
88

99
.. NOTE::
10+
1011
Before installing manim, you should understand that there are a few main versions of manim
1112
today that are generally incompatible with each other.
1213
This documentation **only** covers the installation of the *community edition*;
1314
trying to use instructions intended for other versions of manim or vice versa will likely result in failure.
1415
In particular, most video tutorials are outdated. For more information, please read :doc:`Differences between Manim Versions <installation/versions>`.
1516

17+
18+
.. tip::
19+
20+
In case that you want to try manim online without installation, open it in
21+
`Binder <https://mybinder.org/v2/gh/ManimCommunity/jupyter_examples/HEAD?filepath=basic_example_scenes.ipynb>`_.
22+
23+
1624
Installing dependencies
1725
***********************
1826

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"from manim import *"
10+
]
11+
},
12+
{
13+
"cell_type": "code",
14+
"execution_count": null,
15+
"metadata": {},
16+
"outputs": [],
17+
"source": [
18+
"%%manim -v WARNING --disable_caching -ql -s Example1\n",
19+
"\n",
20+
"class Example1(Scene):\n",
21+
" def construct(self):\n",
22+
" self.add(Circle())"
23+
]
24+
},
25+
{
26+
"cell_type": "code",
27+
"execution_count": null,
28+
"metadata": {},
29+
"outputs": [],
30+
"source": [
31+
"%%manim -v WARNING --disable_caching -qm HelloManim\n",
32+
"\n",
33+
"# set the maximum width for video outputs to a predefined value\n",
34+
"config.media_width = \"20vw\"\n",
35+
"\n",
36+
"class HelloManim(Scene):\n",
37+
" def construct(self):\n",
38+
" self.camera.background_color = \"#ece6e2\"\n",
39+
" banner_large = ManimBanner(dark_theme=False).scale(0.7)\n",
40+
" self.play(banner_large.create())\n",
41+
" self.play(banner_large.expand())"
42+
]
43+
}
44+
],
45+
"metadata": {
46+
"kernelspec": {
47+
"display_name": "Python 3",
48+
"language": "python",
49+
"name": "python3"
50+
},
51+
"language_info": {
52+
"codemirror_mode": {
53+
"name": "ipython",
54+
"version": 3
55+
},
56+
"file_extension": ".py",
57+
"mimetype": "text/x-python",
58+
"name": "python",
59+
"nbconvert_exporter": "python",
60+
"pygments_lexer": "ipython3",
61+
"version": "3.9.1"
62+
}
63+
},
64+
"nbformat": 4,
65+
"nbformat_minor": 4
66+
}

0 commit comments

Comments
 (0)