Metadata-Version: 2.4
Name: fastplotpy
Version: 0.4.0a2
Summary: Python port of fastPlotJs chart scenes and interactive charts
Author: Intellisys Software
License-Expression: MIT
Project-URL: Homepage, https://fastplotjs.com/
Project-URL: Documentation, https://github.com/Tsetkhalin79/fastPlotPy#readme
Project-URL: Source, https://github.com/Tsetkhalin79/fastPlotPy
Project-URL: Issues, https://github.com/Tsetkhalin79/fastPlotPy/issues
Project-URL: Releases, https://github.com/Tsetkhalin79/fastPlotPy/releases
Keywords: canvas,charting,charts,data-visualization,jupyter,plotting,png,python,rust,server-side-rendering,svg,visualization,webassembly,webgl
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: notebook
Requires-Dist: ipython>=8; extra == "notebook"
Requires-Dist: ipywidgets>=8; extra == "notebook"
Provides-Extra: test
Requires-Dist: Pillow>=10; extra == "test"
Dynamic: license-file

# FastPlotPy

Server-side export provides `renderLineToSVG` / `renderLineToPNG`,
`renderBarToSVG` / `renderBarToPNG`, `renderPieToSVG` / `renderPieToPNG`,
`renderPolarToSVG` / `renderPolarToPNG`, `renderHeatmapToSVG` /
`renderHeatmapToPNG`, and `renderWonderplotToSVG` / `renderWonderplotToPNG`.
These functions use the shared Rust renderer without a browser. SVG is text;
PNG is image bytes. They require the native library and use a bounded server
contract, distinct from interactive chart options. See the repository server
rendering documents for each family's inputs and limits. The legacy
`renderToPNG()` still returns serialized JSON, not PNG. Published native
platform evidence is Windows x64; an unreleased Linux x86_64 source-to-wheel
install passed server exports on Ubuntu/WSL with CPython 3.12. macOS remains
unverified. Five 3D families remain experimental.

Source installations on Linux build the bundled Rust ABI when Cargo is
available. The macOS source-build path exists but has not been validated on a
macOS machine. The build checks the pinned Rust snapshot and lockfile, then
compiles the checksum-verified ICU source with a C/C++ compiler and `make`.
Linux also needs `python3` for archive extraction; the macOS path uses `ditto`.
A successfully built platform wheel includes its native library beside the
Python code.
Without a matching native library, server export raises
`ServerLineExportError` with code `NATIVE_UNAVAILABLE`.

```python
from fastplotpy import renderLineToSVG, renderLineToPNG
options = {"traces": [{"points": [[0, 1], [1, 2]]}]}
svg = renderLineToSVG(options)
png = renderLineToPNG(options)
```

FastPlotPy is the Python port of FastPlotJs for renderer-neutral scene generation and browser/Jupyter charts. Install the latest published alpha from PyPI with:

```sh
python -m pip install --pre --upgrade fastplotpy
```

In Python or Jupyter:

```python
from fastplotpy import createChart

chart = createChart({
    "type": "line",
    "width": 800,
    "height": 400,
    "engine": "auto",
    "data": [{"x": 0, "y": 12}, {"x": 1, "y": 18}],
    "axes": {"show": True},
})
chart  # Jupyter displays the interactive browser view.
```

The local chart view uses the pinned FastPlotJs browser frontend for Canvas,
pointer, and WebGL behavior. Its loopback bridge binds to `127.0.0.1` for the
chart session. Python owns scene and state APIs; source frontend callbacks can
invoke Python formatters. Browser WebAssembly is separate from the optional
Python-host Rust core and is not initialized by `initWasmPlotEngine()` in CPython.
The source-named `hasNodePlotEngine()` and `initNodePlotEngine()` are Python
compatibility aliases for `hasRustPlotEngine()` and `initRustPlotEngine()`;
they do not start or require Node.js. `getRustPlotEngineStatus()` reports host
native capabilities. `getWasmPlotEngineStatus()` reports CPython availability,
not the state of the separate browser frontend.

Without a browser, `plot()` produces a renderer-neutral scene:

```python
from fastplotpy import plot

scene = plot({
    "type": "line",
    "width": 800,
    "height": 400,
    "engine": "ts",  # Source spelling selects the Python fallback geometry.
    "data": [{"x": 0, "y": 12}, {"x": 1, "y": 18}],
})
```

Current Python geometry covers all eleven source chart families, including
source-documented 3D LOD, encodings, lighting, accessibility, and multiple
subplots. No chart calculation invokes Node.js at package runtime. Strict
`engine="rust"` uses the optional pinned Rust core
for supported 2D families and fails explicitly when unavailable. Pie3D reuses
`pie` datum and presentation options, accepts `pie3d.extrusionDepth` in
`(0, 1]`, and uses the shared `scene3d.camera`. The native 3D PNG path has
Windows validation only. `renderToPNG()` retains the source placeholder behavior.

The source project is [FastPlotJs](https://fastplotjs.com). This alpha version is `0.4.0a2`.
Python 3.11 or newer is required. Its Windows wheel includes Python code,
the pinned frontend,
the built Rust ABI library, and the MIT License. The source
distribution includes the pinned Rust sources and lockfile for optional
native builds. Bundled font attribution is in the packaged
`assets/native/THIRD_PARTY_NOTICES.md` file.

## Canvas quality

The pinned browser frontend accepts `canvas: { pixelRatio: "auto", resolutionScale: 2 }` through `createChart`. Omitted ratios default to `1`; logical sizes, text, and pointer coordinates remain unchanged while the backing bitmap scales. Experimental Pie3D also accepts `pie3d: { curveTolerance: 0.1 }` (default `1` logical pixel; smaller means more faces, within `scene3d.maxPoints`). Higher settings use more memory and rendering work. The source browser comparison remains in FastPlotJs. The Python source distribution includes the local Python-backed gallery under `examples/gallery/`; the installed wheel bundles the interactive frontend but does not install the standalone gallery server.
