pymations 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +24 -2
  3. package/THIRD-PARTY-NOTICES +217 -0
  4. package/engine/anim.js +8 -0
  5. package/engine/fonts/KaTeX_AMS-Regular.ttf +0 -0
  6. package/engine/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  7. package/engine/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  8. package/engine/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  9. package/engine/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  10. package/engine/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  11. package/engine/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  12. package/engine/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  13. package/engine/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  14. package/engine/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  15. package/engine/fonts/KaTeX_Main-Bold.ttf +0 -0
  16. package/engine/fonts/KaTeX_Main-Bold.woff2 +0 -0
  17. package/engine/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  18. package/engine/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  19. package/engine/fonts/KaTeX_Main-Italic.ttf +0 -0
  20. package/engine/fonts/KaTeX_Main-Italic.woff2 +0 -0
  21. package/engine/fonts/KaTeX_Main-Regular.ttf +0 -0
  22. package/engine/fonts/KaTeX_Main-Regular.woff2 +0 -0
  23. package/engine/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  24. package/engine/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  25. package/engine/fonts/KaTeX_Math-Italic.ttf +0 -0
  26. package/engine/fonts/KaTeX_Math-Italic.woff2 +0 -0
  27. package/engine/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  28. package/engine/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  29. package/engine/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  30. package/engine/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  31. package/engine/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  32. package/engine/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  33. package/engine/fonts/KaTeX_Script-Regular.ttf +0 -0
  34. package/engine/fonts/KaTeX_Script-Regular.woff2 +0 -0
  35. package/engine/fonts/KaTeX_Size1-Regular.ttf +0 -0
  36. package/engine/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  37. package/engine/fonts/KaTeX_Size2-Regular.ttf +0 -0
  38. package/engine/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  39. package/engine/fonts/KaTeX_Size3-Regular.ttf +0 -0
  40. package/engine/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  41. package/engine/fonts/KaTeX_Size4-Regular.ttf +0 -0
  42. package/engine/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  43. package/engine/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  44. package/engine/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  45. package/engine/fonts/LICENSE_KATEX_FONTS.txt +106 -0
  46. package/engine/fonts/LICENSE_LIBERATION.txt +102 -0
  47. package/engine/fonts/LiberationSans-Bold.ttf +0 -0
  48. package/engine/fonts/LiberationSans-BoldItalic.ttf +0 -0
  49. package/engine/fonts/LiberationSans-Italic.ttf +0 -0
  50. package/engine/fonts/LiberationSans-Regular.ttf +0 -0
  51. package/engine/katex.min.css +1 -0
  52. package/engine/katex.min.js +1 -0
  53. package/engine/opentype.min.js +2 -0
  54. package/package.json +34 -4
  55. package/pyctures.py +895 -0
  56. package/pymations.js +1805 -0
  57. package/pymations.py +4346 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 John Wylie
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,25 @@
1
- # Temporary Holding Version
1
+ # pymations (browser)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The browser half of [Pymations](https://github.com/johnwylie70/pymations) ([try it in your browser](https://www.circuitry.dev/pymations)): maths animations written in Python, on any web page. It runs Manim Community scripts. Python runs in the visitor's browser with [Pyodide](https://pyodide.org), loaded from its official CDN.
4
+
5
+ ```html
6
+ <div data-pymations-src="scene.py"></div>
7
+ <script type="module" src="https://cdn.jsdelivr.net/npm/pymations@0.1.0/pymations.js"></script>
8
+ ```
9
+
10
+ `scene.py` is an ordinary Pymations scene:
11
+
12
+ ```python
13
+ from pymations import *
14
+
15
+ square = Square(color=YELLOW)
16
+ play(Create(square))
17
+ play(Transform(square, Circle(color=BLUE, fill_opacity=0.5)))
18
+ wait()
19
+ ```
20
+
21
+ The animation fills its `<div>` (16:9 if the div has no height), starts when it scrolls into view, and has a scrubber to pause and replay it. `from manim import *` works too. See [Building pages](https://github.com/johnwylie70/pymations/blob/main/docs/building-pages.md) for every setting.
22
+
23
+ To write and test scenes on your own computer, install the Python package: `pip install pymations`, then `pymations run scene.py`.
24
+
25
+ Includes KaTeX (MIT) with its fonts (SIL OFL 1.1), opentype.js (MIT) and Liberation Sans (SIL OFL 1.1). Pymations is an independent project, not affiliated with Manim. Author: John Wylie. MIT licence.
@@ -0,0 +1,217 @@
1
+ THIRD-PARTY NOTICES
2
+
3
+ Pymations includes or loads the following third-party software. Pymations
4
+ itself (the Python module, the browser half and the animation engine) is MIT
5
+ licensed; see LICENSE. It runs Manim Community scripts with its own
6
+ implementation: no Manim code is included. Pymations is an independent
7
+ project, not affiliated with Manim.
8
+
9
+ --------------------------------------------------------------------------------
10
+ KaTeX (version 0.16.27)
11
+ https://katex.org - https://github.com/KaTeX/KaTeX
12
+
13
+ Included in this package as:
14
+ src/pymations/web/engine/katex.min.js
15
+ src/pymations/web/engine/katex.min.css
16
+
17
+ Licence: MIT (the fonts are under their own licence; see the next entry)
18
+
19
+ The MIT License (MIT)
20
+
21
+ Copyright (c) 2013-2020 Khan Academy and other contributors
22
+
23
+ Permission is hereby granted, free of charge, to any person obtaining a copy
24
+ of this software and associated documentation files (the "Software"), to deal
25
+ in the Software without restriction, including without limitation the rights
26
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27
+ copies of the Software, and to permit persons to whom the Software is
28
+ furnished to do so, subject to the following conditions:
29
+
30
+ The above copyright notice and this permission notice shall be included in all
31
+ copies or substantial portions of the Software.
32
+
33
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39
+ SOFTWARE.
40
+
41
+ --------------------------------------------------------------------------------
42
+ KaTeX fonts (as distributed in the katex npm package, version 0.16.27)
43
+ https://github.com/KaTeX/katex-fonts
44
+
45
+ Included in this package as:
46
+ src/pymations/web/engine/fonts/KaTeX_*.ttf and KaTeX_*.woff2 (unchanged)
47
+ src/pymations/web/engine/fonts/LICENSE_KATEX_FONTS.txt (this licence)
48
+
49
+ Copyright (c) 2009-2010, Design Science, Inc. (www.mathjax.org)
50
+ Copyright (c) 2014-2018 Khan Academy (www.khanacademy.org)
51
+ with Reserved Font Names KaTeX_AMS, KaTeX_Caligraphic, KaTeX_Fraktur,
52
+ KaTeX_Main, KaTeX_Math, KaTeX_SansSerif, KaTeX_Script, KaTeX_Size1,
53
+ KaTeX_Size2, KaTeX_Size3, KaTeX_Size4 and KaTeX_Typewriter.
54
+
55
+ Licence: SIL Open Font License 1.1, as each font file states in its own
56
+ licence field. The full text is in LICENSE_KATEX_FONTS.txt beside the fonts,
57
+ and in the Liberation Sans entry below.
58
+
59
+ --------------------------------------------------------------------------------
60
+ opentype.js (version 1.3.4)
61
+ https://opentype.js.org - https://github.com/opentypejs/opentype.js
62
+
63
+ Included in this package as:
64
+ src/pymations/web/engine/opentype.min.js
65
+
66
+ Licence: MIT
67
+
68
+ The MIT License (MIT)
69
+
70
+ Copyright (c) 2020 Frederik De Bleser
71
+
72
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
73
+ this software and associated documentation files (the "Software"), to deal in
74
+ the Software without restriction, including without limitation the rights to
75
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
76
+ the Software, and to permit persons to whom the Software is furnished to do so,
77
+ subject to the following conditions:
78
+
79
+ The above copyright notice and this permission notice shall be included in all
80
+ copies or substantial portions of the Software.
81
+
82
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
83
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
84
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
85
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
86
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
87
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
88
+
89
+ --------------------------------------------------------------------------------
90
+ Liberation Sans (version 2, as distributed with pdf.js 5.4)
91
+ https://github.com/liberationfonts/liberation-fonts
92
+
93
+ Included in this package as:
94
+ src/pymations/web/engine/fonts/LiberationSans-Regular.ttf
95
+ src/pymations/web/engine/fonts/LiberationSans-Bold.ttf
96
+ src/pymations/web/engine/fonts/LiberationSans-Italic.ttf
97
+ src/pymations/web/engine/fonts/LiberationSans-BoldItalic.ttf
98
+ src/pymations/web/engine/fonts/LICENSE_LIBERATION.txt (this licence)
99
+
100
+ Licence: SIL Open Font License 1.1
101
+
102
+ Digitized data copyright (c) 2010 Google Corporation
103
+ with Reserved Font Arimo, Tinos and Cousine.
104
+ Copyright (c) 2012 Red Hat, Inc.
105
+ with Reserved Font Name Liberation.
106
+
107
+ This Font Software is licensed under the SIL Open Font License,
108
+ Version 1.1.
109
+
110
+ This license is copied below, and is also available with a FAQ at:
111
+ http://scripts.sil.org/OFL
112
+
113
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
114
+
115
+ PREAMBLE The goals of the Open Font License (OFL) are to stimulate
116
+ worldwide development of collaborative font projects, to support the font
117
+ creation efforts of academic and linguistic communities, and to provide
118
+ a free and open framework in which fonts may be shared and improved in
119
+ partnership with others.
120
+
121
+ The OFL allows the licensed fonts to be used, studied, modified and
122
+ redistributed freely as long as they are not sold by themselves.
123
+ The fonts, including any derivative works, can be bundled, embedded,
124
+ redistributed and/or sold with any software provided that any reserved
125
+ names are not used by derivative works. The fonts and derivatives,
126
+ however, cannot be released under any other type of license. The
127
+ requirement for fonts to remain under this license does not apply to
128
+ any document created using the fonts or their derivatives.
129
+
130
+
131
+
132
+ DEFINITIONS
133
+ "Font Software" refers to the set of files released by the Copyright
134
+ Holder(s) under this license and clearly marked as such.
135
+ This may include source files, build scripts and documentation.
136
+
137
+ "Reserved Font Name" refers to any names specified as such after the
138
+ copyright statement(s).
139
+
140
+ "Original Version" refers to the collection of Font Software components
141
+ as distributed by the Copyright Holder(s).
142
+
143
+ "Modified Version" refers to any derivative made by adding to, deleting,
144
+ or substituting ? in part or in whole ?
145
+ any of the components of the Original Version, by changing formats or
146
+ by porting the Font Software to a new environment.
147
+
148
+ "Author" refers to any designer, engineer, programmer, technical writer
149
+ or other person who contributed to the Font Software.
150
+
151
+
152
+ PERMISSION & CONDITIONS
153
+
154
+ Permission is hereby granted, free of charge, to any person obtaining a
155
+ copy of the Font Software, to use, study, copy, merge, embed, modify,
156
+ redistribute, and sell modified and unmodified copies of the Font
157
+ Software, subject to the following conditions:
158
+
159
+ 1) Neither the Font Software nor any of its individual components,in
160
+ Original or Modified Versions, may be sold by itself.
161
+
162
+ 2) Original or Modified Versions of the Font Software may be bundled,
163
+ redistributed and/or sold with any software, provided that each copy
164
+ contains the above copyright notice and this license. These can be
165
+ included either as stand-alone text files, human-readable headers or
166
+ in the appropriate machine-readable metadata fields within text or
167
+ binary files as long as those fields can be easily viewed by the user.
168
+
169
+ 3) No Modified Version of the Font Software may use the Reserved Font
170
+ Name(s) unless explicit written permission is granted by the
171
+ corresponding Copyright Holder. This restriction only applies to the
172
+ primary font name as presented to the users.
173
+
174
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
175
+ Software shall not be used to promote, endorse or advertise any
176
+ Modified Version, except to acknowledge the contribution(s) of the
177
+ Copyright Holder(s) and the Author(s) or with their explicit written
178
+ permission.
179
+
180
+ 5) The Font Software, modified or unmodified, in part or in whole, must
181
+ be distributed entirely under this license, and must not be distributed
182
+ under any other license. The requirement for fonts to remain under
183
+ this license does not apply to any document created using the Font
184
+ Software.
185
+
186
+
187
+
188
+ TERMINATION
189
+ This license becomes null and void if any of the above conditions are not met.
190
+
191
+
192
+
193
+ DISCLAIMER
194
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
195
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
196
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
197
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
198
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
199
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
200
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
201
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER
202
+ DEALINGS IN THE FONT SOFTWARE.
203
+
204
+
205
+ --------------------------------------------------------------------------------
206
+ Pyodide (version 0.29.4)
207
+ https://pyodide.org - https://github.com/pyodide/pyodide
208
+
209
+ NOT included in this package. Pages written by `pymations build`, and pages
210
+ that use the browser half on their own, load Pyodide at run time from its
211
+ official CDN:
212
+ https://cdn.jsdelivr.net/pyodide/v0.29.4/full/
213
+
214
+ Licence: Mozilla Public License 2.0 (https://mozilla.org/MPL/2.0/).
215
+ Pyodide includes CPython (Python Software Foundation License) and the
216
+ packages it distributes each carry their own licence; see
217
+ https://pyodide.org/en/stable/project/about.html and the files on the CDN.