Skip to content

API Reference

Velo Plot provides a comprehensive API for creating high-performance scientific charts.

Core Modules

Chart Creation

FunctionDescription
createChart(options)Create a new chart instance
createStackedChart(options)Multi-pane vertical stack (1–5 charts, sync, resize)
createChartGroup / linkChartsLink charts for pan/zoom/cursor sync
buildIndicatorPaneComposite indicator pane (histogram + colored lines)

Series Management

MethodDescription
chart.addSeries(options)Add a new data series
chart.updateSeries(id, data)Update series data
chart.removeSeries(id)Remove a series
chart.getSeries(id)Get a series by ID
chart.getAllSeries()Get all series

View Control

MethodDescription
chart.zoom(options)Programmatic zoom
chart.pan(deltaX, deltaY)Programmatic pan
chart.fit(options)Safe fit to data (no-op if empty)
chart.resetZoom()Reset via fit()
chart.autoScale()Fit view to data (legacy)
chart.getId()Stable chart id for sync
chart.getViewBounds()Get current view bounds

Interactions

MethodDescription
chart.enableCursor(options)Enable crosshair cursor
chart.disableCursor()Disable cursor
chart.tooltipTooltip system manager

Events

EventDescription
renderFired after each frame render
zoomFired when view bounds change
panFired during panning
resizeFired when chart resizes

Lifecycle

MethodDescription
chart.resize(width?, height?)Manually resize chart
chart.render()Force a render
chart.destroy()Clean up resources
chart.use(plugin)Load a plugin
chart.getPlugin(name)Get a plugin instance

Core Plugins

Many high-level features are provided as plugins. Load them using chart.use().

PluginFeatures
PluginToolsTooltips, Delta Tool, Peak Tool
PluginAnalysisFFT, Regression, Smoothing
PluginAnnotationsLines, Shapes, Text
PluginPatternRecognitionDetect chart patterns (Head & Shoulders, etc.)
PluginStreamingReal-time WebSocket streaming
PluginGpuWebGPU & GPGPU acceleration
StatsPluginReal-time statistics panel
PluginDataTransformReal-time data transformation pipeline
PluginLoadingCustom loading indicators
PluginROISelection tools (Rectangle, Lasso, Polygon)
PluginVirtualizationRender massive datasets (10M+ points)
PluginOffscreenRendering in background Workers
PluginExportSnapshots, Video recording, Data export
DirectionIndicatorPluginReal-time trend arrows

Annotations

MethodDescription
chart.addAnnotation(annotation)Add an annotation
chart.removeAnnotation(id)Remove an annotation
chart.updateAnnotation(id, updates)Update an annotation
chart.getAnnotation(id)Get an annotation by ID
chart.getAnnotations()Get all annotations
chart.clearAnnotations()Clear all annotations

Annotation Types:

  • horizontal-line - Horizontal line with optional label
  • vertical-line - Vertical line with optional label
  • rectangle - Rectangular region
  • band - Horizontal or vertical band/region
  • text - Text annotation with customizable style
  • arrow - Arrow with head customization

View full Annotations API →

Step Charts

Step charts display data as "stair-step" patterns - ideal for discrete data.

TypeDescription
stepStep line chart
step+scatterStep chart with point markers

Step Modes:

  • after - Step after the point (default)
  • before - Step before the point
  • center - Step at midpoint

View Step Charts documentation →

Data Export

MethodDescription
chart.exportCSV(options?)Export data to CSV format
chart.exportJSON(options?)Export data to JSON format

Image & Vector Export

MethodDescription
createChart({ renderer: 'svg' })Live vector chart (extended bundle)
chart.exportImage(type?)PNG/JPEG data URL (built-in)
chart.exportSVG()SVG string (vector paths + ticks)
chart.snapshot.takeSnapshot()PNG/JPEG/WebP/SVG via PluginSnapshot
stack.exportImage()Full multi-pane composite (PNG/JPEG/WebP/SVG)
stack.exportSVG()Full stack vector document

View Image & Vector Export guide →

Error Bars

Visualize uncertainty, variability, or confidence intervals in your data.

Error Data Types:

  • yError - Symmetric Y error (±value)
  • yErrorPlus / yErrorMinus - Asymmetric Y error
  • xError - Symmetric X error (horizontal)
  • xErrorPlus / xErrorMinus - Asymmetric X error

Styling Options:

typescript
errorBars: {
  color: '#00f2ff',
  width: 1.5,
  capWidth: 8,
  showCaps: true,
  opacity: 0.7,
  direction: 'both'  // 'both' | 'positive' | 'negative'
}

View Error Bars documentation →

Scatter Symbols

Multiple marker shapes for scatter plots, rendered via optimized shaders.

Supported Shapes:

  • circle (default), square, diamond
  • triangle, triangleDown
  • cross, x, star

Usage:

typescript
style: {
  symbol: 'star',
  pointSize: 10,
  color: '#ff4d4d'
}

View Scatter Symbols documentation →

Tooltip System

Advanced, high-performance tooltips with multi-series support, scientific notation, and smooth animations.

Tooltip Modes:

  • dataPoint - Snap to nearest data point
  • crosshair - Multi-series vertical tracking
  • heatmap - Cell-specific intensity display

Themes:dark, light, glass (translucent), midnight (blue), neon (vibrant), minimal.

View Tooltip System documentation →

Gauge & Sankey

Nuevos tipos de visualización altamente especializados para KPIs y flujos.

TipoDescripciónDocumentación
gaugeDiales y medidores de agujaGauge Charts
sankeyDiagramas de flujo de SankeySankey Diagrams

Ver todos los tipos de Series →

React API

ExportDescription
VeloPlotReact component
useVeloPlotReact hook for imperative control
useStackedPlotReact hook for multi-pane stacks

Data Analysis

FunctionDescription
detectCycles()Detect cycles in oscillating data
detectPeaks()Find local maxima/minima
calculateStats()Basic statistics
movingAverage()Smooth data
downsampleLTTB()Reduce point count
validateData()Check for invalid values

TIP

These functions are available as standalone utilities or via chart.analysis after loading the PluginAnalysis.

Theming

ExportDescription
DARK_THEMEDark theme preset
LIGHT_THEMELight theme preset
MIDNIGHT_THEMEMidnight blue theme
createTheme()Create custom theme

Utilities

FeatureDescriptionLink
KeyboardShortcut managementKeyboard API
I18nLocalization & LocalesI18n API
ClipboardCopy data to systemClipboard API
VideosRecord chart animationsVideo Recorder
StreamingReal-time data feedsStreaming API
GPUHardware accelerationGPU & WebGPU

Types

typescript
// Core types
type SeriesType = 'line' | 'scatter' | 'both'
type ScaleType = 'linear' | 'log'

interface Bounds {
  xMin: number
  xMax: number
  yMin: number
  yMax: number
}

interface Point {
  x: number
  y: number
}

// Series types
interface SeriesData {
  x: Float32Array | Float64Array
  y: Float32Array | Float64Array
}

interface SeriesStyle {
  color?: string
  width?: number
  pointSize?: number
  smoothing?: number
}

// Chart options
interface ChartOptions {
  container: HTMLElement
  xAxis?: AxisOptions
  yAxis?: AxisOptions
  theme?: string | ChartTheme
  background?: string
  showControls?: boolean
  showLegend?: boolean
}

Axis options support descending scales via invertAxis: true for domains like IR wavenumbers.

Known limitations

  • Bundle entry — pick velo-plot, velo-plot/trading, velo-plot/scientific, or velo-plot/full. See Bundle Architecture.
  • WebGPU renderer (renderer: 'webgpu') requires an extended bundle entry and is experimental — use WebGL (default) for production.
  • SVGexportSVG() and renderer: 'svg' require an extended bundle. LaTeX labels and contour overlays are partial; 3D is not supported in SVG. See SVG examples.
  • See Plugin status registry for plugin maturity (complete, partial, experimental).

Released under the MIT License.