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 (it might not be available on PyPI until your first release):

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.3.tar.gz (10.4 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.3-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: funjplot-0.0.0.3.tar.gz
  • Upload date:
  • Size: 10.4 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.3.tar.gz
Algorithm Hash digest
SHA256 727394fbb3dd05d86c7d62557cfb28702d9a791d220a4971007e9fc5dc06a6d7
MD5 4eb0e67d4d731f0c1e7ed969f1a69a4d
BLAKE2b-256 f26675a3ca37f7c214199eb914c2a7151a2ed6cb0e4b442c4eff38a004a2da39

See more details on using hashes here.

File details

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

File metadata

  • Download URL: funjplot-0.0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8188fcae83c1d4e5dcf85cb375eb0f55bfab1da700a3fd1dacf2e46e18e09e5c
MD5 088e9a6cf0f9dc8953742b7a7973858a
BLAKE2b-256 ded91ab2cf53692b6cd2744a740e4140c63a37c68edba3eb28a2a3b8e77a21dd

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