Overview
psys provides an interactive network diagram that visualizes the relationships between listening processes and their network connections using React Flow.Diagram Architecture
The visualization follows a left-to-right layout:- Left side: Listener nodes (processes listening on ports)
- Right side: Target nodes (remote addresses being connected to)
- Edges: Connections between listeners and targets
Node Types
psys implements two custom node types:Listener Nodes
Listener nodes represent processes that are listening on network ports:Listener nodes display process icons (Node.js, Redis, MongoDB, etc.) and Docker indicators for containerized processes.
Target Nodes
Target nodes represent remote addresses that listeners are connecting to:Flow Building Logic
ThebuildFlow function converts connection data into React Flow nodes and edges:
Interactive Controls
The diagram includes React Flow’s built-in interactive features:Available Controls
Zoom
Use mouse wheel or zoom controls to zoom in/out
Pan
Click and drag to pan around the diagram
Minimap
Overview of the entire network topology
Layout Configuration
The layout uses fixed spacing constants:- Listener nodes are positioned vertically on the left at x=40
- Target nodes are positioned at x=40 + LISTENER_NODE_WIDTH + 120
- Vertical spacing between nodes is NODE_HEIGHT + GAP (80px total)
The diagram automatically fits to view on load with
fitView and 20% padding around the edges.