Commit graph

64 commits

Author SHA1 Message Date
Newell Jensen
57a90b79be
Add SVG elliptical arc support (#1475)
* Add SVG elliptical arc support to svg_path.py

* Add SVG support for elliptical arcs

* Add debug fixes from Mark Miller.  Add sweep limit case for elliptical arcs that are multiple of 90 degrees.

* Add unit test for SVG elliptical arcs.  Add control data.

* Cast type of stroke_width if it is string.

* Fix black and isort.
2021-05-07 23:06:02 +05:30
Benjamin Hackl
40e427f053
Un-deprecated GraphScene (will be deprecated later), fixed an old-style call to NumberPlane (#1430)
* un-deprecate GraphScene

* x_range, y_range shouldn't be numpy arrays

* revert NumberPlane box and minor changes to other classes

* replace width in config with x_length

* fix docs

* fix tests

* remove failing test temporarily

Co-authored-by: hydrobeam <laithbahodi@gmail.com>
2021-05-01 16:22:24 +02:00
hydrobeam
9e88b64cd4
Upgrades to CoordinateSystem and graphing. (#1161)
* coordinate_systems.py

* number_line.py

* functions.py

* forgot to remove logging

* remove mutables in UnitInterval and restore things that shouldn't have been factored out

* visual changes + add backup in case only two args are given to x_range

* test_axes.py test reworked

* test_axes.py add tips

* coordinate_system + systems test and minor update to .py

* test_functions and mini-rework of funtions.py

* black and graph_scene test

* add defaults for threeDaxes

* all tests pass, threed updates

* make graphscene functional

* formatting

* test_axes_shift fix

* fix the broken test_axes_shift and docs

* forgot negative in docs

* missing commas

* fix broken example in graphscene.py

* forgot comma... again

* line_projection, import cleanup, and variable cleanup

* get_tick_range all numbers

* revert examples.rst

* restore GraphScene, deprecate it, introduce OldNumberLine

* rever test_axes_shift.py

* test_graphscene_reverted

* poetry error

* test_coord_system fix (?)

* unecssary import in graphscene

* black

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix tests (?)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add rounding for default coord_range + projection docs

* adjust test for rounding

* add zero fix

* used wrong fix

* set_length instead of rescale_to_fit

* fix improper coordinates for default NumberPlane

* update test

* adjust defaults for NumberLine and introduce dynamic scaling

* test adjusted

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* explanations + create axis docs

* parameters for NumberLine`

* NumberPlane documentation mods

* ThreeDAxes docs

* all done

* add colon for docs

* switch oldNUmberLine to NumberLineOld

* docs update for NumberLineOld

* Update manim/mobject/number_line.py

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Update manim/mobject/number_line.py

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* Update manim/mobject/number_line.py

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* suggestions from code review

* missing period

* adjust wording for create_axis

* fix merge conflict (?)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-04-30 20:40:51 +02:00
Anton Ballmaier
03390f2751
Overhaul of the animation.indication module interfaces (#1383)
* test

* revert test changes

* Add Circumscribe, Deprecate others
Depreated:
   AnimationOnSurroundingRectangle
   ShowPassingFlashAround
   ShowCreationThenDestructionAround
   ShowCreationThenFadeAround

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add example and docs to Circumscribe

* Docs & Example FocusOn

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Docs & Example Indicate

* Fix Flash not using the given stroke_width

* Change the meaning of flash_radius to the inner radius

* Adjust flash_radius accordingly

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix runtime not working and add time_width to Flash

* finish Flash

* add second example to Flash

* Deprecate CircleIndicate

* Finish ShowPassingFlash

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Rework ApplyWave & Docs & Examples

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Finish Wiggle

* Fix docs inconsistancies

* black

* Add overview example

* fixe flake8 error

* Renew Test Data

* fix test scene

* try to fix test circumscribe problem

* tests behave weird...

* test without circumscribe

* add new test to circumscribe

* Explain wave code

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removed already done TODO

* Change circumscribe to require shape to be a type

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Restart CI

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-04-29 12:42:46 +02:00
Darylgolden
a43d7d3e75
Added :class:Polyhedron, and platonic solids :class:Tetrahedron, :class:Octahedron, :class:Icosahedron and :class:Dodecahedron (#1348)
* Rudimentary polyhedra class

* Move to own file + more polyhedra

* Icosahedron

* More polyhedra and renaming to singular form

* Changes

* Revert changes to graph

* Fix put_start_and_end_on and attempt to add updaters

* Update polyhedra.py

* Try to fix updaters

* Fix attempts

* more attempts

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* More attempts

* I got it to work

* side_length -> edge_length, start doc string

* More docs

* edge_length type hint and **kwargs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Docs title

* Config, docs

* Submobject docs

* Basic examples for the platonic solids

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Tests, black, rm personal test file

* Make pytest work properly

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Try to fix formatting

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Adding information about polyhedra

* Rm unused imports

* Actually finish the comment

* Apply suggestions from code review

Co-authored-by: Naveen M K <naveen@syrusdark.website>
Co-authored-by: kolibril13 <44469195+kolibril13@users.noreply.github.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Type hints for edge_length

* change faces_list type hint

* More typehints

* More typehints

* get_edges return type

* Type hint

* Replace Union[float, int] with float

* Fix typehints and attempt to fix tests

* Import dict from typehints

* Try to fix tests

* Fix typehint for mobject

* Conditional import and vgroup type hint

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Import type_checking

* Retrigger

* Update manim/mobject/polyhedra.py

Co-authored-by: Naveen M K <naveen@syrusdark.website>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: kilacoda <65204531+kilacoda@users.noreply.github.com>
Co-authored-by: Naveen M K <naveen@syrusdark.website>
Co-authored-by: kolibril13 <44469195+kolibril13@users.noreply.github.com>
2021-04-29 10:51:18 +05:30
Darylgolden
a3faf1c9f1
Rewrite put_start_and_end_on to work in 3D (#1355)
* Use built in numpy functions and better angle_between_vectors

* Deleted angle_between since it duplicates the functionality of angle_between_vectors and isn't used anywhere

* Black

* Rewrite put_start_and_end_on to work in 3D

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix imports

* Fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Try to fix tests

* Try to fix tests

* Update geometry.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Try fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix attempt

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Try to fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Trying to fix AGAIN

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* evil hacking fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Retrigger checks

* Added test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Regenerate test data with Dot3D

* Readd angle_between

* Fix imports

* revert back to default vertex type for test

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-04-23 14:13:14 +02:00
Darylgolden
ab1023b135
Added :meth:~.Mobject.match_points (#1364)
* Added become_points and become_style

* Retrigger checks

* Rename become_points to match_points

* Remove become_style

* rm test for become style

* Apply suggestions from code review

Co-authored-by: Abhijith Muthyala <73361366+abhi3019@users.noreply.github.com>

* Try to fix docs

* Revert "Try to fix docs"

This reverts commit f72503ff72.

* Update manim/mobject/mobject.py

Co-authored-by: Abhijith Muthyala <73361366+abhi3019@users.noreply.github.com>

Co-authored-by: Abhijith Muthyala <73361366+abhi3019@users.noreply.github.com>
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
2021-04-19 14:57:35 -07:00
Newell Jensen
90a6aada40
Add SVG <line> element support to :class:~.SVGMobject (#1275)
* Add SVG <line> element support

* Add support for SVG <line> elements to SVGMobject

* Add unit test, unit test SVG file, and unit test data file

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
Co-authored-by: Mark Miller <725mrm@gmail.com>
2021-04-09 14:53:07 -07:00
Benjamin Hackl
7b5d29e9b3
Fix random pipeline TeX failures (#1296)
* try to free us from curse of horse and cucumber

* adapt control data
2021-04-09 10:28:13 +02:00
Anton Ballmaier
cdaf5013f7
Change Brace from Tex to SVG (#1258) (#1260)
* test

* revert test changes

* Rework Brace to use SVG (#1258)

* change import order

* make import relative

* add graphics unit tests

* black tests

* Try to fix flake problem

Co-authored-by: kilacoda <65204531+kilacoda@users.noreply.github.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-04-09 02:31:06 +02:00
Adam Ryczkowski
3af4c867d1
Support for specifying the interpolation algorithms for individual ImageMobjects (#1122)
* Adds support for specifying the interpolation algorithms for individual ImageMobjects.

* Remove setup.py

* Added a proper unit test

* Code formatting

* Adds Doc string

* Test rewritten by  kolibril13

* Added control data to the test

* Replaces string resampling constants with Pillow integers; renames the constants into o 'resampling algorithms'

* Final 'nitpicks'

* ValueError update

* update example

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: kolibril13 <44469195+kolibril13@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-04-08 16:09:09 +02:00
sparshg
08e06e156c
Render image automatically if no animation is played in a scene (#1261)
* Display image instead if attempting to make movie file with no animations

* update

* logging warnings added

* small fixes

* Fix broken test, add suggestions

* ignore skipping if scene finished

* fixes + replace self.play(Anim.. with self.add()

* dummy commit

* explicitly set write_to_movie in manim_directive

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-04-08 11:33:08 +02:00
Abhijith Muthyala
75fd9e2133
Set corners of :class:~.Rectangle in counterclockwise direction (#1249)
* Set corners of Rectangle in counterclockwise direction

* Update test data for RoundedRectangle

* Update test data for HomotopyTest

* Update test data for MoveAlongPathTest

* Update data for Cube related tests

* Fix failing doctest
2021-04-06 12:27:55 +02:00
Mark Miller
d8d9a01b9a
Enable CI testing for OpenGL (#1160)
* add simple circle test for opengl

* literally a comma

* add rgb tolerance to graphical unit tester

* start up xvfb on ubuntu?

* black style

* reduce tolerance to pixel ?

* add msys2 action

* add mesa install

* ci: windows add msys2 to path
Compile moderngl from source
add a init tests for CI to work
add colour to pytest

* minor edits

* mild refactor of scene / camera / renderer relationship

* flake-d

* reverted refactor

* reverted opengl split at the level of graphical unit tester

* remove unnecessary config in definition

* CI: remove python3 from MSYS2 also

Co-authored-by: Naveen M K <naveen@syrusdark.website>
2021-03-28 22:09:29 +02:00
Darylgolden
f98cb1eadc
Added 3D Mobject :class:~.Dot3D (#1097)
* Added Dot3D and SmallDot3D

* Remove wrong test data

* Revert changes to graphical units template

* Remove SmallDot3D per consensus

* Apply suggestions from code review

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>

* Fix unclosed docstring

* Fix Dot3D

* Attempt to fix linting

* Revert "Attempt to fix linting"

This reverts commit 6c23d653b4.

* Retrigger checks

* Add example

* Update three_dimensions.py

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
Co-authored-by: WampyCakes <WampyCakes@users.noreply.github.com>
2021-03-27 02:06:33 +01:00
Kapil Sachdeva
c3f6119761
Added support for multiple transforms in the same SVG element (#1159)
* fix - in handle_transforms, add the support to parse multiple transforms from one attribute value

* further refactor the handle_transform; add a test svg with multiple transforms

* correction to the function doc regarding supported transforms

* fix the typo in the test name

* add tests for rotate, skewX & skewY transforms and emit a warning message that they are not supported yet

* add tests for translate, matrix and scale transforms / fix the handling of translate transform
2021-03-25 16:46:39 -07:00
Lionel Ray
39351b0202
Deprecation: Deprecated ShowCreation in favor of Create, added logger warning (#1124)
* Deprecated ShowCreation in favor of Create

* Fixed Black formatting and logger error

* Fixed relative import issue of logger

* Renamed CreateThen.. calls to previous names

* Fixed __all__ classes, fixed Create inheritance

* Update manim/animation/creation.py

Move logger warning to class initializer

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
2021-03-23 16:13:59 +01:00
Hugues Devimeux
fc6159b45d
Refactored play logic (#1019)
* refactored play logic

* fixed tests (and minor improvement)

* moved time progression generation

* fixed typo :/

* added tests

* fixed tests

* fixed imports

* fixed tests

* black

* fixed tests in  python 3.7

* fixed tests for python 3.7

* Update manim/renderer/cairo_renderer.py

* removed is_cached variable

* updated webgl renderer and removed redondent code

* Update manim/scene/scene.py

* Add self.duration back into compile_animation_data

* Fixed openGL ?

* black

* fixed merge conflict by adding fixture marker

* Called begin_animation to fix OpenGL

* Fixed original_skippingstatu sname for opengl renderer

* Update manim/utils/caching.py

Co-authored-by: Devin Neal <devin@eulertour.com>

Co-authored-by: Hugues Devimeux <hugues.devimeux@gmail.com>
Co-authored-by: Jason G. Villanueva <a@jsonvillanueva.com>
Co-authored-by: Devin Neal <devin@eulertour.com>
2021-03-23 09:58:49 +01:00
Oliver
776067584e
Added new classes Angle, RightAngle for two intersecting lines (#1085)
* test

* test2

* Added two angle functions

* bug-fix

* bug_fix

* bug-fix

* angle changes

* Added Docstrings

* Run tests

* Update manim/mobject/geometry.py

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>

* Update manim/mobject/geometry.py

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>

* Update manim/mobject/geometry.py

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>

* Update manim/mobject/geometry.py

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>

* Update manim/mobject/geometry.py

Co-authored-by: KingWampy <9156604+WampyCakes@users.noreply.github.com>

* Changed examples

* Added tab

* Changed docstring

* Updated Docstrings

* Updated Docstrings

* Ideas from MrMallIronmaker implemented

* Update manim/mobject/geometry.py

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>

* Change inheritance for Angle

* Added inheritance in Angle

* Black Test

* Update manim/mobject/geometry.py

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>

* Fixed multiple inheritance

* Added Tests

* Black test

* retrigger checks

* Updated docstrings

* updated Docstrings

* Update manim/mobject/geometry.py

Co-authored-by: friedkeenan <friedkeenan@protonmail.com>

* Update manim/mobject/geometry.py

Co-authored-by: friedkeenan <friedkeenan@protonmail.com>

* Update manim/mobject/geometry.py

Co-authored-by: friedkeenan <friedkeenan@protonmail.com>

* Update manim/mobject/geometry.py

Co-authored-by: friedkeenan <friedkeenan@protonmail.com>

* Update manim/mobject/geometry.py

Co-authored-by: friedkeenan <friedkeenan@protonmail.com>

* Update manim/mobject/geometry.py

Co-authored-by: friedkeenan <friedkeenan@protonmail.com>

* Update manim/mobject/geometry.py

Co-authored-by: friedkeenan <friedkeenan@protonmail.com>

Co-authored-by: Pseudodifferent <44864613+Pseudodifferent@users.noreply.github.com>
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
Co-authored-by: KingWampy <9156604+WampyCakes@users.noreply.github.com>
Co-authored-by: friedkeenan <friedkeenan@protonmail.com>
2021-03-16 10:58:22 +01:00
Abhijith Muthyala
783bddebfc
Refactored coordinate_systems.py, fixed bugs, added NumberPlane test (#1092)
* Add function to update a dict recursively with other dicts

* Refactor Axes and NumberPlane

* Fix NumberLine's rotation

* Rotate NumberLine just before adding numbers

* More refactoring

* Add graphical unit test to NumberPlane

* More cleanup and fix range attributes issue(#840)

* Remove overlooked print statements and run black

* Make graphical unit test of NumberPlane more robust

* Shift z_axis to XY-plane's origin and minor refactor in its rotation

* Apply review suggestions
2021-03-15 02:24:16 -07:00
Mark Miller
9358a62c79
Fix #1039 (<span foreground=> tags) (#1058)
* refactor svg def to store element references instead of mobjects

* Refactor svg defaults to parsing instead of cascading

* Break up style attribute before cascading

* add tag inheritance SVG test

* black styling

* MarkupText: Deprecate <color> tag and use <span foreground> instead

* Typo in docstring

* Update examples and docs for MarkupText

* Fix errors in MarkupText examples

* Fixed one more error in the docs

* Improved documentation for MarkupText

* underline_color is now supported
* overline and overline_color are now working
* strikethrough and strikethrough_color are now working
* additional examples for those features

* Fix for docs build

* Use existing logger.

* revisions from feedback set 1

* delete style from cascading attributes again (it is parsed but not cascaded)

* Reinterpret stroke=none as stroke-width=0 and opacity=1

* Update use tag test to handle two more cases

Co-authored-by: Philipp Imhof <52650214+PhilippImhof@users.noreply.github.com>
2021-03-01 13:29:33 +05:30
Darylgolden
9006441c4f
Add 3D Mobjects - Cone, Cylinder, Line3D, Arrow3D and Torus. (#1026)
* Added new 3D mobjects: mostly taken from dor2727's previous incomplete PR

* Added Torus from 3b1b manim

* Added tests

* Remove personal test file

* Ran black

* Added test for Arrow3D

* Apply suggestions from code review

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>

* Black formatting

* Added documentation, tests failing?

* Added documentation, tests fixed

* Rename self.height to self._height

* Removed unnecessary property.

* Fixed tests

* Apply suggestions from code review

Co-authored-by: friedkeenan <friedkeenan@protonmail.com>

* Black

* Apply suggestions from code review

Simple changes for now

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>

* Apply suggestions from code review

Possibly breaking changes

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
Co-authored-by: friedkeenan <friedkeenan@protonmail.com>

* Update manim/mobject/three_dimensions.py

Fix indentation

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>

* Update manim/mobject/three_dimensions.py

Fix indentation

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>

* Fix things

* Change parameter names for Torus

* Added get_direction method for Cylinder and fixed direction setting

* retrigger checks

* Update manim/mobject/three_dimensions.py

remove dead comment

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
Co-authored-by: friedkeenan <friedkeenan@protonmail.com>
2021-02-28 03:42:17 -08:00
Mark Miller
9b02aea5a6
SVG engine rewrite and tests (#915)
* added many svg test images

* Added test for the Rhomboid

* Fixed multi-point lists of L type

* Two more svg files

* Also ignore pycharm-specific project information

* Allow skipping of tests with a pytest_skip class attribute

* Stubbed a couple tests out before rewrite

* Rewrite of SVG path midlayer

* refactored old test name

* Added tests for two more files

* Bugfix for absolute H/V paths

* small refactor of cubics

* Enabled correct quadratic bezier functionality.

* Black formatting

* Test the SVG smoothed curves (S and T)

* handful more tests

* Add all Discord svg tests

* Update manim/mobject/types/vectorized_mobject.py

Co-authored-by: Leo Torres <dleonardotn@gmail.com>

* Apply suggestions from code review 1

Co-authored-by: Leo Torres <dleonardotn@gmail.com>

* Remove files of questionable origin

* rolled back review change due to ValueError

* Added entries from the SVG Support github project

* smaller fixes from review #1

* Enabled fill and stroke.

* Troubles with the use of "currentcolor" - for now we wont support it

* Minimize visual effect of downstream changes on Tex

* Style changes ordered by Black

* fixed background opacity handling

* enable coloring of circles

* Remove periodic table test (requires text)

* Update documentation

* refactored bare exception catch

* Rolling back the pytest_skip functionality

* Document some less obvious unit tests

* fixing leo's rec

* edit to penrose triangle test

* Don't copy the list, copy the objects in the list.

* black styling

* Include defs in tree parsing

* Update default svg values for visibility in test.

* black formatting

* Interpret RGB percentages

* mild fix to for btd rebuild.

* Force family update for classes that inherit SVGMobjects in order to preserve behavior.

* Apply suggestions from code review 2

Co-authored-by: Naveen M K <naveen@syrusdark.website>
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>

* make static parsing methods into object methods, and add typing

* Add typing to use_to_mobject which misled me earlier, and fix documentation merge error

* Apply suggestions from code review 3

Co-authored-by: Naveen M K <naveen@syrusdark.website>

* black fix

* add types for quadratic bezier

* prevent fail after matrix transform

* Add UK Flag Test

* black style

* remove DEFAULT SVG STYLE and converted to inline argument.

* Remove useless comments.

* Refactor svg_mobject.py into multiple files.

* documentation and typings

* black styling

* allow floats in rgb pct specification

* parse floats like 2.4.3 into 2.4 0.3, with test

* update typing for SUPPORTED_STYLING_ATTRIBUTES

Co-authored-by: Naveen M K <naveen@syrusdark.website>

* forgot import List from typings

Co-authored-by: Leo Torres <dleonardotn@gmail.com>
Co-authored-by: Naveen M K <naveen@syrusdark.website>
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
2021-02-26 22:22:09 +05:30
Abhijith Muthyala
dd74b00172
Enhancement: Remove redundancy in FunctionGraph arguments (#1018)
* Fix x_min, x_max and color of FunctionGraph

* Add graphical unit test to FunctionGraph

* Apply review suggestions

* Pass color as argument instead of updating kwargs and run black
2021-02-14 12:36:16 +01:00
sparshg
dcef4077c4
Bugfix: make sure last frame for animations with updaters is correct (#983)
* Fix last frame issue

* Add tests

* black

* black
2021-02-10 17:42:40 +01:00
sparshg
ff1696c065
can't pass list of colors in set_color() fixed (#993)
* can't pass list of colors in set_color() fixed

* Add gradient test

* black

* black
2021-02-08 22:50:36 +01:00
Hugues Devimeux
9687bd427c
Bugfix: Several fixes and improvements for PointCloundDot (#947)
* fixes #946

* updated default values for pointCloud

* fix overlap in the pointCloud

* added tests

* run my buddy black

* adressed suggestions

Co-authored-by: Hugues Devimeux <hugues.devimeux@gmail.com>
2021-01-26 20:31:39 +01:00
kolibril13
691db1e461
Run proofreading over the whole library (#890) 2021-01-01 17:59:12 +01:00
Devin Neal
2faa89e3d3
Allow for chaining _AnimationBuilder (#889)
* Allow for chaining _AnimationBuilder

* Add _AnimationBuilder.build()

* Apply docs patch

* fix play call with multiple .animate for the same mobject

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2021-01-01 16:18:26 +01:00
Benjamin Hackl
e16f9a6cc4
Basic implementation of undirected graphs (#861)
* toying around with a graph using networkx layouting

* basic implementation and documentation of a class for undirected graphs

* import graph module into global namespace

* add graph module to documentation

* poetry: add networkx as a dependency

* remove some debug prints

* sort all extracted mobjects w.r.t. z_index

* add test for z_index (from #327)

* more complex z_index test

* black

* improve imports

* use z_index to have edges below vertices

* add type hints

* rename some tests to make space for graph tests

* fix problem with manual positioning

* add test

* black

* new animate syntax

* document label_fill_color
2020-12-31 21:10:41 +01:00
Devin Neal
f42bd0579d
Updaters fix (#838)
* Fix --use_js_renderer and create JsRenderer

* In need of an abstract method for saving static frame data

* Barebones js renderer with no effect

* Restore simple JS functionality

* Preparing to send frame data to JS

* Restore progress after merge

* Restore ability to play animations

* Properly set wait duration

* Pass animation_offset to JS

* Allow for playing a range of animations

* Update RPCs

* Play scene on modification

* Send correct duration to JS on animation finish

* Copy keyframes prior to updating

* Play scene on update

* Allow for image previews

* Don't attempt to serialize ValueTracker

* Cache previously used scene

* Add ImageMobject functionality

* Clear scene caching when regenerating keyframe data

* Remove extraneous changes

* Update for doctests

* Format generated files

* Add http server for media

* Update moving_mobjects in Scene.add()

* Remove unused function

* black

* Add test
2020-12-30 20:49:19 +01:00
kolibril13
2657229c48
Added Fading example and removed Fade methods (deprecation) (#827) 2020-12-22 11:47:25 -05:00
Benjamin Hackl
2c975c200b
Properly respect submobjects when sorting by z_index (#872)
* sort all extracted mobjects w.r.t. z_index

* add test for z_index (from #327)

* more complex z_index test

* black

* propagate z_index from MathTex to TexSymbol
2020-12-22 13:36:06 +01:00
kolibril13
20f8af0596
Better creation Example in docs & buff parameter in arrange (#825) 2020-12-05 17:48:05 +01:00
kolibril13
5b384cfe03
Making test for Imagemobject and SVGMobject (#652)
* added get_project_root

* run black

* added svg_mobject and imagemobject

* added svg_mobject

* added svg test

* removed redundant file

* moved get_project_root to test helpers

* moved get_project_root to test helpers

* test for imagemobject

* black

* new image

* small fix

* advenced test added

* Removed redundant test and make space

* fixed docs inline code

* final change

* applied some review changes

* added hint to test
2020-11-07 20:24:18 +01:00
Leo Torres
d0e04f8cc6
Document config system (#659)
* rename config subpkg to _config for the time being
* Revamp documentation for configuration system modules and classes.  Revamp tutorial.  Update changelog
* use as_posix so that doctests will pass on Windows
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: kolibril13 <44469195+kolibril13@users.noreply.github.com>
2020-11-06 21:56:12 -05:00
kolibril13
fe9d2b5f37 use circle instead 2020-11-05 19:07:48 +01:00
kolibril13
ab89834a7a used Text instead 2020-11-05 18:48:49 +01:00
kolibril13
51619f80ba new test data 2020-11-05 18:33:04 +01:00
BrendanMartin
3d2a6d3dd1 test for fixed 3d text 2020-11-03 16:07:51 -05:00
BrendanMartin
096ce035f9 ThreeDCamera move bug fix 2020-11-03 12:54:56 -05:00
Philipp Imhof
e2759ad7ef
graph_scene: correct placement of labels (#661)
* graph_scene: correct placement of labels

* Update test reference data

* Add test for axes and their labels

* black

* removing commented lines for generation of reference data

Co-authored-by: Leo Torres <dleonardotn@gmail.com>

* black

* do not shift labels onto screen

if user wants the label above the y axis, it should go there, even if there is not enough space. they can still choose another placement

* updated test and reference data for test_axes

Co-authored-by: Leo Torres <dleonardotn@gmail.com>
2020-11-03 13:19:29 +01:00
Benjamin Hackl
a65e48a991 convert test data to compressed format 2020-10-30 11:26:49 +01:00
kolibril13
797a31b0ac
New features: AnnotationDot and LabledDot (#462)
* New features: AnnotationDot and LabledDot
Co-authored-by: Nilay <bhatianilay@gmail.com>
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
2020-10-30 09:35:02 +01:00
leotrs
276e0f1329 Merge branch 'master' into feat-manim-configdict 2020-10-27 21:27:05 -04:00
Devin Neal
076a39c277
Fix become bug (#614)
* Fix become bug

* added a test for the become method

* Add test

* Remove test

* Add test again

* Remove test again

* Add test again again

Co-authored-by: kolibril13 <jan-hendrik.mueller@gmx.net>
2020-10-27 11:04:40 -07:00
leotrs
12e1e528eb merge master 2020-10-26 17:46:00 -04:00
leotrs
0222423687 add new test data 2020-10-26 17:11:41 -04:00
Benjamin Hackl
84b3dee8ac
Switch to compressed numpy arrays for test control data (#623)
* typos and doc formatting

* save and load compressed control data

* replace control data by compressed control data
2020-10-26 21:36:13 +01:00
leotrs
182ff88879 merge master 2020-10-25 14:29:57 -04:00