A TypeScript + D3.js application for visualizing ROS2 graphs dynamically. This project provides an interactive interface to visualize, modify, and analyze ROS2 node connections in real-time, with support for hardware differentiation, state/command interfaces, filtering options, and live WebSocket updates.
- Real-time Graph Rendering – Uses D3.js to dynamically visualize ROS2 node connections.
- WebSocket Updates – Automatically updates the graph as new ROS2 messages arrive.
- Node Differentiation –
- Hardware nodes are rectangles, while others are circles.
- State interface nodes are green, while others are black.
- Edge Types & Colors –
- Command interface edges are red.
- State interface edges are blue.
- Interactive Graph – Drag nodes, zoom, and pan for better visualization.
- Node Metadata – Click a node to view metadata in an alert popup.
- Frontend: TypeScript, D3.js
- Backend: Node.js, TypeScript (WebSocket server for ROS2)
- Data Format: JSON messages over WebSocket
git clone https://github.com/Vai-Man/ros2-dag-visualizer.git
cd ros2-dag-visualizer
cd backend
npm install
cd frontend
npm install
cd backend
node index.js
cd frontend
npm start
- Open the frontend in the browser (
http://localhost:5500/
if using Live Server). - The graph updates automatically as WebSocket messages arrive from ROS2.
- Click on a node to view metadata.
The backend listens to ROS2 messages and sends them to the frontend in this JSON format:
{
"start": "A",
"end": "C",
"command_interface": true,
"state_interface": false,
"is_hardware": true,
"metadata": "Hardware node example"
}
start
/end
– Nodes in the graphcommand_interface
– If true, edge is redstate_interface
– If true, edge is blueis_hardware
– If true, the start node is drawn as a rectanglemetadata
– Additional information (displayed on node click)