@photonviz/gea
v0.7.2
Published
Gea (@geajs/core) bindings for Photon — WebGL2 scientific plotting
Downloads
1,433
Maintainers
Readme
@photonviz/gea
Gea bindings for Photon — GPU-accelerated WebGL2 charts.
Config-driven Gea components over @photonviz/core. Gea has no context API, so — like the Svelte binding — each component owns a whole plot: pass options, yAxes, and a typed series array. The core Plot is an imperative WebGL canvas, so stream new data through the onReady handle.
npm i @geajs/core @photonviz/core @photonviz/geaQuick start
import { Component } from "@geajs/core";
import { Plot } from "@photonviz/gea";
export default class Chart extends Component {
template() {
return (
<div style="height:320px">
<Plot
options={{ theme: "dark" }}
series={[
{ type: "line", x: this.props.x, y: this.props.y, color: "#60a5fa", width: 2, name: "signal" },
{ type: "scatter", x: this.props.x, y: this.props.y, size: 4, marker: "diamond" },
]}
/>
</div>
);
}
}
// Streaming — grab the core Plot via onReady and drive it imperatively:
// <Plot options={...} series={[...]} onReady={(plot) => { /* layer.setData(...); plot.render() */ }} />Components
Plot (Cartesian) · PolarPlot · Plot3D
Each takes options, an optional class/style, onReady, and:
Plot—yAxes+ aseriesarray of{ type, ...options }(line, scatter, bar, area, heatmap, box, hexbin, contour, errorbar, stem, quiver, candlestick, ohlc, pie, patches, image, graph, heikinAshi, renko, volumeProfile).PolarPlot—seriesof{ type: "line" | "scatter", ... }.Plot3D—layersof{ type: "surface" | "pointcloud" | "line3d" | "bar3d" | "quiver3d" | "contour3d" | "isosurface" | "volume", ... }.
Multi-layer addBollinger / addDepth and the indicators (rsi, macd, sma, ema, wma, vwap, atr, stochastic, keltner, obv, ichimoku, adx, superTrend, fibRetracements) are re-exported for imperative use via onReady(plot). Series options accept renderType; use the ordinal-time x scale for gap-free session charts.
The toolbar includes a one-click download-PNG button; via onReady(plot) the core Plot also exposes image export (downloadImage() / toDataURL() / toBlob() / copyToClipboard()).
