Metadata-Version: 2.4
Name: seraplot
Version: 2.4.45
Summary: Rust data visualization framework - The modern Plotly alternative
Author: feur25
License: MIT
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Source Code, https://github.com/seraplots/seraplot

﻿# SeraPlot - High-Performance Visualization & Production-Ready ML

**SeraPlot** is a Rust-native framework that bundles **60+ interactive chart types** and a **complete machine-learning toolkit** in a single binary - no Plotly, no Matplotlib, no scikit-learn dependency. Build dashboards, train models, ship to production, all from one library.

📖 **Full documentation:** https://feur25.github.io/seraplot/introduction.html
📦 **PyPI:** `pip install seraplot` &middot; **npm:** `npm install seraplot`

---

## Why SeraPlot

- **100x to 8000x faster** than Plotly + Matplotlib on chart generation - measured, reproducible.
- **Zero Python dependencies for plots** - every renderer ships as compiled Rust, ready for serverless, edge devices and embedded systems.
- **Plots + ML in one package** - no need to glue 5 libraries together. Visualize, preprocess, train, evaluate from a single `import seraplot as sp`.
- **Production-grade** - online learning (Welford `partial_fit`), incremental encoders, deterministic outputs, zero hidden global state.
- **Multi-target** - Python (PyPI), JavaScript / WebAssembly (npm), C / C++ FFI, C# bindings.
- **Self-contained HTML output** - every chart is a single inlined HTML file. Drop into a slide, an email, a notebook, a dashboard - it just works.

---

## Visualization - 60+ Chart Types, GPU-Accelerated

### 2D
Bar (10 sub-variants incl. waterfall, marimekko, pictogram), Line, Area, Scatter, Bubble, Pie, Donut, Histogram, Box, Violin (8 sub-variants incl. half, split, rainbow), KDE, Ridgeline, Radar, Heatmap, Treemap, Sunburst, Funnel, Gauge, Bullet, Slope, Dumbbell, Lollipop, Candlestick, Parallel coordinates, Choropleth, Bubble map, **Word Cloud (6 shape masks: rect / circle / heart / bird / bubble pack / sunglasses)**.

### 3D
Scatter 3D, Bar 3D, Line 3D, Radar 3D, KDE 3D, Ridgeline 3D, Bubble 3D, Pie 3D, Violin 3D, Heatmap 3D, Candlestick 3D, Dumbbell 3D, Funnel 3D, Sunburst 3D, Lollipop 3D, Stacked Bar 3D, **Globe 3D**, DBSCAN 3D.

### Composers
- `sp.build_grid([chart1, chart2, ...])` - responsive multi-chart layouts.
- `sp.build_slideshow([...])` - navigable HTML carousel with auto-advance.
- `annotations=[...]` kwarg works on **any** chart - native overlays for `hline` / `vline` / `line` / `arrow` / `rect` / `text` in fractional or pixel coordinates.

---

## Machine Learning - Production Toolkit

A scikit-learn compatible API, written in Rust, with online-learning primitives ready for streaming workloads.

### Supervised Learning
- **Linear models:** Linear / Ridge / Lasso / ElasticNet / Logistic regression with `score`, `predict_proba`, `decision_function`.
- **Trees & ensembles:** Decision Tree (classifier + regressor), Random Forest, Gradient Boosting.
- **Neighbors:** KNN classifier + regressor.
- **Naive Bayes, SVM, MLP** - full estimator interface.

### Unsupervised Learning
- **Clustering:** KMeans, DBSCAN, Agglomerative, Mean-Shift.
- **Dimensionality reduction:** PCA, t-SNE, UMAP.

### Preprocessing & Pipelines
- **Online scalers:** `StandardScaler` with Welford `partial_fit` for streaming data - no full pass required.
- **Incremental encoders:** `OneHotEncoder` and `OrdinalEncoder` with category union across batches.
- **Pipelines:** Chain transformers + estimator with full `score` / `predict_proba` / `decision_function` propagation.
- **Train/test split, cross-validation, grid search**.

### Metrics
Accuracy, precision, recall, F1, ROC-AUC, log-loss, R-squared, MAE, MSE, RMSE, confusion matrix, classification report - identical signatures to scikit-learn.

---

## Installation

```bash
pip install seraplot
```

Conda / uv users:

```bash
conda install -c conda-forge seraplot
uv pip install seraplot
```

JavaScript / WebAssembly:

```bash
npm install seraplot
```

---

## 60-second tour

```python
import seraplot as sp

bar = sp.build_bar_chart("Sales", labels=["Q1","Q2","Q3","Q4"], values=[120,180,150,210])
line = sp.build_line_chart("Trend", labels=["Jan","Feb","Mar"], values=[8,12,21],
    annotations=[{"kind":"hline","y":0.5,"color":"#22c55e","text":"Target","dash":"6 4"}])
cloud = sp.build_wordcloud("Tech", words=["Python","Rust","ML","AI"], frequencies=[40,30,25,20], variant="bubble")
sp.build_grid([bar, line, cloud], cols=3).show()

from seraplot.ml import StandardScaler, LogisticRegression, Pipeline
pipe = Pipeline([("scale", StandardScaler()), ("clf", LogisticRegression())])
pipe.fit(X_train, y_train)
print("acc:", pipe.score(X_test, y_test))
```

---

## Gallery - Chart Types

### 2D Charts
| | | | |
|:---:|:---:|:---:|:---:|
| ![2D-1](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/2d/1.png) | ![2D-2](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/2d/2.png) | ![2D-3](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/2d/3.png) | ![2D-4](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/2d/4.png) |
| ![2D-5](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/2d/5.png) | ![2D-6](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/2d/6.png) | ![2D-7](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/2d/7.png) | ![2D-8](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/2d/8.png) |

### 3D Charts
| | | | |
|:---:|:---:|:---:|:---:|
| ![3D-1](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/3d/1.png) | ![3D-2](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/3d/2.png) | ![3D-3](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/3d/3.png) | ![3D-4](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/3d/4.png) |
| ![3D-5](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/3d/5.png) | ![3D-6](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/3d/6.png) | ![3D-7](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/3d/7.png) | ![3D-8](https://raw.githubusercontent.com/feur25/seraplot-documentation/main/3d/8.png) |

---

## Performance

SeraPlot consistently delivers **100x to 8000x speedups** over Plotly and Matplotlib on chart generation, with a flat memory profile that fits inside containers, lambdas and embedded targets. ML estimators are within ~5% of scikit-learn while supporting `partial_fit` for streaming workloads that scikit-learn cannot handle natively.

---

## License & Links

- **License:** see project repository.
- **Repository:** https://github.com/feur25/seraplot
- **Documentation:** https://feur25.github.io/seraplot/introduction.html
- **Issues:** https://github.com/feur25/seraplot/issues

If SeraPlot saves you time, a star on GitHub helps a lot.

