Real-time LOD time series rendering engine for the browser.
Package Exports
blazeplot
blazeplot/core
blazeplot/data
blazeplot/export
blazeplot/interaction
blazeplot/linked
blazeplot/linked-core
blazeplot/package.json
blazeplot/plugins/annotations
blazeplot/plugins/crosshair
blazeplot/plugins/interactions
blazeplot/plugins/legend
blazeplot/plugins/navigator
blazeplot/plugins/selection
blazeplot/plugins/tooltip
blazeplot/react
blazeplot/render
Readme
Fast WebGL2 plotting engine for the browser.
Built for people who have hit the performance ceiling of Chart.js, Plotly, and similar browser charting libraries. BlazePlot keeps the hot path GPU-native and the DOM minimal, so large streaming datasets stay interactive instead of turning into a slideshow.
Built on native WebGL2 with no rendering runtime dependency.
Small core, fast first frame
The core chart runtime is intentionally compact: the current production build for blazeplot without optional plugin subpaths is about 139 KiB raw / 34 KiB gzip (dist/index.js plus shared chart/render/data chunks after bun run build). Optional UI plugins, React helpers, linked charts, and export helpers ship as separate subpath entries.
A minimal 1,000-point line chart renders its first frame in about 0.3 ms median / 0.5 ms p95 of chart render work in the project headless Chrome benchmark setup (640×360 canvas, axes/grid disabled, HeadlessChrome 148 with SwiftShader). Chart construction and WebGL program/buffer setup for that case is about 19 ms median.
Versioned footprint and first-draw comparison
Vendor/package-published figures only; no cross-library benchmark runs. Best available value in each metric is bolded.
A chart only needs a host element. For regular arrays, wrap your data in a StaticDataset; capacity is only needed when you want a streaming ring buffer.
<divid="chart"style="width:100%;height:400px"></div><scripttype="module">
import { Chart, StaticDataset } from "blazeplot";
const el = document.getElementById("chart");
if (!el) throw new Error("Missing #chart element");
const x = Array.from({ length: 1000 }, (_, i) => i);
const y = x.map((value) => Math.sin(value * 0.02));
const chart = new Chart(el);
chart.addLine({ dataset: new StaticDataset(x, y), name: "sine" });
chart.setViewport({ xMin: x[0], xMax: x[x.length - 1], yMin: -1.5, yMax: 1.5 });
chart.start();
</script>
Features
WebGL2 rendering
GPU-accelerated plot rendering from the ground up. No Canvas2D fallback. Axis labels use lightweight DOM layers.
Flexible data model
Streaming ring buffer or static arrays. Bring your own data shape.
LOD downsampling
Min/max pyramid for efficient line rendering at any zoom level — sparse views show raw points, dense views show vertical segments. Server-pre-sampled min/max buckets can also be rendered directly with ServerSampledDataset.
Pan & zoom
Pointer/touch pan and wheel zoom via Camera2D. Customizable viewport policies.
Grid lines
Data-anchored grid rendered as WebGL line lists.
Axis labels
Smart tick generation with DOM labels. Per-axis inside/outside positioning; outside axes reserve real layout gutters.
Multi-series
Independent buffers, styles, and visibility per series. Line, area, scatter, bar, OHLC, and candlestick modes are supported.
Plugin-ready UI
Optional built-in legend, tooltip, interactions, annotations, selection, crosshair, and navigator plugins use the same public APIs available to custom plugins.
React and linked charts
First-party blazeplot/react and blazeplot/linked subpaths support React usage and synchronized multi-panel layouts.
Export helpers
chart.screenshot() composites WebGL output with built-in DOM/SVG overlays. blazeplot/data provides lightweight CSV/JSON data export and pure transform helpers; blazeplot/export provides download/clipboard helpers.
Benchmark overlay
Built-in fps, frame time, vertex count, draw calls.
ResizeObserver
Automatic DPR-aware canvas sizing.
Data export and transforms
Use the tree-shakable blazeplot/data subpath when you only need data helpers. It collects raw rows from the current visible x range, a committed selection plugin state, or the full chart, then serializes them as CSV or JSON.
exportVisibleChartData exports samples in each series' current x viewport by default; pass { includeYRange: true } to require y-viewport overlap. Selection exports follow the selection plugin mode (x-range, y-range, or xy) and include OHLC/candlestick open, high, low, and close columns when available.
API reference
This section is generated by bun run docs:readme from TypeScript declaration files, JSDoc comments, and built dist/ bundle sizes. Do not edit it by hand.
Generated from dist/index.d.ts after the package build
Export
Kind
Source
JSDoc summary
AcceleratedDataset
interface
./core/types
Convenience contract for maximum-performance custom datasets. Implement this when a dataset can provide fast exact sample copies, stable viewport sampling, range min/max queries, and renderer-ready min/max buckets.
AppendableDataset
interface
./core/types
—
AttributeSpec
interface
./render/types
—
AxisConfig
interface
./ui/Chart
—
AxisController
class
./interaction/AxisController
—
AxisControllerAxisOptions
interface
./interaction/AxisController
—
AxisControllerOptions
interface
./interaction/AxisController
—
AxisPosition
type
./ui/ChartLayout
—
AxisRenderTarget
type
./interaction/AxisController
—
AxisScale
type
./interaction/AxisController
—
AxisTickFormat
type
./interaction/AxisController
—
AxisTickFormatter
type
./interaction/AxisController
—
AxisTimeZone
type
./interaction/AxisController
—
AxisTitleConfig
interface
./ui/Chart
—
BufferOverflowStrategy
type
./core/types
—
BufferSpec
interface
./render/types
—
BuiltInAxisScale
type
./interaction/AxisController
—
Camera2D
class
./interaction/Camera2D
—
Chart
class
./ui/Chart
—
ChartAccessibilityOptions
interface
./ui/Chart
—
ChartAutoFitYOptions
interface
./ui/Chart
—
ChartBackendFactory
type
./ui/Chart
—
ChartBackendFactoryContext
interface
./ui/Chart
—
ChartFitToDataOptions
interface
./ui/Chart
—
ChartFitToDataPadding
interface
./ui/Chart
—
ChartFollowXOptions
interface
./ui/Chart
—
ChartFrameStats
interface
./ui/Chart
—
ChartHoverState
interface
./ui/Chart
—
ChartKeyboardOptions
interface
./ui/Chart
—
ChartLayoutReservation
interface
./ui/Chart
—
ChartOptions
interface
./ui/Chart
—
ChartPickGroup
type
./ui/Chart
—
ChartPickItem
interface
./ui/Chart
—
ChartPickMode
type
./ui/Chart
—
ChartPickOptions
interface
./ui/Chart
—
ChartPlugin
interface
./ui/Chart
—
ChartPluginContext
interface
./ui/Chart
—
ChartPluginHandle
interface
./ui/Chart
—
ChartPointerEventState
interface
./ui/Chart
—
ChartPointerEventType
type
./ui/Chart
—
ChartScreenshotOptions
interface
./ui/Chart
—
ChartScreenshotPreset
type
./ui/Chart
—
ChartSelectEvent
interface
./ui/Chart
—
ChartSeriesClickEvent
interface
./ui/Chart
—
ChartSeriesState
interface
./ui/Chart
—
ChartTheme
interface
./ui/theme
—
ChartTitleConfig
interface
./ui/Chart
—
ChartViewportChangeEvent
interface
./ui/Chart
—
CssColor
type
./ui/theme
—
CustomAxisScale
interface
./interaction/AxisController
—
Dataset
interface
./core/types
—
DEFAULT_CHART_THEME
const
./ui/theme
—
DrawSpec
interface
./render/types
—
GpuBackend
interface
./render/types
—
GpuBuffer
interface
./render/types
—
GpuCapabilities
interface
./render/types
—
GpuProgram
interface
./render/types
—
GpuResource
type
./render/types
—
isWebGL2Available
function
./render/WebGL2Backend
—
LODBucket
interface
./core/types
—
LODStrategy
type
./core/types
—
LODView
interface
./core/types
—
MinMaxPyramid
class
./core/MinMaxPyramid
—
MinMaxSegmentCopyDataset
interface
./core/types
Optional high-performance min/max extraction capability for dense rendering. Implementations can use pyramids, segment trees, database aggregates, or analytic/procedural envelopes to emit renderer-ready min/max buckets.
MinMaxSegmentLayout
type
./core/types
—
OhlcDataset
interface
./core/types
—
OhlcRingBuffer
class
./core/OhlcDataset
—
OhlcRingBufferOptions
interface
./core/OhlcDataset
—
PanIntent
interface
./interaction/types
—
RangeMinMaxDataset
interface
./core/types
—
RangeSampleCopyDataset
interface
./core/types
Optional high-performance extraction capability for datasets that can copy raw samples without going through repeated getX/getY calls. Implement this for very large datasets, implicit-X datasets, or remote/memory-mapped sources.
ReglBackend
const
./render/WebGL2Backend
Deprecated alias for WebGL2Backend. This preserves the pre-native-backend public API.
ResolvedChartTheme
interface
./ui/theme
—
RgbaColor
type
./ui/theme
—
RingBuffer
class
./core/RingBuffer
—
RingBufferOptions
interface
./core/RingBuffer
—
RingBufferOverflow
type
./core/RingBuffer
—
SampleCopyLayout
type
./core/types
—
SeriesConfig
interface
./core/types
—
SeriesDataBounds
interface
./core/SeriesStore
—
SeriesDataBoundsOptions
interface
./core/SeriesStore
—
SeriesMode
type
./core/types
—
SeriesOhlcSample
interface
./core/SeriesStore
—
SeriesSample
interface
./core/types
—
SeriesStore
class
./core/SeriesStore
—
SeriesStyle
interface
./core/types
—
SeriesYAxis
type
./core/types
—
ServerSampledBuckets
interface
./core/ServerSampledDataset
—
ServerSampledData
type
./core/ServerSampledDataset
—
ServerSampledDataset
class
./core/ServerSampledDataset
Mutable dataset for viewport samples that were already reduced by a server. Use point data with downsample: "none", or min/max buckets with downsample: "server" so BlazePlot renders the supplied buckets directly instead of applying another client-side sampler.
ServerSampledDatasetKind
type
./core/ServerSampledDataset
—
ServerSampledPoints
interface
./core/ServerSampledDataset
—
StaticDataset
class
./core/StaticDataset
—
StaticOhlcDataset
class
./core/OhlcDataset
—
TextOverlayConfig
interface
./ui/Chart
—
ThemeColor
type
./ui/theme
—
TimeRange
interface
./core/types
—
TypedSeriesConfig
type
./ui/Chart
—
UniformRingBuffer
class
./core/UniformRingBuffer
High-throughput ring buffer for uniformly spaced X values. Store only Y samples and derive X as xStart + index * xStep. This is the fastest built-in dataset for live telemetry, signals, and other fixed-rate streams because appends copy a single typed array and min/max extraction uses a block segment tree over the physical ring.
UniformRingBufferOptions
interface
./core/UniformRingBuffer
—
Viewport
interface
./core/types
—
ViewportPolicy
interface
./interaction/types
—
VisiblePointCopyDataset
interface
./core/types
Optional high-performance extraction capability for point/scatter datasets. Implementations should cull against the full 2D viewport and may sample in screen space so dense point clouds respond to both X and Y zoom.
VisibleSampleCopyDataset
interface
./core/types
Optional high-performance stable visible sampling capability. Unlike copySamplesRange, this method may stride/downsample, but should choose samples anchored to data coordinates so streamed appends do not make existing sampled points jitter.
Keep pull requests small and focused. One feature or fix per PR.
Branch flow:
development is the integration branch for regular work.
Open feature/fix PRs into development.
Open release PRs from development into main with the version and changelog already updated.
Merging an unpublished version to main runs CI, publishes npm, creates the vX.Y.Z tag, and creates the GitHub Release.
Development
bun install
bun run dev # Vite dev server → preview/
bun run ci # Typecheck + tests + package build + benchmark smoke test
bun run build # Package build (JS + declarations)
bun test# Tests
bun run typecheck # TypeScript strict check
bun run bench:ci # Headless browser benchmark smoke test
bun run version:patch # Prepare package.json + changelog for a patch release PR
bun run release:benchmarks # Append benchmark results to the current release changelog