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, 18 markers, 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 modesWindowManager, FigureRegistry, backend daemon
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 typesScatterSeries3D, 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 functionsplot(), scatter(), subplot(), title(), xlabel(), ylabel(), xlim(), ylim(), grid(), legend()
  • Statistical plotsbox_plot(), violin(), histogram(), bar() with filled shapes, semi-transparent fills, auto-computed statistics
  • 3D functionsplot3(), scatter3(), surf(), mesh(), subplot3d(), zlabel(), zlim()
  • Multi-windowfigure() creates new OS windows, tab() adds tabs
  • Real-timeon_update(callback) with configurable FPS
  • State accessorsgcf(), gca(), gca3d(), cla() for MATLAB-style workflows

Animation & Recording

Animation Engine

  • Real-time animationon_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 with per-window Vulkan swapchain, no "primary window" concept
  • Tab tear-off — Detach tabs into new windows, in-process window creation
  • Dual-mode architecture — Runtime selection between inproc (single-process) and multiproc (daemon + agents) modes
  • Window manager — Uniform window lifecycle, figure-to-window assignment, per-window resize handling
  • FigureRegistry — Stable FigureId-based figure ownership (no positional indexing)

Python API

Architecture

  • Full IPC bridge — Python ↔ spectra-backend daemon via Unix socket with TLV binary protocol
  • Session-basedSession 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 APIspectra.plot(), spectra.scatter(), spectra.show() one-liners with auto-session
  • 3D supportspectra.plot3(), spectra.scatter3(), spectra.surf(), spectra.mesh()
  • Live streaming — Thread-safe spectra.live() with concurrent socket access protection
  • Figure / Axes / Series proxiesfigure(), 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 datastd::span<const float> interfaces avoid unnecessary copies
  • CMake find_packagefind_package(spectra) + target_link_libraries
  • Optional Eigen support — Adapters for Eigen::VectorXf behind a feature flag

Roadmap

UI Redesign (Complete)

PhaseStatusHighlights
Phase 1 — Modern FoundationTheme system, layout, inspector, animated interactions, tooltips, crosshair, transition engine
Phase 2 — Power User FeaturesCommand palette, undo/redo, workspace v2, timeline, recording, colorblind palettes, tabs
Phase 3 — Elite DifferentiatorsDocking/split, MATLAB API (18 markers, dashes), axis linking, shared cursor, transforms, plugins

3D Visualization (Complete)

PhaseStatusHighlights
3D Phase 1Math library, FrameUBO, depth buffer, 3D pipelines, Camera, Axes3D
3D Phase 2Scatter3D, Line3D, Surface, Mesh, colormaps, camera animation
3D Phase 3Blinn-Phong, transparency, MSAA, wireframe, materials, 2D↔3D transition, workspace v4

Multi-Window & IPC (Complete)

MilestoneStatusHighlights
WindowContext extractionPer-window Vulkan resources, no primary window assumption
Multi-window renderingTab tear-off, per-window swapchain, figure-to-window assignment
FigureRegistryStable FigureId ownership, replaces positional indexing
Python IPC20+ message types, Session/Figure/Axes/Series proxies, easy API, live streaming
Multiproc daemonspectra-backend + spectra-window agent architecture

Deployment (Complete)

MilestoneStatusHighlights
Cross-platform CILinux (GCC+Clang), macOS (ARM), Windows (MSVC), sanitizers
Release pipeline.deb, .rpm, .tar.gz, AppImage, .zip, Python wheels, PyPI
DockerMulti-stage build, headless + X11 forwarding
PackagingCPack, AppImage, Homebrew, AUR, shell completions

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