MouseDrag
Simulate mouse drag interactions in an Observable Notebook to test UI actions like moving or zooming elements. Set start/end positions, duration, and target element to reproduce user behavior.
Instructions
Simulate a mouse drag from start to end position. Emits mousedown, mousemove events per animation frame, then mouseup.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "MouseDrag"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endX | No | Ending X coordinate | |
| endY | No | Ending Y coordinate | |
| label | No | Optional label describing the intent of this action (e.g., "expand plot", "zoom in"). Displayed in the notebook's event log overlay. | |
| button | No | Mouse button (0=left, 1=middle, 2=right). Default: 0 | |
| startX | No | Starting X coordinate | |
| startY | No | Starting Y coordinate | |
| duration | No | Duration of drag in milliseconds. Default: 300 | |
| notebook | No | Target notebook (URL, path like "index" or "voronoi", or index like "0"). Optional if you've used FocusNotebook or only one notebook is connected. | |
| selector | No | CSS selector for target element. If provided, positions are relative to element. | |
| timeout_ms | No | Maximum time to wait in milliseconds |