Metadata-Version: 2.4
Name: pyd3js-contour
Version: 0.1.0
Summary: Python port of d3-contour
Project-URL: Repository, https://github.com/eddiethedean/pyd3js
Project-URL: Homepage, https://github.com/eddiethedean/pyd3js/tree/main/packages/pyd3js-contour
Project-URL: Changelog, https://github.com/eddiethedean/pyd3js/blob/main/packages/pyd3js-contour/docs/CHANGELOG.md
Author: pyd3 contributors
License: ISC License
        
        Copyright (c) 2026, pyd3 contributors
        
        Permission to use, copy, modify, and/or distribute this software for any
        purpose with or without fee is hereby granted, provided that the above
        copyright notice and this permission notice appear in all copies.
        
        THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
        REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
        AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
        INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
        LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
        OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
        PERFORMANCE OF THIS SOFTWARE.
License-File: LICENSE
Keywords: contour,d3,d3-contour,density,visualization
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: ISC License (ISCL)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: pyd3js-array>=0.1.0
Description-Content-Type: text/markdown

# pyd3js-contour

[![PyPI version](https://img.shields.io/pypi/v/pyd3js-contour.svg)](https://pypi.org/project/pyd3js-contour/)
[![Python versions](https://badgen.net/pypi/python/pyd3js-contour)](https://pypi.org/project/pyd3js-contour/)
[![License](https://img.shields.io/pypi/l/pyd3js-contour.svg)](https://pypi.org/project/pyd3js-contour/)
[![CI](https://github.com/eddiethedean/pyd3js/actions/workflows/ci.yml/badge.svg)](https://github.com/eddiethedean/pyd3js/actions/workflows/ci.yml)
[![Security](https://github.com/eddiethedean/pyd3js/actions/workflows/security.yml/badge.svg)](https://github.com/eddiethedean/pyd3js/actions/workflows/security.yml)

Python port of [`d3-contour`](https://github.com/d3/d3-contour).

Release notes: [`docs/CHANGELOG.md`](docs/CHANGELOG.md).

Tracked version: see [`upstream_lock.json`](../../upstream_lock.json).

## Public API

Matches **`d3-contour@4.0.2`** named exports (`contours`, `contourDensity` only). Method-level surface is documented in [`docs/UPSTREAM_API.md`](docs/UPSTREAM_API.md).

```python
from pyd3js_contour import contourDensity, contours

c = contours().size([10, 10]).thresholds([0.5])
polys = c([0.0] * 100)

d = contourDensity().thresholds([0.01, 0.05])
density_polys = d([[50.0, 50.0]])
```

## Compatibility matrix

Upstream export inventory (`docs/UPSTREAM_API.md`):

- `contours` — [oracle]
- `contourDensity` — [oracle]

## Development

From the repo root:

```bash
uv sync --group dev
uv run pytest packages/pyd3js-contour/package_tests --cov=pyd3js_contour --cov-report=term-missing
```

Optional upstream JS gate (vendored `d3-contour` + `npm install` under `packages/pyd3js-contour/upstream/d3-contour`):

```bash
uv run pytest packages/pyd3js-contour/package_tests -m upstream
```

The npm package name on the registry is `d3-contour`; this package mirrors that API in Python.
