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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight feature flag system for manim-js.
|
|
3
|
+
* Enables toggling experimental features without code changes.
|
|
4
|
+
*/
|
|
5
|
+
type FeatureFlags = Record<string, boolean>;
|
|
6
|
+
/** Check if a feature flag is enabled. */
|
|
7
|
+
export declare function isFeatureEnabled(flag: string): boolean;
|
|
8
|
+
/** Override feature flags (e.g., from environment or config). */
|
|
9
|
+
export declare function setFeatureFlags(overrides: Partial<FeatureFlags>): void;
|
|
10
|
+
/** Reset all flags to defaults. */
|
|
11
|
+
export declare function resetFeatureFlags(): void;
|
|
12
|
+
/** Get all current flag values. */
|
|
13
|
+
export declare function getFeatureFlags(): Readonly<FeatureFlags>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=featureFlags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureFlags.d.ts","sourceRoot":"","sources":["../../src/utils/featureFlags.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAU5C,0CAA0C;AAC1C,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,iEAAiE;AACjE,wBAAgB,eAAe,CAAC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAEtE;AAED,mCAAmC;AACnC,wBAAgB,iBAAiB,IAAI,IAAI,CAExC;AAED,mCAAmC;AACnC,wBAAgB,eAAe,IAAI,QAAQ,CAAC,YAAY,CAAC,CAExD"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hungarian (Kuhn-Munkres) Algorithm for Optimal Assignment
|
|
3
|
+
*
|
|
4
|
+
* Solves the assignment problem: given an n x m cost matrix, find the
|
|
5
|
+
* assignment of rows to columns that minimizes the total cost.
|
|
6
|
+
*
|
|
7
|
+
* Time complexity: O(n^3) where n = max(rows, cols)
|
|
8
|
+
* Space complexity: O(n^2)
|
|
9
|
+
*
|
|
10
|
+
* Handles rectangular matrices (different number of source vs target parts)
|
|
11
|
+
* by padding to square with zero-cost dummy entries.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Result of the Hungarian algorithm.
|
|
15
|
+
*/
|
|
16
|
+
export interface HungarianResult {
|
|
17
|
+
/**
|
|
18
|
+
* Optimal row-to-column assignments.
|
|
19
|
+
* assignments[i] = j means row i is assigned to column j.
|
|
20
|
+
* assignments[i] = -1 means row i is unassigned (when cols < rows after filtering dummies).
|
|
21
|
+
*/
|
|
22
|
+
assignments: number[];
|
|
23
|
+
/** Total cost of the optimal assignment */
|
|
24
|
+
totalCost: number;
|
|
25
|
+
/** Set of row indices that are assigned (not dummy) */
|
|
26
|
+
assignedRows: Set<number>;
|
|
27
|
+
/** Set of column indices that are assigned (not dummy) */
|
|
28
|
+
assignedCols: Set<number>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Solve the assignment problem using the Hungarian (Kuhn-Munkres) algorithm.
|
|
32
|
+
*
|
|
33
|
+
* Given an n x m cost matrix, finds the optimal one-to-one assignment of
|
|
34
|
+
* rows to columns that minimizes total cost.
|
|
35
|
+
*
|
|
36
|
+
* Implementation uses the successive shortest path formulation with
|
|
37
|
+
* potential functions (Jonker-Volgenant style) for O(n^3) performance.
|
|
38
|
+
*
|
|
39
|
+
* @param costMatrix - n x m matrix where costMatrix[i][j] is the cost
|
|
40
|
+
* of assigning row i to column j
|
|
41
|
+
* @returns HungarianResult with optimal assignments and metadata
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const cost = [
|
|
46
|
+
* [10, 5, 13],
|
|
47
|
+
* [3, 7, 15],
|
|
48
|
+
* [8, 12, 11],
|
|
49
|
+
* ];
|
|
50
|
+
* const result = hungarian(cost);
|
|
51
|
+
* // result.assignments might be [1, 0, 2] with totalCost = 5+3+11 = 19
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function hungarian(costMatrix: number[][]): HungarianResult;
|
|
55
|
+
/**
|
|
56
|
+
* Convenience function to find the optimal matching given a similarity matrix.
|
|
57
|
+
* Converts similarities (higher = better) to costs (lower = better) and
|
|
58
|
+
* runs the Hungarian algorithm.
|
|
59
|
+
*
|
|
60
|
+
* @param similarityMatrix - n x m matrix where higher values mean better matches
|
|
61
|
+
* @param threshold - Minimum similarity to consider a valid match (default: 0).
|
|
62
|
+
* Pairs below this threshold are treated as unmatched.
|
|
63
|
+
* @returns HungarianResult with optimal assignments
|
|
64
|
+
*/
|
|
65
|
+
export declare function hungarianFromSimilarity(similarityMatrix: number[][], threshold?: number): HungarianResult;
|
|
66
|
+
//# sourceMappingURL=hungarian.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hungarian.d.ts","sourceRoot":"","sources":["../../src/utils/hungarian.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,WAAW,EAAE,MAAM,EAAE,CAAC;IAEtB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAElB,uDAAuD;IACvD,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAE1B,0DAA0D;IAC1D,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,GAAG,eAAe,CAgIjE;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,gBAAgB,EAAE,MAAM,EAAE,EAAE,EAC5B,SAAS,GAAE,MAAU,GACpB,eAAe,CAkDjB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured logger for manim-js.
|
|
3
|
+
* Provides consistent logging interface for both browser and Node environments.
|
|
4
|
+
* Includes log sanitization to redact sensitive data (tokens, keys, emails).
|
|
5
|
+
*/
|
|
6
|
+
interface Logger {
|
|
7
|
+
debug: (...args: unknown[]) => void;
|
|
8
|
+
info: (...args: unknown[]) => void;
|
|
9
|
+
warn: (...args: unknown[]) => void;
|
|
10
|
+
error: (...args: unknown[]) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const logger: Logger;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,UAAU,MAAM;IACd,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACpC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACnC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACrC;AAwGD,eAAO,MAAM,MAAM,EAAE,MAapB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared math utility functions used across the codebase.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Linear interpolation between two numbers.
|
|
6
|
+
* Returns a + (b - a) * t.
|
|
7
|
+
*/
|
|
8
|
+
export declare function lerp(a: number, b: number, t: number): number;
|
|
9
|
+
/**
|
|
10
|
+
* Linear interpolation between two 3D points, component-wise.
|
|
11
|
+
* Each point is represented as a number array [x, y, z].
|
|
12
|
+
*/
|
|
13
|
+
export declare function lerpPoint(a: number[], b: number[], t: number): number[];
|
|
14
|
+
/**
|
|
15
|
+
* Hermite smoothstep interpolation.
|
|
16
|
+
* Maps t in [0, 1] to a smooth S-curve: 3t^2 - 2t^3.
|
|
17
|
+
* Commonly used for smooth camera movements and animation easing.
|
|
18
|
+
*/
|
|
19
|
+
export declare function smoothstep(t: number): number;
|
|
20
|
+
/**
|
|
21
|
+
* Convert graph coordinates to visual point coordinates.
|
|
22
|
+
*
|
|
23
|
+
* @param x - X coordinate in graph space
|
|
24
|
+
* @param y - Y coordinate in graph space
|
|
25
|
+
* @param xRange - X-axis range as [min, max, ...] (only first two elements used)
|
|
26
|
+
* @param yRange - Y-axis range as [min, max, ...] (only first two elements used)
|
|
27
|
+
* @param xLength - Visual length of the x-axis
|
|
28
|
+
* @param yLength - Visual length of the y-axis
|
|
29
|
+
* @returns The visual point [x, y, 0]
|
|
30
|
+
*/
|
|
31
|
+
export declare function coordsToPoint(x: number, y: number, xRange: [number, number, ...number[]], yRange: [number, number, ...number[]], xLength: number, yLength: number): [number, number, number];
|
|
32
|
+
/**
|
|
33
|
+
* Convert visual point coordinates to graph coordinates.
|
|
34
|
+
*
|
|
35
|
+
* @param point - Visual point [x, y, z] (z is ignored)
|
|
36
|
+
* @param xRange - X-axis range as [min, max, ...] (only first two elements used)
|
|
37
|
+
* @param yRange - Y-axis range as [min, max, ...] (only first two elements used)
|
|
38
|
+
* @param xLength - Visual length of the x-axis
|
|
39
|
+
* @param yLength - Visual length of the y-axis
|
|
40
|
+
* @returns Graph coordinates [x, y]
|
|
41
|
+
*/
|
|
42
|
+
export declare function pointToCoords(point: [number, number, number], xRange: [number, number, ...number[]], yRange: [number, number, ...number[]], xLength: number, yLength: number): [number, number];
|
|
43
|
+
/**
|
|
44
|
+
* Evaluate a cubic Bezier curve at parameter t.
|
|
45
|
+
* Uses the standard cubic Bernstein polynomial:
|
|
46
|
+
* B(t) = (1-t)^3 * p0 + 3*(1-t)^2*t * p1 + 3*(1-t)*t^2 * p2 + t^3 * p3
|
|
47
|
+
*
|
|
48
|
+
* The z-component uses nullish coalescing (p[2] ?? 0) so that 2D points
|
|
49
|
+
* (without an explicit z) are handled safely.
|
|
50
|
+
*/
|
|
51
|
+
export declare function evalCubicBezier(p0: number[], p1: number[], p2: number[], p3: number[], t: number): number[];
|
|
52
|
+
//# sourceMappingURL=math.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/utils/math.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAMvE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EACrC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAQ1B;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAC/B,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EACrC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,CAAC,MAAM,EAAE,MAAM,CAAC,CAQlB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE,MAAM,EAAE,EACZ,EAAE,EAAE,MAAM,EAAE,EACZ,EAAE,EAAE,MAAM,EAAE,EACZ,EAAE,EAAE,MAAM,EAAE,EACZ,CAAC,EAAE,MAAM,GACR,MAAM,EAAE,CAYV"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ODE (Ordinary Differential Equation) solvers for numerical integration.
|
|
3
|
+
*
|
|
4
|
+
* Provides Runge-Kutta 4th order (RK4) integration for systems of the form:
|
|
5
|
+
* dy/dt = f(t, y)
|
|
6
|
+
*
|
|
7
|
+
* Supports scalar and vector-valued state variables (2D and 3D).
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* A function defining the right-hand side of an ODE system: dy/dt = f(t, y).
|
|
11
|
+
* @param t - Current time
|
|
12
|
+
* @param y - Current state vector
|
|
13
|
+
* @returns The derivative dy/dt at (t, y)
|
|
14
|
+
*/
|
|
15
|
+
export type ODEFunction = (t: number, y: number[]) => number[];
|
|
16
|
+
/**
|
|
17
|
+
* An autonomous vector field function: dy/dt = f(y).
|
|
18
|
+
* This is the common case for phase flows where the field does not
|
|
19
|
+
* depend on time explicitly.
|
|
20
|
+
* @param point - Current position as [x, y, z]
|
|
21
|
+
* @returns Velocity vector [vx, vy, vz]
|
|
22
|
+
*/
|
|
23
|
+
export type VectorFieldFunction3D = (point: [number, number, number]) => [number, number, number];
|
|
24
|
+
/**
|
|
25
|
+
* Options for the IVP (Initial Value Problem) solver.
|
|
26
|
+
*/
|
|
27
|
+
export interface SolveIVPOptions {
|
|
28
|
+
/** Fixed step size. If not provided, defaults to (tEnd - t0) / numSteps. */
|
|
29
|
+
stepSize?: number;
|
|
30
|
+
/** Number of integration steps (used when stepSize is not provided). Default: 100 */
|
|
31
|
+
numSteps?: number;
|
|
32
|
+
/** Whether to record the full trajectory or only return the final state. Default: false */
|
|
33
|
+
recordTrajectory?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Result of solving an IVP.
|
|
37
|
+
*/
|
|
38
|
+
export interface IVPResult {
|
|
39
|
+
/** Final state vector */
|
|
40
|
+
y: number[];
|
|
41
|
+
/** Final time */
|
|
42
|
+
t: number;
|
|
43
|
+
/** Trajectory of [t, y] pairs (only populated if recordTrajectory is true) */
|
|
44
|
+
trajectory: {
|
|
45
|
+
t: number;
|
|
46
|
+
y: number[];
|
|
47
|
+
}[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Perform a single RK4 integration step.
|
|
51
|
+
*
|
|
52
|
+
* Advances the state y at time t by one step of size h using the
|
|
53
|
+
* classical 4th-order Runge-Kutta method.
|
|
54
|
+
*
|
|
55
|
+
* @param f - The ODE function dy/dt = f(t, y)
|
|
56
|
+
* @param t - Current time
|
|
57
|
+
* @param y - Current state vector
|
|
58
|
+
* @param h - Step size
|
|
59
|
+
* @returns The new state vector at time t + h
|
|
60
|
+
*/
|
|
61
|
+
export declare function rk4Step(f: ODEFunction, t: number, y: number[], h: number): number[];
|
|
62
|
+
/**
|
|
63
|
+
* Solve an initial value problem (IVP) using RK4 integration.
|
|
64
|
+
*
|
|
65
|
+
* Integrates dy/dt = f(t, y) from t0 to tEnd starting at y0.
|
|
66
|
+
*
|
|
67
|
+
* @param f - The ODE function dy/dt = f(t, y)
|
|
68
|
+
* @param t0 - Initial time
|
|
69
|
+
* @param y0 - Initial state vector
|
|
70
|
+
* @param tEnd - Final time
|
|
71
|
+
* @param options - Solver options (stepSize, numSteps, recordTrajectory)
|
|
72
|
+
* @returns The solution at tEnd (and optionally the full trajectory)
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* // Solve a simple harmonic oscillator: x'' = -x
|
|
77
|
+
* // Written as a system: y = [x, v], dy/dt = [v, -x]
|
|
78
|
+
* const result = solveIVP(
|
|
79
|
+
* (t, y) => [y[1], -y[0]],
|
|
80
|
+
* 0, // t0
|
|
81
|
+
* [1, 0], // y0 = [x0, v0]
|
|
82
|
+
* 2 * Math.PI, // tEnd (one full period)
|
|
83
|
+
* { numSteps: 1000 }
|
|
84
|
+
* );
|
|
85
|
+
* // result.y should be close to [1, 0]
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare function solveIVP(f: ODEFunction, t0: number, y0: number[], tEnd: number, options?: SolveIVPOptions): IVPResult;
|
|
89
|
+
/**
|
|
90
|
+
* Flow a 3D point along an autonomous vector field for a given duration.
|
|
91
|
+
*
|
|
92
|
+
* This is a convenience wrapper around solveIVP for the common case of
|
|
93
|
+
* flowing a point through a time-independent vector field:
|
|
94
|
+
* dp/dt = vectorField(p)
|
|
95
|
+
*
|
|
96
|
+
* @param vectorField - The vector field function (point) => velocity
|
|
97
|
+
* @param start - Starting point [x, y, z]
|
|
98
|
+
* @param time - Duration to flow (can be negative for backward flow)
|
|
99
|
+
* @param numSteps - Number of integration steps (default: 100)
|
|
100
|
+
* @returns The final position [x, y, z]
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* // Circular flow: dp/dt = [-y, x, 0]
|
|
105
|
+
* const end = flowPoint(
|
|
106
|
+
* ([x, y, z]) => [-y, x, 0],
|
|
107
|
+
* [1, 0, 0],
|
|
108
|
+
* Math.PI / 2 // quarter turn
|
|
109
|
+
* );
|
|
110
|
+
* // end should be close to [0, 1, 0]
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
export declare function flowPoint(vectorField: VectorFieldFunction3D, start: [number, number, number], time: number, numSteps?: number): [number, number, number];
|
|
114
|
+
/**
|
|
115
|
+
* Flow a 3D point along an autonomous vector field and return the full trajectory.
|
|
116
|
+
*
|
|
117
|
+
* @param vectorField - The vector field function (point) => velocity
|
|
118
|
+
* @param start - Starting point [x, y, z]
|
|
119
|
+
* @param time - Duration to flow
|
|
120
|
+
* @param numSteps - Number of integration steps (default: 100)
|
|
121
|
+
* @returns Array of points along the trajectory
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* // Get trajectory for a spiral flow
|
|
126
|
+
* const trajectory = flowPointTrajectory(
|
|
127
|
+
* ([x, y, z]) => [-y - 0.1*x, x - 0.1*y, 0],
|
|
128
|
+
* [1, 0, 0],
|
|
129
|
+
* 10,
|
|
130
|
+
* 500
|
|
131
|
+
* );
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
export declare function flowPointTrajectory(vectorField: VectorFieldFunction3D, start: [number, number, number], time: number, numSteps?: number): [number, number, number][];
|
|
135
|
+
//# sourceMappingURL=ode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ode.d.ts","sourceRoot":"","sources":["../../src/utils/ode.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAElG;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2FAA2F;IAC3F,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,yBAAyB;IACzB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,iBAAiB;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,8EAA8E;IAC9E,UAAU,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;CAC1C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAkCnF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,QAAQ,CACtB,CAAC,EAAE,WAAW,EACd,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EAAE,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAoB,GAC5B,SAAS,CAmCX;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,SAAS,CACvB,WAAW,EAAE,qBAAqB,EAClC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAC/B,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,MAAY,GACrB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAe1B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,qBAAqB,EAClC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAC/B,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,MAAY,GACrB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAkB5B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Glyph Skeletonization — Medial Axis Extraction via Zhang-Suen Thinning
|
|
3
|
+
*
|
|
4
|
+
* Converts a glyph's cubic Bezier outline into center-line paths that
|
|
5
|
+
* represent the natural pen strokes of the character. The algorithm:
|
|
6
|
+
*
|
|
7
|
+
* 1. Rasterizes the glyph outline to a binary grid (filled / empty)
|
|
8
|
+
* 2. Applies the Zhang-Suen thinning algorithm to extract a 1-pixel skeleton
|
|
9
|
+
* 3. Traces skeleton pixels into ordered path chains
|
|
10
|
+
* 4. Smooths the paths using Catmull-Rom interpolation
|
|
11
|
+
* 5. Fits cubic Bezier curves to the smooth paths
|
|
12
|
+
*
|
|
13
|
+
* The output format matches VMobject's control point convention:
|
|
14
|
+
* [anchor1, handle1, handle2, anchor2, handle3, handle4, anchor3, ...]
|
|
15
|
+
*/
|
|
16
|
+
export interface SkeletonizeOptions {
|
|
17
|
+
/** Grid resolution (pixels along the longest glyph dimension). Default: 100 */
|
|
18
|
+
gridResolution?: number;
|
|
19
|
+
/** Smoothing subdivisions per traced segment (Catmull-Rom). Default: 4 */
|
|
20
|
+
smoothSubdivisions?: number;
|
|
21
|
+
/** Minimum chain length in pixels to keep. Default: 3 */
|
|
22
|
+
minChainLength?: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Extract the medial-axis (skeleton) of a glyph outline as cubic Bezier
|
|
26
|
+
* control points compatible with VMobject.
|
|
27
|
+
*
|
|
28
|
+
* @param outlinePoints Cubic Bezier control points from GlyphVMobject:
|
|
29
|
+
* [anchor1, handle1, handle2, anchor2, ...] where each point is [x, y, z].
|
|
30
|
+
* @param options Tuning parameters.
|
|
31
|
+
* @returns Array of cubic Bezier control points tracing the skeleton center-line,
|
|
32
|
+
* or an empty array if the glyph has no interior (e.g. a dot or very thin glyph).
|
|
33
|
+
*/
|
|
34
|
+
export declare function skeletonizeGlyph(outlinePoints: number[][], options?: SkeletonizeOptions): number[][];
|
|
35
|
+
//# sourceMappingURL=skeletonize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeletonize.d.ts","sourceRoot":"","sources":["../../src/utils/skeletonize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,MAAM,WAAW,kBAAkB;IACjC,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yDAAyD;IACzD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,MAAM,EAAE,EAAE,EACzB,OAAO,GAAE,kBAAuB,GAC/B,MAAM,EAAE,EAAE,CAqEZ"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polygon triangulation using earcut.
|
|
3
|
+
*
|
|
4
|
+
* earcut is the JS port of mapbox-earcut -- the same robust library that
|
|
5
|
+
* Python manim relies on for polygon fill. It handles:
|
|
6
|
+
* - Simple convex / concave polygons
|
|
7
|
+
* - Polygons with holes (inner rings)
|
|
8
|
+
* - Self-intersecting polygons (best-effort)
|
|
9
|
+
* - Degenerate / zero-area cases (returns empty indices)
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* const indices = triangulatePolygon(outerRing);
|
|
13
|
+
* const indices = triangulatePolygon(outerRing, [hole1, hole2]);
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Triangulate a 2D polygon, optionally with holes.
|
|
17
|
+
*
|
|
18
|
+
* @param vertices - Outer ring as an array of [x, y] pairs (or [x, y, z] --
|
|
19
|
+
* only the first two components are used).
|
|
20
|
+
* @param holes - Optional array of hole rings. Each hole is an array of
|
|
21
|
+
* [x, y] (or [x, y, z]) pairs wound in the opposite
|
|
22
|
+
* direction of the outer ring.
|
|
23
|
+
* @returns Flat array of triangle vertex indices into the combined vertex
|
|
24
|
+
* list (outer ring vertices followed by all hole vertices in order).
|
|
25
|
+
* Length is always a multiple of 3. Returns [] for degenerate input.
|
|
26
|
+
*/
|
|
27
|
+
export declare function triangulatePolygon(vertices: number[][], holes?: number[][][]): number[];
|
|
28
|
+
/**
|
|
29
|
+
* Triangulate a polygon and return a flat Float32Array of triangle positions
|
|
30
|
+
* suitable for use as a Three.js BufferGeometry position attribute.
|
|
31
|
+
*
|
|
32
|
+
* @param vertices - Outer ring [x, y] pairs
|
|
33
|
+
* @param holes - Optional hole rings
|
|
34
|
+
* @param z - Z coordinate to assign to every output vertex (default 0)
|
|
35
|
+
* @returns Float32Array of xyz triplets (length = numTriangles * 9), or an
|
|
36
|
+
* empty Float32Array for degenerate input.
|
|
37
|
+
*/
|
|
38
|
+
export declare function triangulatePolygonPositions(vertices: number[][], holes?: number[][][], z?: number): Float32Array;
|
|
39
|
+
/**
|
|
40
|
+
* Compute the signed area of a 2D polygon ring.
|
|
41
|
+
* Positive = counter-clockwise, negative = clockwise.
|
|
42
|
+
*/
|
|
43
|
+
export declare function signedArea2D(ring: number[][]): number;
|
|
44
|
+
/**
|
|
45
|
+
* Ensure a ring is wound counter-clockwise (positive signed area).
|
|
46
|
+
* Returns the ring unchanged if already CCW, or reversed otherwise.
|
|
47
|
+
*/
|
|
48
|
+
export declare function ensureCCW(ring: number[][]): number[][];
|
|
49
|
+
/**
|
|
50
|
+
* Ensure a ring is wound clockwise (negative signed area).
|
|
51
|
+
* Holes should be CW when the outer ring is CCW.
|
|
52
|
+
*/
|
|
53
|
+
export declare function ensureCW(ring: number[][]): number[][];
|
|
54
|
+
//# sourceMappingURL=triangulate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triangulate.d.ts","sourceRoot":"","sources":["../../src/utils/triangulate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAAE,EAAE,EACpB,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,GACnB,MAAM,EAAE,CAiCV;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,EAAE,EAAE,EACpB,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EACpB,CAAC,GAAE,MAAU,GACZ,YAAY,CAuBd;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,CAOrD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAEtD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAErD"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Vector3Tuple } from '../core/Mobject';
|
|
2
|
+
/**
|
|
3
|
+
* Scale a direction vector by a scalar.
|
|
4
|
+
*
|
|
5
|
+
* @param scalar - The scalar multiplier
|
|
6
|
+
* @param vec - The direction vector [x, y, z]
|
|
7
|
+
* @returns Scaled vector as [x * scalar, y * scalar, z * scalar]
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* scaleVec(2, LEFT) // [-2, 0, 0]
|
|
12
|
+
* scaleVec(1.5, UP) // [0, 1.5, 0]
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare function scaleVec(scalar: number, vec: Vector3Tuple): Vector3Tuple;
|
|
16
|
+
/**
|
|
17
|
+
* Add two or more vectors component-wise.
|
|
18
|
+
*
|
|
19
|
+
* @param vecs - Two or more vectors to add
|
|
20
|
+
* @returns Sum vector as [sum_x, sum_y, sum_z]
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* addVec(LEFT, UP) // [-1, 1, 0]
|
|
25
|
+
* addVec(scaleVec(2, RIGHT), scaleVec(3, DOWN)) // [2, -3, 0]
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function addVec(...vecs: Vector3Tuple[]): Vector3Tuple;
|
|
29
|
+
/**
|
|
30
|
+
* Subtract one vector from another (a - b).
|
|
31
|
+
*
|
|
32
|
+
* @param a - The vector to subtract from
|
|
33
|
+
* @param b - The vector to subtract
|
|
34
|
+
* @returns Difference vector as [a_x - b_x, a_y - b_y, a_z - b_z]
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* subVec([4, 3, 0], [1, 0, 0]) // [3, 3, 0]
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function subVec(a: Vector3Tuple, b: Vector3Tuple): Vector3Tuple;
|
|
42
|
+
/**
|
|
43
|
+
* Create an array of evenly spaced values (NumPy linspace equivalent).
|
|
44
|
+
*
|
|
45
|
+
* @param start - Start value
|
|
46
|
+
* @param stop - End value (inclusive)
|
|
47
|
+
* @param num - Number of points to generate
|
|
48
|
+
* @returns Array of `num` evenly spaced values from `start` to `stop`
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* linspace(0, 10, 5) // [0, 2.5, 5, 7.5, 10]
|
|
53
|
+
* linspace(0, 1, 3) // [0, 0.5, 1]
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function linspace(start: number, stop: number, num: number): number[];
|
|
57
|
+
//# sourceMappingURL=vectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vectors.d.ts","sourceRoot":"","sources":["../../src/utils/vectors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,GAAG,YAAY,CAExE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,GAAG,IAAI,EAAE,YAAY,EAAE,GAAG,YAAY,CAQ5D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,GAAG,YAAY,CAErE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAG3E"}
|
package/package.json
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "manim-web",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Manim-like mathematical animation library for the web",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./react": {
|
|
16
|
+
"types": "./dist/integrations/react.d.ts",
|
|
17
|
+
"import": "./dist/integrations/react.js",
|
|
18
|
+
"default": "./dist/integrations/react.js"
|
|
19
|
+
},
|
|
20
|
+
"./vue": {
|
|
21
|
+
"types": "./dist/integrations/vue.d.ts",
|
|
22
|
+
"import": "./dist/integrations/vue.js",
|
|
23
|
+
"default": "./dist/integrations/vue.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"dev": "vite",
|
|
31
|
+
"build": "tsc && vite build",
|
|
32
|
+
"preview": "vite preview",
|
|
33
|
+
"typecheck": "tsc --noEmit",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"test:coverage": "vitest run --coverage",
|
|
36
|
+
"test:watch": "vitest",
|
|
37
|
+
"lint": "eslint src/",
|
|
38
|
+
"lint:fix": "eslint src/ --fix",
|
|
39
|
+
"format": "prettier --write src/",
|
|
40
|
+
"docs": "node scripts/generate-example-docs.mjs && cd website && npm run build",
|
|
41
|
+
"docs:dev": "node scripts/generate-example-docs.mjs && cd website && npm start",
|
|
42
|
+
"docs:examples": "node scripts/generate-example-docs.mjs",
|
|
43
|
+
"cpd": "jscpd src/",
|
|
44
|
+
"test:integration": "npx playwright test",
|
|
45
|
+
"format:check": "prettier --check src/",
|
|
46
|
+
"knip": "knip",
|
|
47
|
+
"release": "standard-version",
|
|
48
|
+
"release:minor": "standard-version --release-as minor",
|
|
49
|
+
"release:major": "standard-version --release-as major",
|
|
50
|
+
"prepare": "husky"
|
|
51
|
+
},
|
|
52
|
+
"lint-staged": {
|
|
53
|
+
"*.{ts,tsx}": [
|
|
54
|
+
"eslint --fix",
|
|
55
|
+
"prettier --write"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"earcut": "^3.0.2",
|
|
60
|
+
"gif.js": "^0.2.0",
|
|
61
|
+
"katex": "^0.16.28",
|
|
62
|
+
"opentype.js": "^1.3.4",
|
|
63
|
+
"polygon-clipping": "^0.15.7",
|
|
64
|
+
"three": "^0.182.0"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@eslint/js": "^9.39.2",
|
|
68
|
+
"@playwright/test": "^1.58.2",
|
|
69
|
+
"@types/earcut": "^3.0.0",
|
|
70
|
+
"@types/katex": "^0.16.8",
|
|
71
|
+
"@types/react": "^19.2.13",
|
|
72
|
+
"@types/three": "^0.182.0",
|
|
73
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
74
|
+
"eslint": "^9.39.2",
|
|
75
|
+
"eslint-config-prettier": "^10.1.8",
|
|
76
|
+
"husky": "^9.1.7",
|
|
77
|
+
"jscpd": "^4.0.8",
|
|
78
|
+
"knip": "^5.83.1",
|
|
79
|
+
"lint-staged": "^16.2.7",
|
|
80
|
+
"prettier": "^3.8.1",
|
|
81
|
+
"standard-version": "^9.5.0",
|
|
82
|
+
"typedoc": "^0.28.16",
|
|
83
|
+
"typescript": "^5.3.0",
|
|
84
|
+
"typescript-eslint": "^8.54.0",
|
|
85
|
+
"vite": "^7.3.1",
|
|
86
|
+
"vite-plugin-dts": "^4.5.4",
|
|
87
|
+
"vitest": "^4.0.18",
|
|
88
|
+
"vue": "^3.0.0"
|
|
89
|
+
},
|
|
90
|
+
"peerDependencies": {
|
|
91
|
+
"react": ">=18.0.0",
|
|
92
|
+
"vue": ">=3.0.0"
|
|
93
|
+
},
|
|
94
|
+
"peerDependenciesMeta": {
|
|
95
|
+
"react": {
|
|
96
|
+
"optional": true
|
|
97
|
+
},
|
|
98
|
+
"vue": {
|
|
99
|
+
"optional": true
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"repository": {
|
|
103
|
+
"type": "git",
|
|
104
|
+
"url": "https://github.com/maloyan/manim-js.git"
|
|
105
|
+
},
|
|
106
|
+
"homepage": "https://maloyan.github.io/manim-js/",
|
|
107
|
+
"bugs": {
|
|
108
|
+
"url": "https://github.com/maloyan/manim-js/issues"
|
|
109
|
+
},
|
|
110
|
+
"keywords": [
|
|
111
|
+
"animation",
|
|
112
|
+
"math",
|
|
113
|
+
"visualization",
|
|
114
|
+
"manim",
|
|
115
|
+
"threejs",
|
|
116
|
+
"webgl",
|
|
117
|
+
"3blue1brown",
|
|
118
|
+
"mathematical-animations",
|
|
119
|
+
"typescript"
|
|
120
|
+
],
|
|
121
|
+
"license": "MIT"
|
|
122
|
+
}
|