v0.5.0
GPU charts that can now draw the model that produced the data — plus a Python
bridge, readable colour, and a documentation site.
Model architecture graphs
Draw a real model's layers, straight from PyTorch, Keras, scikit-learn or ONNX.
addModelGraph(plot, { graph })— a flat Netron-style DAG. Boxes are coloured
by layer family, and a residual edge that skips ranks routes around the
trunk instead of cutting through it.addModelGraph3D(plot3d, { graph })— one cuboid per layer, sized from its
output tensor: the visible face is H×W, the thickness is the channel count, so
a CNN reads as feature maps shrinking while depth grows.
Six pure adapters (modelGraphFromTorchFx, modelGraphFromKeras,
modelGraphFromSklearn, modelGraphFromOnnx, sequentialModel, mlpModel)
feed one shared layout — modelLayout is exported if you would rather draw it
yourself.
New: Boxes3DLayer (instanced lit cuboids), and on Plot3D — aspectMode: "data", projection: "orthographic", showAxes, and addLabel3D for outlined
text pinned in data space.
Python — pip install photonviz
An anywidget bridge for Jupyter Notebook, JupyterLab,
VS Code and Google Colab. NumPy arrays and torch tensors cross to the browser
as binary buffers, so a million points stay interactive in a cell.
```python
import numpy as np, photonviz as pv
pv.line(x, np.sin(x), name="signal", plot={"theme": "dark", "legend": True})
pv.model_graph_3d(torch_model, example_input=torch.randn(1, 3, 224, 224))
```
Two runnable notebooks under `examples/notebooks/`.
Colorbars, and colour worth trusting
- Colorbars are on by default. Any layer that maps values to colours —
heatmap, hexbin, contour, choropleth patches, `colorBy` scatter/quiver —
reports a scale, and the plot draws a bar for it. - 4 colormaps become 12 across sequential / diverging / cyclic, plus 4
categorical palettes (including the colour-vision-safe `okabe-ito`). - Bring your own: `registerColormap` / `registerPalette`, or pass inline
colours anywhere a name is accepted. - `symmetricDomain` centres a diverging scale so its neutral colour lands on
zero instead of drifting with the data.
Marks and interaction
- Bubble charts — per-point `sizes` and `colors` on scatter.
- Dashed lines — `dash: [6, 4]` for guides and forecasts.
- Interactive legend — click an entry to hide a series; the auto axes re-fit
to what is left. Keyboard-accessible, with `onVisibilityChange`.
Finance, ML, signal and statistics
- Finance: `cci`, `mfi`, `williamsR`, `aroon`, `donchian`, `parabolicSar`,
`pivotPoints`, `resampleOhlc`, `drawdown` + `addDrawdown`. - ML: `r2`, `rmse`, `mae`, `logLoss`, `brierScore`, `classificationReport`,
`liftCurve`, `rocCurveOvR` + `addPredVsActual`, `addResiduals`,
`addLiftCurve`, `addLearningCurve`. - Signal + statistics (new modules): window functions, Welch PSD,
Savitzky-Golay, cross-correlation, OLS/LOESS fits, ECDF, z-score,
correlation matrix + `addRegression`, `addEcdf`, `addCorrMatrix`, `addPsd`.
Documentation
A full site at https://coredumpdev.github.io/photon/docs/ — guides, the
chart catalog with live demos, and a TypeDoc API reference. Every demo is a
real module loaded twice, imported to run and read raw to display, so the code
on the page is what produced the chart above it.
Also
All six framework wrappers expose the new charts, dash and sizes/colors.
190 TypeScript tests and 22 Python tests.