A library for creating animated visualizations of mathematical curves and concepts using Plotly.
Project description
[TOC]
funJplot
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)
- Rotation of a vector (
- Integrated user interface with Play/Pause buttons and sliders to control the animation in Jupyter.
- Uses
plotlyfor 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file funjplot-0.0.0.4.tar.gz.
File metadata
- Download URL: funjplot-0.0.0.4.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44a199cdb53699f2f78e242deec8799cb1aa1af1fe32ddd70d8636ae334d967d
|
|
| MD5 |
8007f55737f1ab1dd0098b236aedd6bb
|
|
| BLAKE2b-256 |
28345b73925808cf41986180369a74fd4c98a2d37872afefdf53eaad497f3437
|
File details
Details for the file funjplot-0.0.0.4-py3-none-any.whl.
File metadata
- Download URL: funjplot-0.0.0.4-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7289f0f490d58ff4779d45a4cde354863ac47bd13c6a972b8d9eef9f48fbee0a
|
|
| MD5 |
18787782e7f2e2eddf8168375f7d4fa6
|
|
| BLAKE2b-256 |
e738c8e07b225819cc007c07dcf98ba2b0f51b3dc95402c7abb3a669f43a8d7f
|