@photonviz/core 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,6 +6,13 @@
6
6
 
7
7
  **GPU-accelerated scientific plotting for the web — WebGL2, zero dependencies.**
8
8
 
9
+ <p>
10
+ <a href="https://www.npmjs.com/package/@photonviz/core"><img src="https://img.shields.io/npm/v/@photonviz/core?color=cb3837&logo=npm" alt="npm"/></a>
11
+ <a href="https://www.npmjs.com/package/@photonviz/core"><img src="https://img.shields.io/npm/dm/@photonviz/core?color=cb3837" alt="downloads"/></a>
12
+ <a href="https://bundlephobia.com/package/@photonviz/core"><img src="https://img.shields.io/bundlephobia/minzip/@photonviz/core?label=minzip" alt="size"/></a>
13
+ · <a href="https://coredumpdev.github.io/photon/">▶ Live demo</a>
14
+ </p>
15
+
9
16
  <p align="center">
10
17
  <img src="https://raw.githubusercontent.com/coredumpdev/photon/master/assets/streaming.gif" alt="Live streaming WebGL2 charts at 60fps" width="100%" />
11
18
  </p>
@@ -23,9 +30,7 @@ axes, ticks, and labels on a crisp Canvas2D overlay — so you get both **scale*
23
30
  npm i @photonviz/core
24
31
  ```
25
32
 
26
- > Framework bindings: [`@photonviz/react`](https://www.npmjs.com/package/@photonviz/react) · [`@photonviz/vue`](https://www.npmjs.com/package/@photonviz/vue) · [`@photonviz/svelte`](https://www.npmjs.com/package/@photonviz/svelte)
27
- > Vector maps: [`@photonviz/map`](https://www.npmjs.com/package/@photonviz/map)
28
-
33
+ > Framework bindings: [`@photonviz/react`](https://www.npmjs.com/package/@photonviz/react) · [`@photonviz/vue`](https://www.npmjs.com/package/@photonviz/vue) · [`@photonviz/svelte`](https://www.npmjs.com/package/@photonviz/svelte) · [`@photonviz/solid`](https://www.npmjs.com/package/@photonviz/solid) · [`@photonviz/gea`](https://www.npmjs.com/package/@photonviz/gea) · framework-free [`@photonviz/wc`](https://www.npmjs.com/package/@photonviz/wc) Web Components
29
34
  ## Quick start
30
35
 
31
36
  ```ts
@@ -53,16 +58,25 @@ plot.addLine({ x: xs, y: ys, color: "#60a5fa", width: 2, name: "signal" });
53
58
  | Heatmap | `plot.addHeatmap({ values, cols, rows, extent, colormap })` |
54
59
  | Contour | `plot.addContour({ values, cols, rows, extent, levels })` |
55
60
  | Hexbin | `plot.addHexbin({ x, y, radius, colormap })` |
56
- | Error bar / Stem / Quiver / Candlestick | `plot.addErrorBar` · `addStem` · `addQuiver` · `addCandlestick` |
61
+ | Error bar / Stem / Quiver | `plot.addErrorBar` · `addStem` · `addQuiver` |
62
+ | Candlestick / OHLC | `plot.addCandlestick({ x, open, high, low, close })` · `addOhlc(...)` — live via `updateLast` / `appendCandle` |
63
+ | Pie / Patches / Graph / Image | `plot.addPie` · `addPatches` · `addGraph` · `addImage` |
64
+ | **Finance** | `addHeikinAshi` · `addRenko` · `addBollinger` · `addVolumeProfile` · `addDepth` + indicators `sma`/`ema`/`wma`/`rsi`/`macd`/`vwap`/`atr`/`stochastic`/`keltner`/`obv`/`ichimoku`/`adx`/`superTrend`/`fibRetracements` |
65
+ | **Diagrams** | `plot.addTreemap` · `addFunnel` · `addSunburst` · `addGauge` · `addSankey` · `addChord` · `addParallelCoordinates` — pure `*Layout` fns exported too |
57
66
 
58
67
  **Polar** — `new PolarPlot(el)` with `addLine` / `addScatter` (drag to rotate, wheel to zoom).
59
- **3D** — `new Plot3D(el)` with `addSurface` / `addPointCloud` (orbit camera).
68
+ **3D** — `new Plot3D(el)` with `addSurface` / `addPointCloud` / `addLine3D` / `addBar3D` / `addQuiver3D` / `addContour3D` / `addIsosurface` / `addVolume` (orbit camera).
60
69
 
61
70
  ## Features
62
71
 
63
- - **Scales** — linear, log (decade ticks + GPU log transform), time (large epoch timestamps via per-layer reference offsets).
64
- - **Streaming** — line/scatter/bar/area expose `setData()` to re-upload GPU buffers each frame.
72
+ - **Scales** — linear, log (decade ticks + GPU log transform), time, categorical, and `ordinal-time` (finance/session axis that collapses market gaps).
73
+ - **Streaming** — **every** layer exposes `setData()`; candlesticks add `updateLast`/`appendCandle`; opt into `renderType: "dynamic"` for a `GL_DYNAMIC_DRAW` hint.
74
+ - **Linked panes** — `linkX([a, b, …])` syncs pan/zoom + crosshair across plots (price + volume + RSI/MACD dashboards).
65
75
  - **Interaction** — wheel-zoom, pan, box/X/Y zoom, hover crosshair + tooltips, multiple Y axes, custom ticks.
76
+ - **Drawing tools** — `new Plot(el, { drawingTools: true })` adds trendline / horizontal / ray / Fibonacci / rectangle tools; drawings are editable (drag handles, relabel, recolor, delete). API: `setDrawTool`/`getDrawTool`/`addDrawing`/`clearDrawings`.
77
+ - **Image export** — every plot has `toDataURL()` / `toBlob()` / `downloadImage()` / `copyToClipboard()` + a toolbar download-PNG button; helpers `canvasToBlob` / `downloadCanvas` / `copyCanvasToClipboard` exported.
78
+ - **Data adapters** — `parseCSV(text)` → a `Table` (`.column()` / `.numeric()`), and `lttb(x, y, threshold)` for downsampling long line series.
79
+ - **Accessibility** — plots render as `role="img"` with an auto-summarized `aria-label`; override via `ariaLabel` / `setAriaLabel()` / `describe()`.
66
80
  - **Many charts, one context** — a single shared WebGL2 context backs every plot, so a page can hold dozens.
67
81
 
68
82
  ## License