Skip to main content
Light Mode Logo

PyPI Latest Release MIT License Code style: black Documentation Status Downloads

A plugin that contains common data structures to create Manimations.

Installation

To install, simply run the following command:

pip install manim-data-structures

Importing

Simply use the following line of code to import the package:

from manim_data_structures import *

Usage

Code

class MainScene(Scene):
    def construct(self):
        # Create an array
        arr = MArray([8, 7, 6, 5, 4])
        self.play(Create(arr))

        # Animate array
        self.play(arr.animate.shift(UP * 2.5 + LEFT * 5))

        # Animate array element
        self.play(arr.animate_elem(3).shift(DOWN * 0.5))

        # Animate array element mobjects
        self.play(arr.animate_elem_square(0).set_fill(BLACK), arr.animate_elem_value(0).rotate(PI / 2).set_fill(RED), arr.animate_elem_index(0).rotate(PI / 2))

        # Display array with hex values
        arr2 = MArray([0, 2, 4, 6, 8], index_hex_display=True, index_offset=4)
        self.play(Create(arr2))
        self.play(arr2.animate.shift(DOWN * 2.5 + LEFT * 5))

        # Create customized array
        arr3 = MArray([1, 1, 2], mob_square_args={'color': GRAY_A, 'fill_color': RED_E, 'side_length': 0.5}, mob_value_args={'color': GOLD_A, 'font_size': 28}, mob_index_args={'color': RED_E, 'font_size': 22})
        self.play(Create(arr3))

        # Append element
        self.play(Write(arr2.append_elem(10)))

        # Append customized element
        self.play(Write(arr2.append_elem(12, mob_square_args={'fill_color': BLACK})))

        # Update value of element
        self.play(Write(arr2.update_elem_value(3, 0, mob_value_args={'color': RED})), arr2.animate_elem_square(3).set_fill(WHITE))

        self.wait()

Output

https://user-images.githubusercontent.com/56049229/203757924-6f3aed6d-e870-468f-a269-a572350355b1.mp4

Other Links

Release files for manim-data-structures 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for manim-data-structures 0.1.7
File Size Uploaded
manim_data_structures-0.1.7.tar.gz 15.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for manim-data-structures 0.1.7
File Interpreter ABI Platform
manim_data_structures-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size:31.4 kB

Release files / manim_data_structures-0.1.7.tar.gz

Download URL manim_data_structures-0.1.7.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
54cd7658e6c31c90225d9ff16bb0eba08672deda14bb0e70b34812cdcc5e20b2
BLAKE2b-256 checksum
How to use checksums
5b9418b3d2eca5ee72f69851a43165828e0c63f8aa447abccfd041c11907927d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.10.9 Linux/5.15.0-1023-azure

Release files / manim_data_structures-0.1.7-py3-none-any.whl

Download URL manim_data_structures-0.1.7-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44b85b499a0e0f4af749b5ce2851e23b0fa312f4f187810d7560312f755bd913
BLAKE2b-256 checksum
How to use checksums
d5fa9adb743710c58f8bc03a756406256ac7ffa5cb10cdc1283ead66918759c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.10.9 Linux/5.15.0-1023-azure

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page