Rendering Interaction Adapters Export

Spectra Feature Guide

Everything Spectra supports, organized by domain for fast scanning.

Capability Matrix

DomainHighlightsAPI / Components
Core RenderingVulkan backend, anti-aliased lines, 17 marker shapes, dash patterns, GPU text, MSAA 4xRenderer, Vulkan pipelines, format strings
3D VisualizationLine3D / Scatter3D / Surface / Mesh, Blinn-Phong lighting, transparency, wireframeAxes3D, series3d, camera controls
Easy APIMATLAB-style one-liners, progressive complexity (7 levels)plot, scatter, subplot, plot3, surf
AnimationFrame callbacks, timeline editor, curve editor, 7 interpolation modesanimate(), timeline + keyframe systems
Productivity UICommand palette, shortcuts, undo/redo, dock/split, inspector, workspaceCommandRegistry, ShortcutManager, UndoManager
Data InteractionTooltips, crosshair, markers, linked axes, shared cursor, 14 transformsDataInteraction, AxisLinkManager, TransformPipeline
Multi-window / IPCIndependent windows, tab tear-off, inproc + multiproc modesspectra-backend, spectra-window
PythonProxy API, easy one-liners, live streaming, NumPy zero-copyspectra package, Session / codec layers
ExportHeadless rendering, PNG / GIF / MP4, plugin APIOffscreen framebuffer, RecordingSession
ROS2Topic monitor, live plotter, bag player/recorder, TF tree, node graphspectra-ros, full docs →
PX4 / ULogOffline ULog browsing + live MAVLink telemetry, auto-plot groupsspectra-px4, full docs →
Qt EmbeddingRun Spectra rendering inside a QWindow via QtRuntimeQt embed guide
WebGPU / WASMExperimental 2D backend; native (Dawn) and browser (Emscripten)WebGPU guide
Headless embedOne-liner offscreen PNG rendering; no window, no daemonEasy Embed guide
PluginsC-ABI shared libraries: commands, transforms, overlays, data sources, exportersPlugin guide
TopicsNamed live streams published into spectra-backendTopics guide

Core Rendering

  • Vulkan-powered rendering — Explicit GPU control, multi-buffered frames, async buffer uploads, depth buffer, MSAA up to 4x
  • Anti-aliased lines — Screen-space quad expansion with SDF smoothing, resolution-independent
  • 18 marker types — SDF-based markers (circle, square, diamond, triangles, pentagon, hexagon, star, plus, cross, filled variants)
  • Dash patterns — GPU-accelerated dash rendering with 8 customizable dash values
  • GPU text rendering — Vulkan text pipeline with stb_truetype atlas (Inter font), depth-tested 3D labels, ImGui fallback
  • MATLAB-style plot API — Format strings like "r--o", "b:*" for quick styling, plus PlotStyle struct for full control

3D Visualization

Geometry & Rendering

  • Full 3D pipeline — Model-View-Projection transforms, depth buffer, 10+ dedicated 3D shaders
  • 3D series types — ScatterSeries3D, LineSeries3D, SurfaceSeries, MeshSeries
  • Colormaps — Viridis, Plasma, Inferno, Magma, Jet, Coolwarm, Grayscale
  • Blinn-Phong lighting — Configurable light direction, ambient / specular / shininess per series
  • Transparency & painter's sort — Alpha blending with opaque front-to-back, transparent back-to-front
  • Wireframe rendering — Toggle wireframe mode on surfaces and meshes
  • MSAA 4x — Opt-in multisample anti-aliasing for 3D scenes

Camera & Axes

  • Orbit camera — Arcball controls with quaternion rotation, pan, zoom, ortho / perspective
  • Camera animation — Orbit paths, turntable, free-flight with quaternion slerp, timeline integration
  • 2D↔3D transition — Animated camera / axis / grid interpolation between 2D and 3D views
  • 3D axes — Grid planes (XY / XZ / YZ), bounding box, depth-occluded tick labels, axis arrows
  • Header-only math — Self-contained math3d.hpp (~350 LOC): vec3, vec4, mat4, quat (no GLM)

Easy API (MATLAB-style)

  • Progressive complexity — From one-liners to full control in 7 levels
  • 2D functions — plot(), scatter(), subplot(), title(), xlabel(), ylabel(), xlim(), ylim(), grid(), legend()
  • Statistical plots — box_plot(), violin(), histogram(), bar() with filled shapes, semi-transparent fills, auto-computed statistics
  • 3D functions — plot3(), scatter3(), surf(), mesh(), subplot3d(), zlabel(), zlim()
  • Multi-window — figure() creates new OS windows, tab() adds tabs
  • Real-time — on_update(callback) with configurable FPS
  • State accessors — gcf(), gca(), gca3d(), cla() for MATLAB-style workflows

Animation & Recording

Animation Engine

  • Real-time animation — on_frame callbacks, configurable FPS, frame scheduling with delta time
  • Live data streaming — O(1) ring-buffer append with automatic sliding window
  • Timeline editor — Playback state machine, keyframe tracks, scrubbing, snap modes (Frame / Beat / None), loop modes (None / Loop / PingPong)
  • Keyframe interpolator — 7 modes: Step, Linear, CubicBezier, Spring, EaseIn/Out, EaseInOut — with tangent control and auto-tangent (Catmull-Rom)
  • Animation curve editor — Visual Bezier handles, multi-channel support, hit-testing, tangent drag
  • Camera animator — Orbit and free-flight keyframe paths with slerp interpolation, turntable presets
  • Transition engine — Unified animation for float, Color, AxisLimits, inertial pan, camera parameters

Export & Recording

  • PNG sequences — Frame-by-frame headless rendering
  • GIF export — Custom GIF89a writer with median-cut quantization, LZW encoding
  • MP4 export — Frame piping to ffmpeg (behind SPECTRA_USE_FFMPEG flag)
  • Multi-pane recording — Composite rendering with auto-grid layout for split-view captures
  • Headless mode — Offscreen rendering without a window (ideal for CI, servers, batch export)

UI & Productivity

  • Command palette — Fuzzy search (Ctrl+K), 30+ registered commands, recent tracking, category headers
  • Configurable shortcuts — Rebindable keybindings with JSON persistence (~/.config/spectra/keybindings.json)
  • Undo/redo system — Full property change history with grouped operations, undoable property helpers
  • Multi-figure tabs — Tab switching (Ctrl+Tab), duplication, context menus (rename, close others, close to right), per-figure state
  • Docking & split view — Horizontal / vertical splits (Ctrl+\\), drag-to-dock with edge detection, splitter handles with grip dots, max 8 panes
  • Inspector panel — Series statistics (min / max / mean / median / std / percentiles / count), sparkline preview, style editing, axes aggregate stats
  • CSV data loading — File→Data→Load from CSV with column picker, delimiter auto-detection, data preview
  • Workspace management — Save / load full state (v4 format with 3D support), autosave, backward compat (v1–v3)
  • Plugin architecture — C ABI for binary-compatible extensions, PluginManager with dlopen / LoadLibrary, auto-discovery

Data Interaction

  • Hover tooltips — Nearest-point query with series name, coordinates, color swatch
  • Crosshair overlay — Shared across linked subplots with Y-value interpolation from series data
  • Data markers — Pin / remove persistent markers that survive zoom and pan
  • Region selection — Shift-drag rectangular selection with statistics mini-toolbar
  • Legend interaction — Click-to-toggle visibility, drag-to-reposition, animated opacity
  • Multi-axis linking — Link X / Y / Both axes across subplots, synchronized zoom / pan / box-zoom / auto-fit
  • Shared cursor — Linked subplots show interpolated crosshair values from source axes
  • Data transforms — 14 built-in types: Identity, Log10, Ln, Abs, Negate, Normalize, Standardize, Derivative, CumulativeSum, Diff, Scale, Offset, Clamp, Custom — with pipeline chaining and transform registry

Themes & Accessibility

  • Dark / light themes — Smooth animated transitions (non-mutating display colors)
  • 8 colorblind-safe palettes — Okabe-Ito, Tol Bright / Muted, IBM, Wong, Viridis, Monochrome
  • CVD simulation — Test designs for Protanopia, Deuteranopia, Tritanopia, Achromatopsia (Vienot / Brettel matrices)
  • Theme export / import — JSON-based theme customization with save / load
  • Design tokens — Consistent spacing, typography, color system
  • WCAG contrast checking — Color utility methods (luminance, contrast ratio, sRGB / linear / HSL conversions)

Multi-Window & Multi-Process

  • Multi-window support — Independent OS windows; every window behaves the same, so any of them can be closed or torn off
  • Tab tear-off — Detach tabs into new windows, in-process window creation
  • In-process or multi-process — Apps run in-process by default; with SPECTRA_SOCKET set they connect to a spectra-backend daemon that drives separate window processes
  • Figures across windows — Move figures between windows and tabs; each window resizes independently

Python API

Architecture

  • Full IPC bridge — Python ↔ spectra-backend daemon via Unix socket with TLV binary protocol
  • Session-based — Session object manages connection, handshake, request/response, event handling
  • Auto-launch — Backend auto-started on first connection
  • NumPy fast path — Zero-copy data transfer for numpy arrays

API Surface

  • Easy API — spectra.plot(), spectra.scatter(), spectra.show() one-liners with auto-session
  • 3D support — spectra.plot3(), spectra.scatter3(), spectra.surf(), spectra.mesh()
  • Live streaming — Thread-safe spectra.live() with concurrent socket access protection
  • Figure / Axes / Series proxies — figure(), subplot(), line(), scatter(), set_data(), show()

Python Examples

# Session API
import spectra as sp
import numpy as np

s = sp.Session()
fig = s.figure("My Plot")
ax = fig.subplot(1, 1, 1)

x = np.linspace(0, 10, 1000)
line = ax.line(x, np.sin(x), label="sin(x)")
ax.set_title("Trigonometry")
s.show()
# Statistical Plots
import spectra as sp
import numpy as np

data = [np.random.normal(mu, 1, 200) for mu in [0, 2, 5]]

sp.subplot(1, 2, 1)
sp.boxplot(data, positions=[1, 2, 3])
sp.title("Box Plot")

sp.subplot(1, 2, 2)
sp.violin_plot(data, positions=[1, 2, 3])
sp.title("Violin Plot")
sp.show()
# Live Streaming
import spectra as sp
import numpy as np

fig = sp.figure("Live Dashboard")
ax = fig.subplot(1, 1, 1)
line = ax.line([], [], label="sensor")

def update(dt, t):
    line.append(t, np.sin(t) + np.random.normal(0, 0.1))
    ax.set_xlim(max(0, t - 10), t)

sp.live(update, fps=30)
sp.show()

Export & Integration

  • Headless mode — Offscreen rendering without a window (CI, servers, batch export)
  • PNG export — Render to image via stb_image_write
  • GIF export — Custom GIF89a writer with LZW encoding and median-cut quantization
  • MP4 export — Frame piping to ffmpeg (behind SPECTRA_USE_FFMPEG flag)
  • Subplot layouts — Grid-based multi-axes figures with automatic margin / tick layout
  • Zero-copy data — std::span<const float> interfaces avoid unnecessary copies
  • CMake find_package — find_package(spectra) + target_link_libraries
  • Optional Eigen support — Adapters for Eigen::VectorXf behind a feature flag

Roadmap

Spectra is a 0.x public preview: APIs may change before 1.0. Planned work toward 1.0:

  • API stabilization — review the public headers and the Python API, then freeze them for 1.0
  • Platforms — bring macOS and Windows (including multi-process mode) from experimental to supported
  • WebGPU — port the 3D pipelines to WGSL so 3D plots run in the browser
  • Adapters — move the ROS2, PX4 and Qt integrations out of preview
  • Documentation — complete API reference and more end-to-end guides

See the changelog for what has shipped so far.

Recommended Paths

Scientific Analysis

  • 2D/3D plotting + linked axes
  • Data transforms + statistical plots
  • Headless export in CI pipelines

Real-time Monitoring

  • Live streaming append updates
  • Frame scheduler + animation callbacks
  • Crosshair and marker interaction

Embedding / App Integration

  • Qt embed APIs + offscreen render
  • Workspace persistence + shortcuts
  • Plugin-ready architecture