polynode-charts
A zero-dependency browser charting library purpose-built for prediction market data and real-time crypto price streams. Renders on Canvas 2D with a 60fps animation loop, triple-layer dirty-flag rendering, and native touch/pinch support.This is the visualization companion to
polynode-sdk. The data SDK (polynode-sdk) handles REST API calls, WebSocket streaming, trading, and caching in Node.js. This package (polynode-charts) renders that data as interactive charts in the browser. They are separate npm packages.polynode-charts also includes its own built-in data providers (REST, WebSocket, short-form discovery) so you can use it standalone without polynode-sdk if you only need charts.Features
- Candlestick, line, area, and volume series types
- Live streaming mode with smooth lerp animation between ticks
- Orderbook visualization with depth chart and spread display
- Short-form market overlays with price-to-beat lines and live odds
- Multi-outcome support for prediction markets (up to 20+ outcomes)
- Auto-scaling price axis with probability mode (0-100%)
- Interactive pan, zoom, scroll, pinch-to-zoom on mobile
- Crosshair with snap-to-candle and OHLC tooltip
Install
Quick Start
Architecture
The chart uses a triple-layer canvas stack per pane:| Layer | Z-Index | Content |
|---|---|---|
| Background | 1 | Grid lines, axis labels |
| Data | 2 | Series (candles, lines, areas, volumes) |
| Overlay | 3 | Crosshair, tooltips, interaction capture |
Series Types
| Type | Method | Data Shape | Use Case |
|---|---|---|---|
| Candle | addCandleSeries() | OhlcData | Market price history |
| Line | addLineSeries() | LineData | Live crypto prices, single-outcome tracking |
| Area | addAreaSeries() | LineData | Probability trends with gradient fill |
| Volume | addVolumeSeries() | VolumeData | Trading volume bars (auto-paned at 22%) |
Data Providers
The SDK includes three built-in data providers for polynode endpoints:- PolynodeProvider — REST + polling for market candles, search, events, multi-outcome charts
- PolynodeOBProvider — WebSocket orderbook streaming with zlib decompression
- ShortFormProvider — Short-form crypto market discovery with live odds rotation

