Skip to main content

A library for creating animated visualizations of mathematical curves and concepts using Plotly.

Project description

[TOC]


funJplot

PyPI version License GitHub Stars

funJplot is a lightweight and simple Python library, specifically designed for creating animations in Jupyter notebooks using NumPy arrays. The main goal is to provide an intuitive tool for learning and visualizing concepts related to mathematical algebra, statistics, and related disciplines.

Warning: Pre-Alpha Stage

This library is currently in the pre-alpha phase. This means that the API may undergo significant changes without notice, and there might be bugs or incomplete features. Use in production environments is discouraged. However, we are excited to share our ongoing work and welcome feedback and contributions from the community.

Key Features (Current)

  • Provides abstract base classes (GeometricAnimation, ParametricCurve) to simplify the creation of geometric animations.
  • Includes concrete implementations for common animations:
    • Rotation of a vector (VectorRotation) the basc example
    • Archimedean spiral (Spiral)
    • Ellipse (Ellipse)
    • Lissajous curves (Lissajous)
    • Lorenz Attractor (LorenzAttractor)
  • Integrated user interface with Play/Pause buttons and sliders to control the animation in Jupyter.
  • Uses plotly for creating interactive graphs and smooth animations.

Installation

You can install funJplot via pip:

pip install funJplot

If you installed from TestPyPI:

pip install -i [https://test.pypi.org/simple/](https://test.pypi.org/simple/) funJplot

Make sure you also have numpy and plotly installed:

pip install numpy plotly

How to Use

Here are some basic examples of how to use the provided classes. Make sure to run these commands in a Jupyter notebook to view the interactive animations.

Example 1: Rotating Vector Animation

from funJplot import VectorRotation

# Create an instance of the vector rotation animation
vector_anim = VectorRotation(frame_count=150, frame_duration_ms=40)

# Show the animation
vector_anim.show()

Example 2: Spiral Animation

from funJplot import Spiral
import numpy as np

# Create an instance of the spiral animation
spiral_anim = Spiral(frame_count=300, frame_duration_ms=25, rotations=5, scale=10, a=0, b=0.4)

# Show the animation
spiral_anim.show()

Example 3: Lorenz Attractor Animation

from funJplot import LorenzAttractor

# Create an instance of the Lorenz attractor animation
lorenz_anim = LorenzAttractor(frame_count=3000, frame_duration_ms=5, scale=40, dt=0.01)

# Show the animation
lorenz_anim.show()

Upcoming Developments (Pre-Alpha Roadmap)

  • Add more geometric animation classes (e.g., linear transformations, waves).
  • Implement basic statistical animations (e.g., evolution of distributions).
  • Improve documentation and provide more examples.
  • Make the API more flexible and configurable.
  • Handle 3D animations.

Build method

Create a virtual environment

python3 -m venv .venv

Activate the environment

source .venv/bin/activate

Update the environment

pip install --upgrade pip

Add install software

pip install -r requirement_build.txt

Create your $HOME/.pypirc file like below or something more customized

[pypi]
  username = __token__
  password = pypi-<Your API key generated from Pypi website>

Build your app

cd src
python3 -m build

If you want to test your library, deactivate current virtual environment and create a new one into dist/ folder then, after the activation of test_venv you can:

VERSION= # version here
cd dist
pip install funjplot-${VERSION}-py3-none-any.whl

Now you can push into your pipy:

python3 -m twine upload  dist/*

Contributions

We are open to contributions and feedback! If you have ideas, suggestions, or have found bugs, feel free to open an issue on GitHub.

License

This project is released under the MIT license.

Thanks to LLM to write some part of code and documentation for this initial version

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

funjplot-0.0.0.6.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

funjplot-0.0.0.6-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file funjplot-0.0.0.6.tar.gz.

File metadata

  • Download URL: funjplot-0.0.0.6.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for funjplot-0.0.0.6.tar.gz
Algorithm Hash digest
SHA256 787e0aa6611389b7f1f7eb6c84e71657a9a0e3c9b93b7c891e0282b188f2b6cb
MD5 b38712699948b33d5976b46538d516fd
BLAKE2b-256 bbf63a3a6c1f144cc2ef19b9c24a39f368bb3dfa05d5bf01d72247623c7ebe0a

See more details on using hashes here.

File details

Details for the file funjplot-0.0.0.6-py3-none-any.whl.

File metadata

  • Download URL: funjplot-0.0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for funjplot-0.0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 288f855e58a468111db6751152ef8a5a539b01092d78c277cba69c0635996cd5
MD5 37df6132a781265d278fcc15786140b9
BLAKE2b-256 8290d341510a498b0a4f4a9eb687a70c9d89c667c2695576a8fcdc18a5185569

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page