pymations 0.0.0-stage → 0.2.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 (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +24 -2
  3. package/THIRD-PARTY-NOTICES +240 -0
  4. package/engine/LICENSE-polygon-clipping.txt +11 -0
  5. package/engine/anim.js +9 -0
  6. package/engine/fonts/KaTeX_AMS-Regular.ttf +0 -0
  7. package/engine/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  8. package/engine/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  9. package/engine/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  10. package/engine/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  11. package/engine/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  12. package/engine/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  13. package/engine/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  14. package/engine/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  15. package/engine/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  16. package/engine/fonts/KaTeX_Main-Bold.ttf +0 -0
  17. package/engine/fonts/KaTeX_Main-Bold.woff2 +0 -0
  18. package/engine/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  19. package/engine/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  20. package/engine/fonts/KaTeX_Main-Italic.ttf +0 -0
  21. package/engine/fonts/KaTeX_Main-Italic.woff2 +0 -0
  22. package/engine/fonts/KaTeX_Main-Regular.ttf +0 -0
  23. package/engine/fonts/KaTeX_Main-Regular.woff2 +0 -0
  24. package/engine/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  25. package/engine/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  26. package/engine/fonts/KaTeX_Math-Italic.ttf +0 -0
  27. package/engine/fonts/KaTeX_Math-Italic.woff2 +0 -0
  28. package/engine/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  29. package/engine/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  30. package/engine/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  31. package/engine/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  32. package/engine/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  33. package/engine/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  34. package/engine/fonts/KaTeX_Script-Regular.ttf +0 -0
  35. package/engine/fonts/KaTeX_Script-Regular.woff2 +0 -0
  36. package/engine/fonts/KaTeX_Size1-Regular.ttf +0 -0
  37. package/engine/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  38. package/engine/fonts/KaTeX_Size2-Regular.ttf +0 -0
  39. package/engine/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  40. package/engine/fonts/KaTeX_Size3-Regular.ttf +0 -0
  41. package/engine/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  42. package/engine/fonts/KaTeX_Size4-Regular.ttf +0 -0
  43. package/engine/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  44. package/engine/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  45. package/engine/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  46. package/engine/fonts/LICENSE_KATEX_FONTS.txt +106 -0
  47. package/engine/fonts/LICENSE_LIBERATION.txt +102 -0
  48. package/engine/fonts/LiberationSans-Bold.ttf +0 -0
  49. package/engine/fonts/LiberationSans-BoldItalic.ttf +0 -0
  50. package/engine/fonts/LiberationSans-Italic.ttf +0 -0
  51. package/engine/fonts/LiberationSans-Regular.ttf +0 -0
  52. package/engine/katex.min.css +1 -0
  53. package/engine/katex.min.js +1 -0
  54. package/engine/manifest.json +1 -0
  55. package/engine/opentype.min.js +2 -0
  56. package/package.json +34 -4
  57. package/pyctures.py +897 -0
  58. package/pymations.js +1818 -0
  59. package/pymations.py +5113 -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.2.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,240 @@
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
+ polygon-clipping (version 0.15.7)
91
+ https://github.com/mfogel/polygon-clipping
92
+
93
+ Included in this package inside:
94
+ src/pymations/web/engine/anim.js (bundled; it works out Boolean shapes:
95
+ Union, Intersection, Difference, Exclusion)
96
+ src/pymations/web/engine/LICENSE-polygon-clipping.txt (this licence)
97
+
98
+ Licence: MIT
99
+
100
+ The MIT License (MIT)
101
+
102
+ Copyright (c) 2018 Mike Fogel <mike@fogel.ca> - covers everything not specially attributed to others below.
103
+
104
+ Copyright (c) 2016 Alexander Milevski <info@w8r.name> - covers all portions originally part of github:w8r/martinez, from which this project was forked on Febuary 2, 2018.
105
+
106
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
107
+
108
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
109
+
110
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
111
+
112
+ --------------------------------------------------------------------------------
113
+ Liberation Sans (version 2, as distributed with pdf.js 5.4)
114
+ https://github.com/liberationfonts/liberation-fonts
115
+
116
+ Included in this package as:
117
+ src/pymations/web/engine/fonts/LiberationSans-Regular.ttf
118
+ src/pymations/web/engine/fonts/LiberationSans-Bold.ttf
119
+ src/pymations/web/engine/fonts/LiberationSans-Italic.ttf
120
+ src/pymations/web/engine/fonts/LiberationSans-BoldItalic.ttf
121
+ src/pymations/web/engine/fonts/LICENSE_LIBERATION.txt (this licence)
122
+
123
+ Licence: SIL Open Font License 1.1
124
+
125
+ Digitized data copyright (c) 2010 Google Corporation
126
+ with Reserved Font Arimo, Tinos and Cousine.
127
+ Copyright (c) 2012 Red Hat, Inc.
128
+ with Reserved Font Name Liberation.
129
+
130
+ This Font Software is licensed under the SIL Open Font License,
131
+ Version 1.1.
132
+
133
+ This license is copied below, and is also available with a FAQ at:
134
+ http://scripts.sil.org/OFL
135
+
136
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
137
+
138
+ PREAMBLE The goals of the Open Font License (OFL) are to stimulate
139
+ worldwide development of collaborative font projects, to support the font
140
+ creation efforts of academic and linguistic communities, and to provide
141
+ a free and open framework in which fonts may be shared and improved in
142
+ partnership with others.
143
+
144
+ The OFL allows the licensed fonts to be used, studied, modified and
145
+ redistributed freely as long as they are not sold by themselves.
146
+ The fonts, including any derivative works, can be bundled, embedded,
147
+ redistributed and/or sold with any software provided that any reserved
148
+ names are not used by derivative works. The fonts and derivatives,
149
+ however, cannot be released under any other type of license. The
150
+ requirement for fonts to remain under this license does not apply to
151
+ any document created using the fonts or their derivatives.
152
+
153
+
154
+
155
+ DEFINITIONS
156
+ "Font Software" refers to the set of files released by the Copyright
157
+ Holder(s) under this license and clearly marked as such.
158
+ This may include source files, build scripts and documentation.
159
+
160
+ "Reserved Font Name" refers to any names specified as such after the
161
+ copyright statement(s).
162
+
163
+ "Original Version" refers to the collection of Font Software components
164
+ as distributed by the Copyright Holder(s).
165
+
166
+ "Modified Version" refers to any derivative made by adding to, deleting,
167
+ or substituting ? in part or in whole ?
168
+ any of the components of the Original Version, by changing formats or
169
+ by porting the Font Software to a new environment.
170
+
171
+ "Author" refers to any designer, engineer, programmer, technical writer
172
+ or other person who contributed to the Font Software.
173
+
174
+
175
+ PERMISSION & CONDITIONS
176
+
177
+ Permission is hereby granted, free of charge, to any person obtaining a
178
+ copy of the Font Software, to use, study, copy, merge, embed, modify,
179
+ redistribute, and sell modified and unmodified copies of the Font
180
+ Software, subject to the following conditions:
181
+
182
+ 1) Neither the Font Software nor any of its individual components,in
183
+ Original or Modified Versions, may be sold by itself.
184
+
185
+ 2) Original or Modified Versions of the Font Software may be bundled,
186
+ redistributed and/or sold with any software, provided that each copy
187
+ contains the above copyright notice and this license. These can be
188
+ included either as stand-alone text files, human-readable headers or
189
+ in the appropriate machine-readable metadata fields within text or
190
+ binary files as long as those fields can be easily viewed by the user.
191
+
192
+ 3) No Modified Version of the Font Software may use the Reserved Font
193
+ Name(s) unless explicit written permission is granted by the
194
+ corresponding Copyright Holder. This restriction only applies to the
195
+ primary font name as presented to the users.
196
+
197
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
198
+ Software shall not be used to promote, endorse or advertise any
199
+ Modified Version, except to acknowledge the contribution(s) of the
200
+ Copyright Holder(s) and the Author(s) or with their explicit written
201
+ permission.
202
+
203
+ 5) The Font Software, modified or unmodified, in part or in whole, must
204
+ be distributed entirely under this license, and must not be distributed
205
+ under any other license. The requirement for fonts to remain under
206
+ this license does not apply to any document created using the Font
207
+ Software.
208
+
209
+
210
+
211
+ TERMINATION
212
+ This license becomes null and void if any of the above conditions are not met.
213
+
214
+
215
+
216
+ DISCLAIMER
217
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
218
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
219
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
220
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
221
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
222
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
223
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
224
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER
225
+ DEALINGS IN THE FONT SOFTWARE.
226
+
227
+
228
+ --------------------------------------------------------------------------------
229
+ Pyodide (version 0.29.4)
230
+ https://pyodide.org - https://github.com/pyodide/pyodide
231
+
232
+ NOT included in this package. Pages written by `pymations build`, and pages
233
+ that use the browser half on their own, load Pyodide at run time from its
234
+ official CDN:
235
+ https://cdn.jsdelivr.net/pyodide/v0.29.4/full/
236
+
237
+ Licence: Mozilla Public License 2.0 (https://mozilla.org/MPL/2.0/).
238
+ Pyodide includes CPython (Python Software Foundation License) and the
239
+ packages it distributes each carry their own licence; see
240
+ https://pyodide.org/en/stable/project/about.html and the files on the CDN.
@@ -0,0 +1,11 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Mike Fogel <mike@fogel.ca> - covers everything not specially attributed to others below.
4
+
5
+ Copyright (c) 2016 Alexander Milevski <info@w8r.name> - covers all portions originally part of github:w8r/martinez, from which this project was forked on Febuary 2, 2018.
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+
9
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.