@coderyo/renderer-webgl
v2.1.0
Published
WebGL2 chart renderer for TradView V2.
Readme
@coderyo/renderer-webgl
WebGL2 chart renderer for TradView V2.
Phase beta (V2-R5–R8)
WebGLPaneOrchestrator— main + volume + MACD/RSI/KDJ + MA/EMA/BOLL overlays (V2-R6)- LOD via
lodDecimateBars+maxRenderPoints(V2-R8) - Perf:
getRenderPerfStats(),runRenderBenchmark();pnpm bench:webgl; demo?bench=1
Phase gamma (V2-R9–R11)
createChartCoordinateMapper— time/price ↔ overlay pixels on the main paneWebGLDrawingLayer+drawings: { enabled: true }on the orchestrator (setDrawingTool)- Demo drawing toolbar on
apps/playground/webgl-demo.html check:webgl-sizecap 170 KB raw (R11 +50 KB)
Not wired to @coderyo/core until V2-R12.
Usage
import { WebGLPaneOrchestrator } from '@coderyo/renderer-webgl';
const chart = new WebGLPaneOrchestrator({ debug: false });
chart.mount(document.getElementById('chart')!);
chart.setBars(bars);
// ResizeObserver keeps layout in sync; call chart.destroy() on teardown.Tests
pnpm --filter @coderyo/renderer-webgl test
pnpm check:webgl-size # dist/index.js ≤ 170 KB raw (after build)CI policy (phase_alpha): Viewport, price-scale, interaction, and export allowlist run under happy-dom on every pnpm test. WebGL GPU paths (webgl-integration.test.ts) require a browser with WebGL2 — they are skipped in default CI; validate locally or in a future browser job before rc cuts.
Package version stays 1.1.x until VERSION=2.0.0-rc.N (monorepo sync-versions); API is alpha until then.
