Skip to main content

Python port of d3-ease

Project description

pyd3js-ease

PyPI version Python versions License CI Security

Python port of d3-ease.

Tracked version: upstream_lock.json (d3-ease@3.0.1).

What is d3-ease?

d3-ease supplies easing functions: maps (t \in [0,1]) for animations and transitions (polynomial, sinusoidal, exponential, elastic, bounce, etc.). This package mirrors the default export surface of the pinned upstream version for use from Python.

What you get

  • 100% upstream export parity for the pinned d3-ease@3.0.1 (compatibility matrix and docs/UPSTREAM_API.md).
  • 100% line coverage for pyd3js_ease (enforced via --cov-fail-under=100 in this package’s pytest config).
  • Pytest ports of every upstream Mocha file for v3.0.1, plus runnable docs (README + docs/USER_GUIDE.md) checked like pyd3js-array.
  • D3-style ease* names and aliases; polynomial, back, and elastic configurators expose .exponent, .overshoot, .amplitude / .period like upstream (as callable classes in Python).

Install

From PyPI:

pip install pyd3js-ease

The published package has no third-party Python dependencies (standard library only).

Workspace development:

uv sync --group dev

Usage

import pyd3js_ease as d3

print(d3.easeCubicIn(0.5))
print(d3.easeQuad is d3.easeQuadInOut)

p = d3.easePolyIn.exponent(2.5)
print(round(p(0.5), 6))

f = d3.easeElasticIn.amplitude(1.3).period(0.2)
print(round(f(0.5), 6))
0.125
True
0.176777
-0.030303

Compatibility matrix

Pinned upstream inventory: docs/UPSTREAM_API.md.

Legend:

  • [implemented]: ported for the pinned version; covered by Python tests.
  • [missing]: reserved for upstream drift (should not appear for the pinned version).

Upstream exports (d3-ease@3.0.1)

  • easeLinear — [implemented]
  • easeQuad — [implemented]
  • easeQuadIn — [implemented]
  • easeQuadOut — [implemented]
  • easeQuadInOut — [implemented]
  • easeCubic — [implemented]
  • easeCubicIn — [implemented]
  • easeCubicOut — [implemented]
  • easeCubicInOut — [implemented]
  • easePoly — [implemented]
  • easePolyIn — [implemented]
  • easePolyOut — [implemented]
  • easePolyInOut — [implemented]
  • easeSin — [implemented]
  • easeSinIn — [implemented]
  • easeSinOut — [implemented]
  • easeSinInOut — [implemented]
  • easeExp — [implemented]
  • easeExpIn — [implemented]
  • easeExpOut — [implemented]
  • easeExpInOut — [implemented]
  • easeCircle — [implemented]
  • easeCircleIn — [implemented]
  • easeCircleOut — [implemented]
  • easeCircleInOut — [implemented]
  • easeBounce — [implemented]
  • easeBounceIn — [implemented]
  • easeBounceOut — [implemented]
  • easeBounceInOut — [implemented]
  • easeBack — [implemented]
  • easeBackIn — [implemented]
  • easeBackOut — [implemented]
  • easeBackInOut — [implemented]
  • easeElastic — [implemented]
  • easeElasticIn — [implemented]
  • easeElasticOut — [implemented]
  • easeElasticInOut — [implemented]

Python-only exports

The module also documents PolyIn, PolyOut, PolyInOut, BackIn, BackOut, BackInOut, ElasticIn, ElasticOut, ElasticInOut, and __version__ for typing and explicit construction (not separate names in upstream index.js).

Testing

From repo root:

uv run pytest packages/pyd3js-ease/package_tests -q --cov=pyd3js_ease --cov-report=term-missing --cov-fail-under=100
uv run ruff format packages/pyd3js-ease
uv run ruff check packages/pyd3js-ease
uv run ty check packages/pyd3js-ease/src

Documentation

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

pyd3js_ease-0.1.0.tar.gz (422.7 kB view details)

Uploaded Source

Built Distribution

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

pyd3js_ease-0.1.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file pyd3js_ease-0.1.0.tar.gz.

File metadata

  • Download URL: pyd3js_ease-0.1.0.tar.gz
  • Upload date:
  • Size: 422.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for pyd3js_ease-0.1.0.tar.gz
Algorithm Hash digest
SHA256 530d9ac30f880c96188a8585e71523e04132f0b35c4d81dab9d5b14f0942b6aa
MD5 10603a50c756fafb49da3dc9a1df8bbc
BLAKE2b-256 10f5ec212afc81a2becf495f4173514c83383b085fa8f568d3b86546db3cb4c5

See more details on using hashes here.

File details

Details for the file pyd3js_ease-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyd3js_ease-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for pyd3js_ease-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 37ae84c0319eddc0fe977638671592f5869928a24f8e216edb2360f11849c6c5
MD5 b90cd17cb0407b71fa0b200431b6a50b
BLAKE2b-256 d586f2fa274411b2e84859ea7e1e4e69767961c3806d3b014e88bfd9fee15263

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