v0.7.0
Closes the two gaps left open at 0.6.0.
Triangulations — matplotlib's tri* family
For samples that are scattered rather than gridded.
| Photon | matplotlib |
|---|---|
addTriplot / pv.triplot |
triplot |
addTripcolor / pv.tripcolor |
tripcolor |
addTricontour / pv.tricontour |
tricontour |
addTricontourf / pv.tricontourf |
tricontourf |
pv.tripcolor(x, y, z, edges=True) # flat-shaded triangles + the mesh
pv.tricontourf(x, y, z, levels=12) # filled bands over the triangulationBacking them is a new delaunay(x, y): incremental insertion with Lawson edge flipping over a half-edge mesh. Points go in along a spatial order and each one is located by walking from the last triangle touched, so location stays near O(1) amortised instead of the O(n) scan a naive Bowyer–Watson does — 4000 points triangulate in tens of milliseconds. Zero-area slivers and exact duplicates are dropped rather than emitted, since a degenerate triangle divides by zero in every interpolation downstream.
Pass your own triangles when the connectivity is part of the data — a finite-element result, say — and no triangulation runs.
Binding parity — 32 builders, all six wrappers
The statistics pack (Regression, Ecdf, CorrMatrix, Psd), the ML pack (16, from ConfusionMatrix to LearningCurve), the diagram pack (Treemap through ParallelCoordinates), Drawdown, and the new tri* four existed in core but in no wrapper. All are now:
- components in React, Vue and Solid
type:entries in the Svelte, Gea and Web Component series specs- methods and one-liners in Python
Core exports collectLayers(handle) to make that safe: it finds the layers in whatever shape a builder returns — a bare layer, { upper, middle, lower }, { lines: Layer[], arrows? } — mixed in with computed data like auc or layout. Naming each handle's fields by hand across 96 call sites is how one gets forgotten.
Fixes
Six Python methods were written against guessed option names and rendered an error box rather than a chart. The browser pass caught all six; there is now a test pinning the key names the layers actually read (yTrue/yPred, pd, weights).
Verification
68 gallery panels and 32 Python chart types all draw with non-zero ink under headless Chromium. 217 TS tests — 13 new for the triangulator, including that no vertex falls inside any circumcircle and that the triangle count matches Euler's formula — and 43 Python tests.
Install
npm i @photonviz/core # or @photonviz/react, vue, svelte, solid, gea, wc
pip install photonvizFull changelog: v0.6.0...v0.7.0