The Panel SDK is in preview. APIs described on this page may change.
Getting Started
Install the Panel SDK and scaffold a new panel project:npm run dev command starts a local development server that hot-reloads your panel inside the Avala viewer. Open any recording in the viewer and your panel appears in the panel selector.
Panel Lifecycle
The Panel SDK uses a lifecycle-based architecture. You export an object that implements lifecycle hooks, and the viewer calls them at the appropriate times.| Hook | Called When | Use Case |
|---|---|---|
onInit(context) | Panel first renders | Set up canvas, WebGL context, initial state |
onMessage(context, topic, message) | New message arrives from a subscribed topic | Update visualization with new data |
onSeek(context, timestamp) | User scrubs the timeline or playback jumps | Jump visualization to a specific timestamp |
onResize(context, width, height) | Panel container dimensions change | Adjust canvas size, reflow layout |
onSettingsChange(context, settings) | User changes a panel setting | Update colors, filters, display options |
onDestroy(context) | Panel removed from the layout | Clean up resources, cancel animations |
Lifecycle Order
When a panel is first added to the layout:onInit— set up your DOM elements and stateonSettingsChange— called immediately with the initial settingsonSeek— called with the current timeline positiononMessage— called for each buffered message at the current timestamp
onMessage is called for every incoming message in chronological order. When the user scrubs the timeline, onSeek is called first, followed by onMessage for messages at the new timestamp.
Data Access
Subscribe to MCAP topics and receive typed messages through theonMessage hook.
Basic Example
Subscribing to Multiple Topics
You can subscribe to multiple topics by listing them in thetopics array. Each call to onMessage includes the topic name so you can route messages accordingly.
Dynamic Topic Subscription
Usecontext.subscribe() to add topic subscriptions at runtime, for example in response to a settings change:
Context API
ThePanelContext object is passed to every lifecycle hook and provides access to the panel DOM, settings, state, and viewer controls.
| Property | Type | Description |
|---|---|---|
panelElement | HTMLElement | Root DOM element for the panel. Append your visualization here. |
settings | Record<string, any> | Current panel settings as configured by the user. |
state | Record<string, any> | Mutable state object persisted across lifecycle calls within a session. |
currentTime | number | Current playback timestamp in nanoseconds since the recording start. |
subscribe(topics) | (topics: TopicSubscription[]) => void | Subscribe to additional topics at runtime. |
seekTo(timestamp) | (timestamp: number) => void | Programmatically seek the viewer timeline to a specific timestamp. |
recording | RecordingInfo | Recording metadata including duration, topic list, and schema definitions. |
RecordingInfo
| Property | Type | Description |
|---|---|---|
duration | number | Total recording duration in nanoseconds |
startTime | number | Recording start timestamp in nanoseconds |
endTime | number | Recording end timestamp in nanoseconds |
topics | TopicInfo[] | List of all topics in the recording |
schemas | SchemaInfo[] | List of all message schemas |
TopicInfo
| Property | Type | Description |
|---|---|---|
name | string | Topic name (e.g., /camera/image) |
schemaName | string | Schema name (e.g., sensor_msgs/Image) |
messageCount | number | Total number of messages on this topic |
The
state object is not persisted across browser sessions. Use it for transient state like canvas references, animation frame IDs, and computed caches. For persistent configuration, use settings.Panel Settings
Define configurable settings that appear in the panel’s settings UI. Each setting type renders an appropriate input control.| Setting Type | Description | Example Use |
|---|---|---|
select | Dropdown with predefined options | Color map, rendering mode |
number | Numeric input with optional min/max/step | Opacity, threshold, point size |
boolean | Toggle switch | Show/hide grid, enable smoothing |
text | Free-form text input | Custom title, regex filter |
color | Color picker with hex output | Overlay color, background color |
topic | Topic selector dropdown populated from the recording | Dynamic topic binding |
Defining Settings
onSettingsChange. Invalid values are rejected and the previous valid value is preserved.
Building and Publishing
Build
Compile your panel into a distributable bundle:dist/ directory along with a manifest file that the viewer uses to load the panel.
Package
Create a.avala-panel archive for distribution:
Publish
Publish the panel to your organization so all team members can use it:Versioning
Panels follow semantic versioning. The version is read frompackage.json. When you publish a new version, users who have the panel in their layout are prompted to update.
| Version Bump | When to Use |
|---|---|
Patch (1.0.1) | Bug fixes, no API changes |
Minor (1.1.0) | New features, backward-compatible |
Major (2.0.0) | Breaking changes to settings schema or behavior |
Example: Trajectory Panel
A complete example that plots 2D robot trajectories from navigation topics.Marketplace
Discover and install panels built by the Avala community. Browse the marketplace from the panel selector in the viewer, or visit the marketplace page in Mission Control.Categories
| Category | Examples |
|---|---|
| Robotics | Trajectory visualization, joint state viewer, TF tree |
| Automotive | CAN bus decoder, lane detection overlay, traffic sign viewer |
| Industrial | PLC status monitor, conveyor throughput chart, alarm timeline |
| Research | Distribution plots, latent space viewer, reward curve tracker |
Installing a Marketplace Panel
- Open the panel selector in the viewer.
- Navigate to the Marketplace tab.
- Find the panel you want and click Install.
- The panel is added to your organization and available immediately.
Next Steps
Panel Types
Explore the built-in panel types available in the MCAP viewer.
MCAP Viewer
Learn about the multi-sensor viewer that hosts custom panels.
Fleet Dashboard
Build fleet-level dashboards that incorporate custom panel visualizations.