manim-web 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.
- package/LICENSE +21 -0
- package/README.md +109 -0
- package/dist/animation/Animation.d.ts +69 -0
- package/dist/animation/Animation.d.ts.map +1 -0
- package/dist/animation/AnimationGroup.d.ts +48 -0
- package/dist/animation/AnimationGroup.d.ts.map +1 -0
- package/dist/animation/LaggedStart.d.ts +25 -0
- package/dist/animation/LaggedStart.d.ts.map +1 -0
- package/dist/animation/MaintainPositionRelativeTo.d.ts +23 -0
- package/dist/animation/MaintainPositionRelativeTo.d.ts.map +1 -0
- package/dist/animation/Succession.d.ts +19 -0
- package/dist/animation/Succession.d.ts.map +1 -0
- package/dist/animation/Timeline.d.ts +89 -0
- package/dist/animation/Timeline.d.ts.map +1 -0
- package/dist/animation/UpdateFromAlphaFunc.d.ts +32 -0
- package/dist/animation/UpdateFromAlphaFunc.d.ts.map +1 -0
- package/dist/animation/UpdateFromFunc.d.ts +30 -0
- package/dist/animation/UpdateFromFunc.d.ts.map +1 -0
- package/dist/animation/changing/index.d.ts +213 -0
- package/dist/animation/changing/index.d.ts.map +1 -0
- package/dist/animation/composition/LaggedStartMap.d.ts +47 -0
- package/dist/animation/composition/LaggedStartMap.d.ts.map +1 -0
- package/dist/animation/composition/index.d.ts +5 -0
- package/dist/animation/composition/index.d.ts.map +1 -0
- package/dist/animation/creation/Create.d.ts +232 -0
- package/dist/animation/creation/Create.d.ts.map +1 -0
- package/dist/animation/creation/CreationExtensions.d.ts +127 -0
- package/dist/animation/creation/CreationExtensions.d.ts.map +1 -0
- package/dist/animation/creation/TypeWithCursor.d.ts +133 -0
- package/dist/animation/creation/TypeWithCursor.d.ts.map +1 -0
- package/dist/animation/creation/index.d.ts +4 -0
- package/dist/animation/creation/index.d.ts.map +1 -0
- package/dist/animation/fading/FadeIn.d.ts +31 -0
- package/dist/animation/fading/FadeIn.d.ts.map +1 -0
- package/dist/animation/fading/FadeOut.d.ts +32 -0
- package/dist/animation/fading/FadeOut.d.ts.map +1 -0
- package/dist/animation/fading/index.d.ts +3 -0
- package/dist/animation/fading/index.d.ts.map +1 -0
- package/dist/animation/growing/index.d.ts +103 -0
- package/dist/animation/growing/index.d.ts.map +1 -0
- package/dist/animation/index.d.ts +20 -0
- package/dist/animation/index.d.ts.map +1 -0
- package/dist/animation/indication/ApplyWave.d.ts +51 -0
- package/dist/animation/indication/ApplyWave.d.ts.map +1 -0
- package/dist/animation/indication/Blink.d.ts +34 -0
- package/dist/animation/indication/Blink.d.ts.map +1 -0
- package/dist/animation/indication/Circumscribe.d.ts +54 -0
- package/dist/animation/indication/Circumscribe.d.ts.map +1 -0
- package/dist/animation/indication/Flash.d.ts +45 -0
- package/dist/animation/indication/Flash.d.ts.map +1 -0
- package/dist/animation/indication/FocusOn.d.ts +79 -0
- package/dist/animation/indication/FocusOn.d.ts.map +1 -0
- package/dist/animation/indication/Indicate.d.ts +30 -0
- package/dist/animation/indication/Indicate.d.ts.map +1 -0
- package/dist/animation/indication/ShowCreationThenDestruction.d.ts +26 -0
- package/dist/animation/indication/ShowCreationThenDestruction.d.ts.map +1 -0
- package/dist/animation/indication/ShowPassingFlash.d.ts +47 -0
- package/dist/animation/indication/ShowPassingFlash.d.ts.map +1 -0
- package/dist/animation/indication/ShowPassingFlashWithThinningStrokeWidth.d.ts +21 -0
- package/dist/animation/indication/ShowPassingFlashWithThinningStrokeWidth.d.ts.map +1 -0
- package/dist/animation/indication/Wiggle.d.ts +48 -0
- package/dist/animation/indication/Wiggle.d.ts.map +1 -0
- package/dist/animation/indication/WiggleOutThenIn.d.ts +44 -0
- package/dist/animation/indication/WiggleOutThenIn.d.ts.map +1 -0
- package/dist/animation/indication/index.d.ts +20 -0
- package/dist/animation/indication/index.d.ts.map +1 -0
- package/dist/animation/movement/Homotopy.d.ts +204 -0
- package/dist/animation/movement/Homotopy.d.ts.map +1 -0
- package/dist/animation/movement/MoveAlongPath.d.ts +48 -0
- package/dist/animation/movement/MoveAlongPath.d.ts.map +1 -0
- package/dist/animation/movement/Rotate.d.ts +47 -0
- package/dist/animation/movement/Rotate.d.ts.map +1 -0
- package/dist/animation/movement/Scale.d.ts +74 -0
- package/dist/animation/movement/Scale.d.ts.map +1 -0
- package/dist/animation/movement/Shift.d.ts +74 -0
- package/dist/animation/movement/Shift.d.ts.map +1 -0
- package/dist/animation/movement/index.d.ts +6 -0
- package/dist/animation/movement/index.d.ts.map +1 -0
- package/dist/animation/numbers/index.d.ts +152 -0
- package/dist/animation/numbers/index.d.ts.map +1 -0
- package/dist/animation/speed/index.d.ts +114 -0
- package/dist/animation/speed/index.d.ts.map +1 -0
- package/dist/animation/transform/ApplyPointwiseFunction.d.ts +23 -0
- package/dist/animation/transform/ApplyPointwiseFunction.d.ts.map +1 -0
- package/dist/animation/transform/Transform.d.ts +89 -0
- package/dist/animation/transform/Transform.d.ts.map +1 -0
- package/dist/animation/transform/TransformExtensions.d.ts +444 -0
- package/dist/animation/transform/TransformExtensions.d.ts.map +1 -0
- package/dist/animation/transform/TransformMatching.d.ts +138 -0
- package/dist/animation/transform/TransformMatching.d.ts.map +1 -0
- package/dist/animation/transform/index.d.ts +5 -0
- package/dist/animation/transform/index.d.ts.map +1 -0
- package/dist/animation/utility/index.d.ts +171 -0
- package/dist/animation/utility/index.d.ts.map +1 -0
- package/dist/constants/colors.d.ts +72 -0
- package/dist/constants/colors.d.ts.map +1 -0
- package/dist/constants/colors.test.d.ts +2 -0
- package/dist/constants/colors.test.d.ts.map +1 -0
- package/dist/constants/directions.test.d.ts +2 -0
- package/dist/constants/directions.test.d.ts.map +1 -0
- package/dist/constants/index.d.ts +16 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/core/AudioManager.d.ts +203 -0
- package/dist/core/AudioManager.d.ts.map +1 -0
- package/dist/core/Camera.d.ts +172 -0
- package/dist/core/Camera.d.ts.map +1 -0
- package/dist/core/Camera2DFrame.d.ts +31 -0
- package/dist/core/Camera2DFrame.d.ts.map +1 -0
- package/dist/core/CameraExtensions.d.ts +420 -0
- package/dist/core/CameraExtensions.d.ts.map +1 -0
- package/dist/core/CameraFrame.d.ts +178 -0
- package/dist/core/CameraFrame.d.ts.map +1 -0
- package/dist/core/Group.d.ts +139 -0
- package/dist/core/Group.d.ts.map +1 -0
- package/dist/core/InteractiveScene.d.ts +122 -0
- package/dist/core/InteractiveScene.d.ts.map +1 -0
- package/dist/core/Lighting.d.ts +128 -0
- package/dist/core/Lighting.d.ts.map +1 -0
- package/dist/core/Mobject.d.ts +488 -0
- package/dist/core/Mobject.d.ts.map +1 -0
- package/dist/core/Renderer.d.ts +84 -0
- package/dist/core/Renderer.d.ts.map +1 -0
- package/dist/core/Scene.d.ts +353 -0
- package/dist/core/Scene.d.ts.map +1 -0
- package/dist/core/SceneExtensions.d.ts +640 -0
- package/dist/core/SceneExtensions.d.ts.map +1 -0
- package/dist/core/SceneExtensions.test.d.ts +2 -0
- package/dist/core/SceneExtensions.test.d.ts.map +1 -0
- package/dist/core/StateManager.d.ts +193 -0
- package/dist/core/StateManager.d.ts.map +1 -0
- package/dist/core/VDict.d.ts +229 -0
- package/dist/core/VDict.d.ts.map +1 -0
- package/dist/core/VGroup.d.ts +200 -0
- package/dist/core/VGroup.d.ts.map +1 -0
- package/dist/core/VMobject.d.ts +419 -0
- package/dist/core/VMobject.d.ts.map +1 -0
- package/dist/core/index.d.ts +16 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/examples.test.d.ts +2 -0
- package/dist/examples.test.d.ts.map +1 -0
- package/dist/export/GifExporter.d.ts +40 -0
- package/dist/export/GifExporter.d.ts.map +1 -0
- package/dist/export/VideoExporter.d.ts +135 -0
- package/dist/export/VideoExporter.d.ts.map +1 -0
- package/dist/export/index.d.ts +3 -0
- package/dist/export/index.d.ts.map +1 -0
- package/dist/index.d.ts +65 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49064 -0
- package/dist/integrations/index.d.ts +1 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/react.d.ts +144 -0
- package/dist/integrations/react.d.ts.map +1 -0
- package/dist/integrations/react.js +570 -0
- package/dist/integrations/vue.d.ts +249 -0
- package/dist/integrations/vue.d.ts.map +1 -0
- package/dist/integrations/vue.js +560 -0
- package/dist/interaction/Clickable.d.ts +71 -0
- package/dist/interaction/Clickable.d.ts.map +1 -0
- package/dist/interaction/Controls.d.ts +174 -0
- package/dist/interaction/Controls.d.ts.map +1 -0
- package/dist/interaction/Draggable.d.ts +88 -0
- package/dist/interaction/Draggable.d.ts.map +1 -0
- package/dist/interaction/Hoverable.d.ts +82 -0
- package/dist/interaction/Hoverable.d.ts.map +1 -0
- package/dist/interaction/OrbitControls.d.ts +139 -0
- package/dist/interaction/OrbitControls.d.ts.map +1 -0
- package/dist/interaction/PlaybackControls.d.ts +113 -0
- package/dist/interaction/PlaybackControls.d.ts.map +1 -0
- package/dist/interaction/SelectionManager.d.ts +125 -0
- package/dist/interaction/SelectionManager.d.ts.map +1 -0
- package/dist/interaction/index.d.ts +12 -0
- package/dist/interaction/index.d.ts.map +1 -0
- package/dist/mobjects/fractals/MandelbrotSet.d.ts +92 -0
- package/dist/mobjects/fractals/MandelbrotSet.d.ts.map +1 -0
- package/dist/mobjects/fractals/NewtonFractal.d.ts +121 -0
- package/dist/mobjects/fractals/NewtonFractal.d.ts.map +1 -0
- package/dist/mobjects/fractals/index.d.ts +3 -0
- package/dist/mobjects/fractals/index.d.ts.map +1 -0
- package/dist/mobjects/frame/index.d.ts +188 -0
- package/dist/mobjects/frame/index.d.ts.map +1 -0
- package/dist/mobjects/geometry/AngleShapes.d.ts +326 -0
- package/dist/mobjects/geometry/AngleShapes.d.ts.map +1 -0
- package/dist/mobjects/geometry/Arc.d.ts +111 -0
- package/dist/mobjects/geometry/Arc.d.ts.map +1 -0
- package/dist/mobjects/geometry/ArcBetweenPoints.d.ts +68 -0
- package/dist/mobjects/geometry/ArcBetweenPoints.d.ts.map +1 -0
- package/dist/mobjects/geometry/ArcShapes.d.ts +659 -0
- package/dist/mobjects/geometry/ArcShapes.d.ts.map +1 -0
- package/dist/mobjects/geometry/Arrow.d.ts +130 -0
- package/dist/mobjects/geometry/Arrow.d.ts.map +1 -0
- package/dist/mobjects/geometry/ArrowTips.d.ts +238 -0
- package/dist/mobjects/geometry/ArrowTips.d.ts.map +1 -0
- package/dist/mobjects/geometry/BooleanOperations.d.ts +163 -0
- package/dist/mobjects/geometry/BooleanOperations.d.ts.map +1 -0
- package/dist/mobjects/geometry/Circle.d.ts +92 -0
- package/dist/mobjects/geometry/Circle.d.ts.map +1 -0
- package/dist/mobjects/geometry/CubicBezier.d.ts +126 -0
- package/dist/mobjects/geometry/CubicBezier.d.ts.map +1 -0
- package/dist/mobjects/geometry/DashedLine.d.ts +109 -0
- package/dist/mobjects/geometry/DashedLine.d.ts.map +1 -0
- package/dist/mobjects/geometry/DashedVMobject.d.ts +96 -0
- package/dist/mobjects/geometry/DashedVMobject.d.ts.map +1 -0
- package/dist/mobjects/geometry/Dot.d.ts +100 -0
- package/dist/mobjects/geometry/Dot.d.ts.map +1 -0
- package/dist/mobjects/geometry/LabeledGeometry.d.ts +372 -0
- package/dist/mobjects/geometry/LabeledGeometry.d.ts.map +1 -0
- package/dist/mobjects/geometry/Line.d.ts +83 -0
- package/dist/mobjects/geometry/Line.d.ts.map +1 -0
- package/dist/mobjects/geometry/Polygon.d.ts +155 -0
- package/dist/mobjects/geometry/Polygon.d.ts.map +1 -0
- package/dist/mobjects/geometry/PolygonExtensions.d.ts +412 -0
- package/dist/mobjects/geometry/PolygonExtensions.d.ts.map +1 -0
- package/dist/mobjects/geometry/Rectangle.d.ts +123 -0
- package/dist/mobjects/geometry/Rectangle.d.ts.map +1 -0
- package/dist/mobjects/geometry/ShapeMatchers.d.ts +252 -0
- package/dist/mobjects/geometry/ShapeMatchers.d.ts.map +1 -0
- package/dist/mobjects/geometry/index.d.ts +25 -0
- package/dist/mobjects/geometry/index.d.ts.map +1 -0
- package/dist/mobjects/graph/index.d.ts +425 -0
- package/dist/mobjects/graph/index.d.ts.map +1 -0
- package/dist/mobjects/graphing/Axes.d.ts +254 -0
- package/dist/mobjects/graphing/Axes.d.ts.map +1 -0
- package/dist/mobjects/graphing/BarChart.d.ts +241 -0
- package/dist/mobjects/graphing/BarChart.d.ts.map +1 -0
- package/dist/mobjects/graphing/ComplexPlane.d.ts +311 -0
- package/dist/mobjects/graphing/ComplexPlane.d.ts.map +1 -0
- package/dist/mobjects/graphing/FunctionGraph.d.ts +123 -0
- package/dist/mobjects/graphing/FunctionGraph.d.ts.map +1 -0
- package/dist/mobjects/graphing/ImplicitFunction.d.ts +131 -0
- package/dist/mobjects/graphing/ImplicitFunction.d.ts.map +1 -0
- package/dist/mobjects/graphing/NumberLine.d.ts +195 -0
- package/dist/mobjects/graphing/NumberLine.d.ts.map +1 -0
- package/dist/mobjects/graphing/NumberPlane.d.ts +91 -0
- package/dist/mobjects/graphing/NumberPlane.d.ts.map +1 -0
- package/dist/mobjects/graphing/ParametricFunction.d.ts +111 -0
- package/dist/mobjects/graphing/ParametricFunction.d.ts.map +1 -0
- package/dist/mobjects/graphing/Vector.d.ts +121 -0
- package/dist/mobjects/graphing/Vector.d.ts.map +1 -0
- package/dist/mobjects/graphing/VectorField.d.ts +321 -0
- package/dist/mobjects/graphing/VectorField.d.ts.map +1 -0
- package/dist/mobjects/graphing/index.d.ts +18 -0
- package/dist/mobjects/graphing/index.d.ts.map +1 -0
- package/dist/mobjects/image/index.d.ts +223 -0
- package/dist/mobjects/image/index.d.ts.map +1 -0
- package/dist/mobjects/matrix/Matrix.d.ts +260 -0
- package/dist/mobjects/matrix/Matrix.d.ts.map +1 -0
- package/dist/mobjects/matrix/index.d.ts +8 -0
- package/dist/mobjects/matrix/index.d.ts.map +1 -0
- package/dist/mobjects/point/index.d.ts +707 -0
- package/dist/mobjects/point/index.d.ts.map +1 -0
- package/dist/mobjects/probability/DiceFace.d.ts +137 -0
- package/dist/mobjects/probability/DiceFace.d.ts.map +1 -0
- package/dist/mobjects/probability/SampleSpace.d.ts +267 -0
- package/dist/mobjects/probability/SampleSpace.d.ts.map +1 -0
- package/dist/mobjects/probability/index.d.ts +9 -0
- package/dist/mobjects/probability/index.d.ts.map +1 -0
- package/dist/mobjects/svg/Brace.d.ts +308 -0
- package/dist/mobjects/svg/Brace.d.ts.map +1 -0
- package/dist/mobjects/svg/SVGMobject.d.ts +64 -0
- package/dist/mobjects/svg/SVGMobject.d.ts.map +1 -0
- package/dist/mobjects/svg/index.d.ts +10 -0
- package/dist/mobjects/svg/index.d.ts.map +1 -0
- package/dist/mobjects/table/Table.d.ts +315 -0
- package/dist/mobjects/table/Table.d.ts.map +1 -0
- package/dist/mobjects/table/index.d.ts +8 -0
- package/dist/mobjects/table/index.d.ts.map +1 -0
- package/dist/mobjects/text/Code.d.ts +244 -0
- package/dist/mobjects/text/Code.d.ts.map +1 -0
- package/dist/mobjects/text/DecimalNumber.d.ts +199 -0
- package/dist/mobjects/text/DecimalNumber.d.ts.map +1 -0
- package/dist/mobjects/text/GlyphVMobject.d.ts +76 -0
- package/dist/mobjects/text/GlyphVMobject.d.ts.map +1 -0
- package/dist/mobjects/text/MarkupText.d.ts +161 -0
- package/dist/mobjects/text/MarkupText.d.ts.map +1 -0
- package/dist/mobjects/text/MathJaxRenderer.d.ts +49 -0
- package/dist/mobjects/text/MathJaxRenderer.d.ts.map +1 -0
- package/dist/mobjects/text/MathTex.d.ts +242 -0
- package/dist/mobjects/text/MathTex.d.ts.map +1 -0
- package/dist/mobjects/text/Paragraph.d.ts +86 -0
- package/dist/mobjects/text/Paragraph.d.ts.map +1 -0
- package/dist/mobjects/text/Tex.d.ts +40 -0
- package/dist/mobjects/text/Tex.d.ts.map +1 -0
- package/dist/mobjects/text/Text.d.ts +171 -0
- package/dist/mobjects/text/Text.d.ts.map +1 -0
- package/dist/mobjects/text/TextExtensions.d.ts +383 -0
- package/dist/mobjects/text/TextExtensions.d.ts.map +1 -0
- package/dist/mobjects/text/TextGlyphGroup.d.ts +48 -0
- package/dist/mobjects/text/TextGlyphGroup.d.ts.map +1 -0
- package/dist/mobjects/text/Variable.d.ts +160 -0
- package/dist/mobjects/text/Variable.d.ts.map +1 -0
- package/dist/mobjects/text/index.d.ts +21 -0
- package/dist/mobjects/text/index.d.ts.map +1 -0
- package/dist/mobjects/text/katex-styles.d.ts +23 -0
- package/dist/mobjects/text/katex-styles.d.ts.map +1 -0
- package/dist/mobjects/text/svgPathParser.d.ts +39 -0
- package/dist/mobjects/text/svgPathParser.d.ts.map +1 -0
- package/dist/mobjects/three-d/Arrow3D.d.ts +136 -0
- package/dist/mobjects/three-d/Arrow3D.d.ts.map +1 -0
- package/dist/mobjects/three-d/Cube.d.ts +186 -0
- package/dist/mobjects/three-d/Cube.d.ts.map +1 -0
- package/dist/mobjects/three-d/Cylinder.d.ts +189 -0
- package/dist/mobjects/three-d/Cylinder.d.ts.map +1 -0
- package/dist/mobjects/three-d/Line3D.d.ts +100 -0
- package/dist/mobjects/three-d/Line3D.d.ts.map +1 -0
- package/dist/mobjects/three-d/ParametricSurface.d.ts +86 -0
- package/dist/mobjects/three-d/ParametricSurface.d.ts.map +1 -0
- package/dist/mobjects/three-d/Polyhedra.d.ts +271 -0
- package/dist/mobjects/three-d/Polyhedra.d.ts.map +1 -0
- package/dist/mobjects/three-d/Sphere.d.ts +100 -0
- package/dist/mobjects/three-d/Sphere.d.ts.map +1 -0
- package/dist/mobjects/three-d/Surface3D.d.ts +156 -0
- package/dist/mobjects/three-d/Surface3D.d.ts.map +1 -0
- package/dist/mobjects/three-d/TexturedSurface.d.ts +208 -0
- package/dist/mobjects/three-d/TexturedSurface.d.ts.map +1 -0
- package/dist/mobjects/three-d/ThreeDAxes.d.ts +172 -0
- package/dist/mobjects/three-d/ThreeDAxes.d.ts.map +1 -0
- package/dist/mobjects/three-d/ThreeDExtensions.d.ts +335 -0
- package/dist/mobjects/three-d/ThreeDExtensions.d.ts.map +1 -0
- package/dist/mobjects/three-d/Torus.d.ts +123 -0
- package/dist/mobjects/three-d/Torus.d.ts.map +1 -0
- package/dist/mobjects/three-d/index.d.ts +19 -0
- package/dist/mobjects/three-d/index.d.ts.map +1 -0
- package/dist/mobjects/value-tracker/ValueTracker.d.ts +248 -0
- package/dist/mobjects/value-tracker/ValueTracker.d.ts.map +1 -0
- package/dist/mobjects/value-tracker/index.d.ts +9 -0
- package/dist/mobjects/value-tracker/index.d.ts.map +1 -0
- package/dist/rate-functions/index.d.ts +81 -0
- package/dist/rate-functions/index.d.ts.map +1 -0
- package/dist/rate-functions/rateFunctions.test.d.ts +2 -0
- package/dist/rate-functions/rateFunctions.test.d.ts.map +1 -0
- package/dist/rendering/BezierRenderer.d.ts +112 -0
- package/dist/rendering/BezierRenderer.d.ts.map +1 -0
- package/dist/rendering/BezierShaderMaterial.d.ts +50 -0
- package/dist/rendering/BezierShaderMaterial.d.ts.map +1 -0
- package/dist/rendering/index.d.ts +10 -0
- package/dist/rendering/index.d.ts.map +1 -0
- package/dist/utils/Performance.d.ts +118 -0
- package/dist/utils/Performance.d.ts.map +1 -0
- package/dist/utils/featureFlags.d.ts +15 -0
- package/dist/utils/featureFlags.d.ts.map +1 -0
- package/dist/utils/hungarian.d.ts +66 -0
- package/dist/utils/hungarian.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +14 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/math.d.ts +52 -0
- package/dist/utils/math.d.ts.map +1 -0
- package/dist/utils/ode.d.ts +135 -0
- package/dist/utils/ode.d.ts.map +1 -0
- package/dist/utils/skeletonize.d.ts +35 -0
- package/dist/utils/skeletonize.d.ts.map +1 -0
- package/dist/utils/triangulate.d.ts +54 -0
- package/dist/utils/triangulate.d.ts.map +1 -0
- package/dist/utils/vectors.d.ts +57 -0
- package/dist/utils/vectors.d.ts.map +1 -0
- package/package.json +122 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Narek Maloyan
|
|
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
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# manim-web
|
|
4
|
+
|
|
5
|
+
**Mathematical animations for the web.**
|
|
6
|
+
|
|
7
|
+
The power of [3Blue1Brown's Manim](https://github.com/3b1b/manim) — in the browser, no Python required.
|
|
8
|
+
|
|
9
|
+
<img src="assets/demo_square_to_circle.gif" width="600" alt="Square to Circle demo">
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/manim-web)
|
|
12
|
+
[](https://github.com/maloyan/manim-web/actions/workflows/ci.yml)
|
|
13
|
+
[](LICENSE)
|
|
14
|
+
|
|
15
|
+
[Quick Start](#quick-start) · [Examples](https://maloyan.github.io/manim-web/) · [Docs](https://maloyan.github.io/manim-web/) · [npm](https://www.npmjs.com/package/manim-web)
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install manim-web
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { Scene, Circle, Square, Create, Transform, FadeOut } from 'manim-web';
|
|
29
|
+
|
|
30
|
+
async function squareToCircle(scene: Scene) {
|
|
31
|
+
const square = new Square({ sideLength: 3 });
|
|
32
|
+
const circle = new Circle({ radius: 1.5 });
|
|
33
|
+
|
|
34
|
+
await scene.play(new Create(square));
|
|
35
|
+
await scene.play(new Transform(square, circle));
|
|
36
|
+
await scene.play(new FadeOut(square));
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Or use a plain `<script>` tag — see the [examples](https://maloyan.github.io/manim-web/) for more.
|
|
41
|
+
|
|
42
|
+
## What You Can Build
|
|
43
|
+
|
|
44
|
+
<table>
|
|
45
|
+
<tr>
|
|
46
|
+
<td align="center"><img src="assets/demo_function_graph.gif" width="350" alt="Function Graphs"><br><b>Function Graphs</b></td>
|
|
47
|
+
<td align="center"><img src="assets/demo_math_equations.gif" width="350" alt="LaTeX Equations"><br><b>LaTeX Equations</b></td>
|
|
48
|
+
</tr>
|
|
49
|
+
<tr>
|
|
50
|
+
<td align="center"><img src="assets/demo_text.gif" width="350" alt="Text Animations"><br><b>Text Animations</b></td>
|
|
51
|
+
<td align="center"><img src="assets/demo_square_to_circle.gif" width="350" alt="Geometry Transforms"><br><b>Geometry Transforms</b></td>
|
|
52
|
+
</tr>
|
|
53
|
+
</table>
|
|
54
|
+
|
|
55
|
+
## Features
|
|
56
|
+
|
|
57
|
+
- **Geometry** — Circle, Rectangle, Polygon, Arrow, Arc, Star, Brace, and more
|
|
58
|
+
- **Text & LaTeX** — Text, MathTex, Tex, Paragraph via KaTeX
|
|
59
|
+
- **Graphing** — Axes, NumberPlane, FunctionGraph, ParametricFunction, VectorField, BarChart
|
|
60
|
+
- **3D** — Sphere, Cube, Cylinder, Torus, Surface3D, ThreeDAxes with orbit controls
|
|
61
|
+
- **Animations** — FadeIn/Out, Create, Transform, Write, GrowFromCenter, AnimationGroup, LaggedStart
|
|
62
|
+
- **Interaction** — Draggable, Hoverable, Clickable mobjects
|
|
63
|
+
- **Export** — GIF and video export
|
|
64
|
+
- **Graphs & Tables** — Network graphs, Matrix, Table
|
|
65
|
+
|
|
66
|
+
## Framework Integrations
|
|
67
|
+
|
|
68
|
+
### React
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
import { ManimScene } from 'manim-web/react';
|
|
72
|
+
|
|
73
|
+
function App() {
|
|
74
|
+
return <ManimScene construct={squareToCircle} width={800} height={450} />;
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Vue
|
|
79
|
+
|
|
80
|
+
```vue
|
|
81
|
+
<script setup>
|
|
82
|
+
import { ManimScene } from 'manim-web/vue';
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<template>
|
|
86
|
+
<ManimScene :construct="squareToCircle" :width="800" :height="450" />
|
|
87
|
+
</template>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Python to TypeScript
|
|
91
|
+
|
|
92
|
+
Have existing Manim scripts? Convert them:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
node tools/py2ts.cjs input.py -o output.ts
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Contributing
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
git clone https://github.com/maloyan/manim-web.git
|
|
102
|
+
cd manim-web
|
|
103
|
+
npm install
|
|
104
|
+
npm run dev
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## License
|
|
108
|
+
|
|
109
|
+
MIT
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Mobject } from '../core/Mobject';
|
|
2
|
+
import { RateFunction } from '../rate-functions';
|
|
3
|
+
export type { RateFunction };
|
|
4
|
+
export interface AnimationOptions {
|
|
5
|
+
/** Duration of the animation in seconds (default: 1) */
|
|
6
|
+
duration?: number;
|
|
7
|
+
/** Rate function controlling the animation's pacing (default: smooth) */
|
|
8
|
+
rateFunc?: RateFunction;
|
|
9
|
+
/** Shift direction for fade animations */
|
|
10
|
+
shift?: [number, number, number];
|
|
11
|
+
}
|
|
12
|
+
export declare abstract class Animation {
|
|
13
|
+
/** The mobject being animated */
|
|
14
|
+
readonly mobject: Mobject;
|
|
15
|
+
/** Duration of the animation in seconds */
|
|
16
|
+
readonly duration: number;
|
|
17
|
+
/** Rate function controlling the animation's pacing */
|
|
18
|
+
readonly rateFunc: RateFunction;
|
|
19
|
+
/** Time when the animation started (set by Timeline) */
|
|
20
|
+
protected _startTime: number | null;
|
|
21
|
+
/** Whether the animation has finished */
|
|
22
|
+
protected _isFinished: boolean;
|
|
23
|
+
/** Track if begin() has been called */
|
|
24
|
+
protected _hasBegun: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* If true, the scene will remove this mobject after the animation finishes.
|
|
27
|
+
* Used by FadeOut (like Python manim's remover=True).
|
|
28
|
+
*/
|
|
29
|
+
remover: boolean;
|
|
30
|
+
constructor(mobject: Mobject, options?: AnimationOptions);
|
|
31
|
+
/**
|
|
32
|
+
* Called when the animation starts.
|
|
33
|
+
* Subclasses can override to set up initial state.
|
|
34
|
+
*/
|
|
35
|
+
begin(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Called when the animation ends.
|
|
38
|
+
* Subclasses can override to clean up or finalize state.
|
|
39
|
+
*/
|
|
40
|
+
finish(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Apply the animation at a given progress value.
|
|
43
|
+
* @param alpha Progress from 0 (start) to 1 (end)
|
|
44
|
+
*/
|
|
45
|
+
abstract interpolate(alpha: number): void;
|
|
46
|
+
/**
|
|
47
|
+
* Update the animation for the current frame.
|
|
48
|
+
* @param _dt Time delta since last frame (unused, but available for subclasses)
|
|
49
|
+
* @param currentTime Current time in the timeline
|
|
50
|
+
*/
|
|
51
|
+
update(_dt: number, currentTime: number): void;
|
|
52
|
+
/**
|
|
53
|
+
* Check if the animation has finished
|
|
54
|
+
*/
|
|
55
|
+
isFinished(): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Reset the animation to its initial state
|
|
58
|
+
*/
|
|
59
|
+
reset(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Get the start time of this animation (set by Timeline)
|
|
62
|
+
*/
|
|
63
|
+
get startTime(): number | null;
|
|
64
|
+
/**
|
|
65
|
+
* Set the start time of this animation (used by Timeline)
|
|
66
|
+
*/
|
|
67
|
+
set startTime(time: number | null);
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=Animation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Animation.d.ts","sourceRoot":"","sources":["../../src/animation/Animation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAU,MAAM,mBAAmB,CAAC;AAEzD,YAAY,EAAE,YAAY,EAAE,CAAC;AAE7B,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,8BAAsB,SAAS;IAC7B,iCAAiC;IACjC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,2CAA2C;IAC3C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAEhC,wDAAwD;IACxD,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE3C,yCAAyC;IACzC,SAAS,CAAC,WAAW,EAAE,OAAO,CAAS;IAEvC,uCAAuC;IACvC,SAAS,CAAC,SAAS,EAAE,OAAO,CAAS;IAErC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAS;gBAEb,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,gBAAqB;IAM5D;;;OAGG;IACH,KAAK,IAAI,IAAI;IAKb;;;OAGG;IACH,MAAM,IAAI,IAAI;IAId;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAEzC;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IA2B9C;;OAEG;IACH,UAAU,IAAI,OAAO;IAIrB;;OAEG;IACH,KAAK,IAAI,IAAI;IAMb;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,GAAG,IAAI,CAE7B;IAED;;OAEG;IACH,IAAI,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAEhC;CACF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Animation } from './Animation';
|
|
2
|
+
export interface AnimationGroupOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Lag ratio: 0 = all parallel (default), 1 = sequential.
|
|
5
|
+
* Values between 0 and 1 create overlapping animations.
|
|
6
|
+
*/
|
|
7
|
+
lagRatio?: number;
|
|
8
|
+
/** Rate function applied to the group's overall progress */
|
|
9
|
+
rateFunc?: (t: number) => number;
|
|
10
|
+
}
|
|
11
|
+
export declare class AnimationGroup extends Animation {
|
|
12
|
+
/** Child animations */
|
|
13
|
+
readonly animations: Animation[];
|
|
14
|
+
/** Lag ratio */
|
|
15
|
+
readonly lagRatio: number;
|
|
16
|
+
/** Start times for each animation (relative to group start) */
|
|
17
|
+
private _startTimes;
|
|
18
|
+
/** End times for each animation (relative to group start) */
|
|
19
|
+
private _endTimes;
|
|
20
|
+
constructor(animations: Animation[], options?: AnimationGroupOptions);
|
|
21
|
+
/**
|
|
22
|
+
* Set up the animation - compute start/end times and call begin on all children
|
|
23
|
+
*/
|
|
24
|
+
begin(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Interpolate all child animations based on group alpha
|
|
27
|
+
*/
|
|
28
|
+
interpolate(alpha: number): void;
|
|
29
|
+
/**
|
|
30
|
+
* Finish all child animations
|
|
31
|
+
*/
|
|
32
|
+
finish(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Check if all child animations have finished
|
|
35
|
+
*/
|
|
36
|
+
isFinished(): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Reset the animation group
|
|
39
|
+
*/
|
|
40
|
+
reset(): void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Create an AnimationGroup that plays animations together.
|
|
44
|
+
* @param animations Array of animations to play
|
|
45
|
+
* @param options Options including lagRatio
|
|
46
|
+
*/
|
|
47
|
+
export declare function animationGroup(animations: Animation[], options?: AnimationGroupOptions): AnimationGroup;
|
|
48
|
+
//# sourceMappingURL=AnimationGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimationGroup.d.ts","sourceRoot":"","sources":["../../src/animation/AnimationGroup.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;CAClC;AA6CD,qBAAa,cAAe,SAAQ,SAAS;IAC3C,uBAAuB;IACvB,QAAQ,CAAC,UAAU,EAAE,SAAS,EAAE,CAAC;IAEjC,gBAAgB;IAChB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,+DAA+D;IAC/D,OAAO,CAAC,WAAW,CAAgB;IAEnC,6DAA6D;IAC7D,OAAO,CAAC,SAAS,CAAgB;gBAErB,UAAU,EAAE,SAAS,EAAE,EAAE,OAAO,GAAE,qBAA0B;IAiBxE;;OAEG;IACM,KAAK,IAAI,IAAI;IA+BtB;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IA+BhC;;OAEG;IACM,MAAM,IAAI,IAAI;IAOvB;;OAEG;IACM,UAAU,IAAI,OAAO;IAI9B;;OAEG;IACM,KAAK,IAAI,IAAI;CAMvB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,SAAS,EAAE,EACvB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,cAAc,CAEhB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Animation } from './Animation';
|
|
2
|
+
import { AnimationGroup, AnimationGroupOptions } from './AnimationGroup';
|
|
3
|
+
export interface LaggedStartOptions extends AnimationGroupOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Lag ratio between animation starts.
|
|
6
|
+
* Default is 0.2 (20% overlap between consecutive animations).
|
|
7
|
+
* 0 = all parallel, 1 = sequential (no overlap).
|
|
8
|
+
*/
|
|
9
|
+
lagRatio?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Create a LaggedStart animation group.
|
|
13
|
+
* Each animation starts lagRatio * singleDuration after the previous.
|
|
14
|
+
*
|
|
15
|
+
* @param animations Array of animations to stagger
|
|
16
|
+
* @param options Options including lagRatio (default 0.2)
|
|
17
|
+
*/
|
|
18
|
+
export declare function laggedStart(animations: Animation[], options?: LaggedStartOptions): AnimationGroup;
|
|
19
|
+
/**
|
|
20
|
+
* LaggedStart class for cases where class instantiation is preferred.
|
|
21
|
+
*/
|
|
22
|
+
export declare class LaggedStart extends AnimationGroup {
|
|
23
|
+
constructor(animations: Animation[], options?: LaggedStartOptions);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=LaggedStart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LaggedStart.d.ts","sourceRoot":"","sources":["../../src/animation/LaggedStart.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzE,MAAM,WAAW,kBAAmB,SAAQ,qBAAqB;IAC/D;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,UAAU,EAAE,SAAS,EAAE,EACvB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,cAAc,CAKhB;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,cAAc;gBACjC,UAAU,EAAE,SAAS,EAAE,EAAE,OAAO,GAAE,kBAAuB;CAMtE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Mobject, UpdaterFunction } from '../core/Mobject';
|
|
2
|
+
/**
|
|
3
|
+
* Creates an updater function that maintains a mobject's position relative to a target.
|
|
4
|
+
* The offset is calculated when this function is called and preserved during updates.
|
|
5
|
+
*
|
|
6
|
+
* @param mobject - The mobject to keep at a fixed offset
|
|
7
|
+
* @param target - The target mobject to track
|
|
8
|
+
* @returns An updater function that can be added to a mobject with addUpdater()
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const follower = new Circle();
|
|
13
|
+
* const leader = new Square();
|
|
14
|
+
*
|
|
15
|
+
* // Keep follower 2 units to the right of leader
|
|
16
|
+
* follower.moveTo([leader.position.x + 2, leader.position.y, 0]);
|
|
17
|
+
* follower.addUpdater(maintainPositionRelativeTo(follower, leader));
|
|
18
|
+
*
|
|
19
|
+
* // Now when leader moves, follower will follow
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function maintainPositionRelativeTo(mobject: Mobject, target: Mobject): UpdaterFunction;
|
|
23
|
+
//# sourceMappingURL=MaintainPositionRelativeTo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaintainPositionRelativeTo.d.ts","sourceRoot":"","sources":["../../src/animation/MaintainPositionRelativeTo.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,OAAO,GACd,eAAe,CAejB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Animation } from './Animation';
|
|
2
|
+
import { AnimationGroup, AnimationGroupOptions } from './AnimationGroup';
|
|
3
|
+
export interface SuccessionOptions extends Omit<AnimationGroupOptions, 'lagRatio'> {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Create a Succession animation group.
|
|
7
|
+
* Animations play one after another with no overlap (lagRatio = 1).
|
|
8
|
+
*
|
|
9
|
+
* @param animations Array of animations to play in sequence
|
|
10
|
+
* @param options Animation options (rateFunc)
|
|
11
|
+
*/
|
|
12
|
+
export declare function succession(animations: Animation[], options?: SuccessionOptions): AnimationGroup;
|
|
13
|
+
/**
|
|
14
|
+
* Succession class for cases where class instantiation is preferred.
|
|
15
|
+
*/
|
|
16
|
+
export declare class Succession extends AnimationGroup {
|
|
17
|
+
constructor(animations: Animation[], options?: SuccessionOptions);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=Succession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Succession.d.ts","sourceRoot":"","sources":["../../src/animation/Succession.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzE,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,qBAAqB,EAAE,UAAU,CAAC;CAAG;AAErF;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,UAAU,EAAE,SAAS,EAAE,EACvB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,cAAc,CAKhB;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,cAAc;gBAChC,UAAU,EAAE,SAAS,EAAE,EAAE,OAAO,GAAE,iBAAsB;CAMrE"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Animation } from './Animation';
|
|
2
|
+
/**
|
|
3
|
+
* Position parameter for adding animations to the timeline.
|
|
4
|
+
* - Number: absolute time in seconds
|
|
5
|
+
* - '+=N': N seconds after the last animation ends
|
|
6
|
+
* - '-=N': N seconds before the last animation ends
|
|
7
|
+
* - '<': same start time as the previous animation
|
|
8
|
+
* - '>': end of the previous animation (default)
|
|
9
|
+
*/
|
|
10
|
+
export type PositionParam = number | string;
|
|
11
|
+
export declare class Timeline {
|
|
12
|
+
/** All scheduled animations with their timing */
|
|
13
|
+
private _animations;
|
|
14
|
+
/** Total duration of the timeline */
|
|
15
|
+
private _duration;
|
|
16
|
+
/** Current playback time */
|
|
17
|
+
private _currentTime;
|
|
18
|
+
/** Whether the timeline is playing */
|
|
19
|
+
private _isPlaying;
|
|
20
|
+
/** Track which animations have been started */
|
|
21
|
+
private _startedAnimations;
|
|
22
|
+
/**
|
|
23
|
+
* Add an animation to the timeline.
|
|
24
|
+
* @param animation The animation to add
|
|
25
|
+
* @param position When to start the animation (default: '>' - after previous ends)
|
|
26
|
+
*/
|
|
27
|
+
add(animation: Animation, position?: PositionParam): this;
|
|
28
|
+
/**
|
|
29
|
+
* Add multiple animations to play in parallel (all start at the same time).
|
|
30
|
+
* @param animations The animations to add
|
|
31
|
+
* @param position When to start all animations (default: '>' - after previous ends)
|
|
32
|
+
*/
|
|
33
|
+
addParallel(animations: Animation[], position?: PositionParam): this;
|
|
34
|
+
/**
|
|
35
|
+
* Resolve a position parameter to an absolute time.
|
|
36
|
+
*/
|
|
37
|
+
private _resolvePosition;
|
|
38
|
+
/**
|
|
39
|
+
* Seek to a specific time in the timeline.
|
|
40
|
+
* @param time The time to seek to (in seconds)
|
|
41
|
+
*/
|
|
42
|
+
seek(time: number): this;
|
|
43
|
+
/**
|
|
44
|
+
* Update the timeline by a time delta.
|
|
45
|
+
* @param dt Time delta in seconds
|
|
46
|
+
*/
|
|
47
|
+
update(dt: number): void;
|
|
48
|
+
/**
|
|
49
|
+
* Update all animations that should be active at the given time.
|
|
50
|
+
*/
|
|
51
|
+
private _updateAnimationsAtTime;
|
|
52
|
+
/**
|
|
53
|
+
* Start playing the timeline.
|
|
54
|
+
*/
|
|
55
|
+
play(): this;
|
|
56
|
+
/**
|
|
57
|
+
* Pause the timeline.
|
|
58
|
+
*/
|
|
59
|
+
pause(): this;
|
|
60
|
+
/**
|
|
61
|
+
* Reset the timeline to the beginning.
|
|
62
|
+
*/
|
|
63
|
+
reset(): this;
|
|
64
|
+
/**
|
|
65
|
+
* Check if the timeline has finished playing.
|
|
66
|
+
*/
|
|
67
|
+
isFinished(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Check if the timeline is currently playing.
|
|
70
|
+
*/
|
|
71
|
+
isPlaying(): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Get the total duration of the timeline.
|
|
74
|
+
*/
|
|
75
|
+
getDuration(): number;
|
|
76
|
+
/**
|
|
77
|
+
* Get the current playback time.
|
|
78
|
+
*/
|
|
79
|
+
getCurrentTime(): number;
|
|
80
|
+
/**
|
|
81
|
+
* Get the number of animations in the timeline.
|
|
82
|
+
*/
|
|
83
|
+
get length(): number;
|
|
84
|
+
/**
|
|
85
|
+
* Clear all animations from the timeline.
|
|
86
|
+
*/
|
|
87
|
+
clear(): this;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=Timeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../src/animation/Timeline.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAQ5C,qBAAa,QAAQ;IACnB,iDAAiD;IACjD,OAAO,CAAC,WAAW,CAA4B;IAE/C,qCAAqC;IACrC,OAAO,CAAC,SAAS,CAAa;IAE9B,4BAA4B;IAC5B,OAAO,CAAC,YAAY,CAAa;IAEjC,sCAAsC;IACtC,OAAO,CAAC,UAAU,CAAkB;IAEpC,+CAA+C;IAC/C,OAAO,CAAC,kBAAkB,CAA6B;IAEvD;;;;OAIG;IACH,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,GAAE,aAAmB,GAAG,IAAI;IAgB9D;;;;OAIG;IACH,WAAW,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE,QAAQ,GAAE,aAAmB,GAAG,IAAI;IAmBzE;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAwCxB;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAoBxB;;;OAGG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAcxB;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAsB/B;;OAEG;IACH,IAAI,IAAI,IAAI;IAKZ;;OAEG;IACH,KAAK,IAAI,IAAI;IAKb;;OAEG;IACH,KAAK,IAAI,IAAI;IAYb;;OAEG;IACH,UAAU,IAAI,OAAO;IAIrB;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,WAAW,IAAI,MAAM;IAIrB;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;OAEG;IACH,KAAK,IAAI,IAAI;CAQd"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Mobject } from '../core/Mobject';
|
|
2
|
+
import { Animation, AnimationOptions } from './Animation';
|
|
3
|
+
/**
|
|
4
|
+
* Animation that applies a custom function to a mobject over time.
|
|
5
|
+
* The function receives the mobject and the rate-function-adjusted alpha (progress from 0 to 1).
|
|
6
|
+
* This is similar to UpdateFromFunc but specifically named to match Manim's API.
|
|
7
|
+
*/
|
|
8
|
+
export declare class UpdateFromAlphaFunc extends Animation {
|
|
9
|
+
private _func;
|
|
10
|
+
/**
|
|
11
|
+
* Create an UpdateFromAlphaFunc animation.
|
|
12
|
+
* @param mobject - The mobject to animate
|
|
13
|
+
* @param func - Function called with (mobject, alpha) each frame
|
|
14
|
+
* @param options - Animation options (duration, rateFunc, etc.)
|
|
15
|
+
*/
|
|
16
|
+
constructor(mobject: Mobject, func: (mobject: Mobject, alpha: number) => void, options?: AnimationOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Apply the animation at a given progress value.
|
|
19
|
+
* The alpha value has already been transformed by the rate function.
|
|
20
|
+
* @param alpha Progress from 0 (start) to 1 (end), transformed by rateFunc
|
|
21
|
+
*/
|
|
22
|
+
interpolate(alpha: number): void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Factory function to create an UpdateFromAlphaFunc animation.
|
|
26
|
+
* @param mobject - The mobject to animate
|
|
27
|
+
* @param func - Function called with (mobject, alpha) each frame
|
|
28
|
+
* @param options - Animation options (duration, rateFunc, etc.)
|
|
29
|
+
* @returns A new UpdateFromAlphaFunc animation
|
|
30
|
+
*/
|
|
31
|
+
export declare function updateFromAlphaFunc(mobject: Mobject, func: (mobject: Mobject, alpha: number) => void, options?: AnimationOptions): UpdateFromAlphaFunc;
|
|
32
|
+
//# sourceMappingURL=UpdateFromAlphaFunc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateFromAlphaFunc.d.ts","sourceRoot":"","sources":["../../src/animation/UpdateFromAlphaFunc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,SAAS;IAChD,OAAO,CAAC,KAAK,CAA4C;IAEzD;;;;;OAKG;gBAED,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,EAC/C,OAAO,CAAC,EAAE,gBAAgB;IAM5B;;;;OAIG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAGjC;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,EAC/C,OAAO,CAAC,EAAE,gBAAgB,GACzB,mBAAmB,CAErB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Mobject } from '../core/Mobject';
|
|
2
|
+
import { Animation, AnimationOptions } from './Animation';
|
|
3
|
+
/**
|
|
4
|
+
* Animation that applies a custom function to a mobject over time.
|
|
5
|
+
* The function is called with the mobject and the current alpha (progress from 0 to 1).
|
|
6
|
+
*/
|
|
7
|
+
export declare class UpdateFromFunc extends Animation {
|
|
8
|
+
private _func;
|
|
9
|
+
/**
|
|
10
|
+
* Create an UpdateFromFunc animation.
|
|
11
|
+
* @param mobject - The mobject to animate
|
|
12
|
+
* @param func - Function called with (mobject, alpha) each frame
|
|
13
|
+
* @param options - Animation options (duration, rateFunc, etc.)
|
|
14
|
+
*/
|
|
15
|
+
constructor(mobject: Mobject, func: (mobject: Mobject, alpha: number) => void, options?: AnimationOptions);
|
|
16
|
+
/**
|
|
17
|
+
* Apply the animation at a given progress value.
|
|
18
|
+
* @param alpha Progress from 0 (start) to 1 (end)
|
|
19
|
+
*/
|
|
20
|
+
interpolate(alpha: number): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Factory function to create an UpdateFromFunc animation.
|
|
24
|
+
* @param mobject - The mobject to animate
|
|
25
|
+
* @param func - Function called with (mobject, alpha) each frame
|
|
26
|
+
* @param options - Animation options (duration, rateFunc, etc.)
|
|
27
|
+
* @returns A new UpdateFromFunc animation
|
|
28
|
+
*/
|
|
29
|
+
export declare function updateFromFunc(mobject: Mobject, func: (mobject: Mobject, alpha: number) => void, options?: AnimationOptions): UpdateFromFunc;
|
|
30
|
+
//# sourceMappingURL=UpdateFromFunc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateFromFunc.d.ts","sourceRoot":"","sources":["../../src/animation/UpdateFromFunc.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1D;;;GAGG;AACH,qBAAa,cAAe,SAAQ,SAAS;IAC3C,OAAO,CAAC,KAAK,CAA4C;IAEzD;;;;;OAKG;gBAED,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,EAC/C,OAAO,CAAC,EAAE,gBAAgB;IAM5B;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAGjC;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,EAC/C,OAAO,CAAC,EAAE,gBAAgB,GACzB,cAAc,CAEhB"}
|