ttkWebSocketIO Library: Receiving vtkDataObjects
Overview
- The
ttkWebSocketIO
library enables bidirectional data transfer between VTK (ParaView) and the browser by serializing vtkDataObjects
and sending them through a websocket connection.
- The library consists of the two endpoints necessary for such a connection:
- Server: A
ttkWebSocketIO
VTK filter (e.g., at the end of a pipeline in ParaView).
- Client: A webpage that uses the
ttkWebSocketIO.js
library (e.g., a visual analytics interface).
- Each
ttkWebSocketIO
filter will internally start a websocket server at a user-specified port (default 9285), and webpages can connect to it using the ttkWebSocketIO.js
library.
- Every time the input
vtkDataObject
of the ttkWebSocketIO
filter changes, the input is send to the connected clients in the form of a serialized JSON object (further processing of the data on the client is up to the developer).
- Symmetrically, clients can send a serialized
vtkDataObject
via the ttkWebSocketIO.js
API to the connected ttkWebSocketIO
filter, which uses the transmitted object to instantiate its output.
- Note: it is actually possible to send and receive any kind of data (not only serialized
vtkDataObjects
), and a webpage can be connected to multiple ttkWebSocketIO
filters.
Example Code